submission_id stringlengths 10 10 | problem_id stringlengths 6 6 | language stringclasses 3
values | code stringlengths 1 522k | compiler_output stringlengths 43 10.2k |
|---|---|---|---|---|
s851836294 | p02261 | C++ | #include <iostream>
using namespace std;
struct Card { char suit, value; };
void bubble(struct Card A[], int N) {
for ( int i = 0; i < N ; i++ ){
for (int j = N - 1; j >= i + 1; j-- ){
if(A[j].value < A[j-1].value){
Card t = A[j]; A[j] = A[j-1]; A[j-1] = t;
}
... | a.cc: In function 'void print(Card*, int)':
a.cc:31:21: error: request for member 'suit' in 'i', which is of non-class type 'int'
31 | cout << A[i.suit] <<A[i].value;
| ^~~~
|
s829112485 | p02261 | C++ | #include <algorithm>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
typedef vector <string> svector;
void stablesort(svector &A){
stable_sort(A.begin(), A.end(), [](string x, string y) { return (x[1]) < (y[1]);});
return 0;
}
int bubblesort(svector &A){
int n = A.size();
for (i... | a.cc: In function 'void stablesort(svector&)':
a.cc:10:16: error: return-statement with a value, in function returning 'void' [-fpermissive]
10 | return 0;
| ^
|
s660564052 | p02261 | C++ | #include <algorithm>
using namespace std;
int main(){
int n;
cin >> n;
string date1[36],date2[36];
for(int i = 0; i < n; i++){
cin >> date1[i];
date2[i] = date1[i];
}
for(int i = 0; i < n; i++)
for(int j = n -1; j > i; j--)
if(date1[j-1][1] > date1[j][1])
swap(date1[j-1],... | a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope
6 | cin >> n;
| ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
1 | #include <algorithm>
+++ |+#include <iostream>
2 | usin... |
s826999434 | p02262 | Java | import java.util.*;
import static javafx.scene.input.KeyCode.G;
public class Main {
public static void main(String[] args) {
Scanner inp = new Scanner(System.in);
int total = inp.nextInt();
int[] b = new int[total];
for (int k = 0; k < total; k++) {
int a = inp.nextIn... | Main.java:3: error: package javafx.scene.input does not exist
import static javafx.scene.input.KeyCode.G;
^
Main.java:3: error: static import only from classes and interfaces
import static javafx.scene.input.KeyCode.G;
^
2 errors
|
s424698752 | p02262 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ShellSort {
private final static StringBuilder sortedSeq = new StringBuilder();
private final static String lb = System.getProperty("line.separator");
private static int count;
public static void main(String[... | Main.java:5: error: class ShellSort is public, should be declared in a file named ShellSort.java
public class ShellSort {
^
1 error
|
s287021357 | p02262 | Java | import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;
class Main {
public static int cnt = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for(int i = 0; i < n; ++i) {
a[i] = sc.nextInt();
}
... | Main.java:17: error: ';' expected
System.out.println(3)//cnt);
^
1 error
|
s836891768 | p02262 | Java | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
static int N;
public static void main(String[] args){
int n = scan.nextInt();
int[] arr = new int[n];
for(int i = 0; i < n; i++){
arr[i] = scan.nextInt();
}
shellSort(arr, n);
}
static int inserSort... | Main.java:54: error: cannot find symbol
cnt = insertSort(arr, n, g[i], cnt);
^
symbol: variable arr
location: class Main
Main.java:63: error: cannot find symbol
System.out.printf("%d\n", arr[i]);
^
symbol: variable arr
location: class Main
2 errors
|
s069245329 | p02262 | Java | import java.util.*;
public class Main{
private static final Scanner scan = new Scanner(System.in);
static int N;
public static void main(String[] args){
int n = scan.nextInt();
int[] arr = new int[n];
for(int i = 0; i < n; i++){
arr[i] = scan.nextInt();
}
shellSort(arr, n);
}
static int inserSort... | Main.java:54: error: cannot find symbol
cnt = insertSort(a, n, g[i], cnt);
^
symbol: method insertSort(int[],int,int,int)
location: class Main
1 error
|
s382078198 | p02262 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Shellsort {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int cnt;
int m = 2;
int [] G = new int[m];
G[0] = 4;
... | Main.java:5: error: class Shellsort is public, should be declared in a file named Shellsort.java
public class Shellsort {
^
1 error
|
s843885680 | p02262 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Shellsort {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int cnt;
int m = 2;
int [] G = new int[m];
G[0] = 4;
... | Main.java:5: error: class Shellsort is public, should be declared in a file named Shellsort.java
public class Shellsort {
^
1 error
|
s518885694 | p02262 | Java | import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;
public class ShellSort {
static int count = 0;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[] a = new int[n];
for (int i = 0; i < n; i++) {
... | Main.java:6: error: class ShellSort is public, should be declared in a file named ShellSort.java
public class ShellSort {
^
1 error
|
s152018575 | p02262 | Java | import java.util.Scanner;
class Main {
public static void main(String args[]) {
Scanner scanner = new Scanner(System.in);
int num = scanner.nextInt();//要素数
int array[] = new int[num];
for(int i = 0; i < num; i ++ ){
array[i] = scanner.nextInt();
}
shellSort(array, num);
scanner.close();
}
... | Main.java:39: error: ']' expected
int arrayG[100];
^
1 error
|
s484555508 | p02262 | Java | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
int n = Integer.parseInt(br.readLine());
... | Main.java:29: error: cannot find symbol
int k = Double.valueOf( Math.sqrt(num) ).intValue();
^
symbol: variable num
location: class Main
1 error
|
s412318023 | p02262 | C | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s759070407 | p02262 | C | #include<stdio.h>
#include<stdlib.h>
#define N 1000000
int count=0,l*S;
void insertionSort(int A[], int n, int m){
int i,v,j;
for(i=m;i<n;i++){
v=A[i];
j=i-m;
while(j>=0&&A[j]>v){
A[j+m]=A[j];
j-=m;
count++;
}
A[j+m]=v;
}
}
void Sort(int A[],int n){
int i=0,a;
S=(int ... | main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token
4 | int count=0,l*S;
| ^
main.c: In function 'Sort':
main.c:23:3: error: 'S' undeclared (first use in this function)
23 | S=(int *)malloc(n * sizeof(int));
| ^
main.c:23:3: note: each undeclared ide... |
s120411064 | p02262 | C | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s689762447 | p02262 | C | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s099525968 | p02262 | C | #include<iostream>
using namespace std;
int InsertionSort(int* a, int n, int g)
{
int tmp, j, count = 0;
for (int i = g; i < n; i++)
{
tmp = a[i];
for (j = i - g; j >= 0 && a[j] > tmp; j -= g)
{
a[j + g] = a[j];
count++;
}
a[j + g] = tmp;
}
return count;
}
int ShellSort(int* a, int n)
{
int m,... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s957194613 | p02262 | C | #include<iostream>
using namespace std;
int InsertionSort(int* a, int n, int g)
{
int tmp, j, count = 0;
for (int i = g; i < n; i++)
{
tmp = a[i];
for (j = i - g; j >= 0 && a[j] > tmp; j -= g)
{
a[j + g] = a[j];
count++;
}
a[j + g] = tmp;
}
return count;
}
int ShellSort(int* a, int n)
{
int m,... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s969492398 | p02262 | C | #include<iostream>
using namespace std;
int InsertionSort(int* a, int n, int g)
{
int tmp, j, count = 0;
for (int i = g; i < n; i++)
{
tmp = a[i];
for (j = i - g; j >= 0 && a[j] > tmp; j -= g)
{
a[j + g] = a[j];
count++;
}
a[j + g] = tmp;
}
return count;
}
int ShellSort(int* a, int n)
{
int m,... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s936761630 | p02262 | C | #include<stdio.h>
struct card
{
char num[2];
char mark;
int value;
};
int n;
char isStable(struct card in[], struct card out[])
{
for(i = 0; i < n; i++)
{
if(b[i].value != c[i].value)
{
return 0;
}
}
return 1;
}
int main()
{
int i, j, minj, k;
struct card c[36], a[36], b[36], tmp;
sca... | main.c: In function 'isStable':
main.c:11:7: error: 'i' undeclared (first use in this function); did you mean 'in'?
11 | for(i = 0; i < n; i++)
| ^
| in
main.c:11:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:10: error: 'b' undeclared (f... |
s535724058 | p02262 | C | #include<stdio.h>
int cnt;
void insertionSort(int A[],int n,int g);
void shellSort(int A[],int n;
int n;
int A[1000000];
int main(){
int i;
scanf("%d",&n);
for(i=0;i<n;i++)scanf("%d",A+i);
shellSort(A,n);
printf("%d\n",cnt);
for(i=0;i<n;... | main.c:11:12: error: expected ';', ',' or ')' before '{' token
11 | int main(){
| ^
|
s423221609 | p02262 | C | #include<stdio.h>
#define N 1000000
int a[N];
int cnt=0;
int G[N];
int m=1;
void insertionSort(int n,int g){
for(int i=g;i<n;i++){
int v=a[i];
int j=i-g;
while(j>=0 && a[j] > v){
a[j+g]=a[j];
cnt++;
j=j-g;
}
a[j+g]=v;
}
return;
... | main.c: In function 'main':
main.c:63:5: error: expected declaration or statement at end of input
63 | return 0;
| ^~~~~~
|
s739644350 | p02262 | C | #include<stdio.h>
int main()
{
int n, i, j, k, v, x, cnt=0, m=0;
int A[1000000];
int G[1000000];
scanf("%d", &n);
for(i = 0 ; i < n ; i++) {
scanf("%d", &A[i]);
}
G[0 =1 ;
for(i = 1 ; G[i-1] <= n ; i++) {
m++;
G[i] = G[i-1] * 3 + 1;
if(m > 100) break;
}
for(i = 0 ; i< m/2 ; ... | main.c: In function 'main':
main.c:14:7: error: lvalue required as left operand of assignment
14 | G[0 =1 ;
| ^
main.c:14:9: error: expected ']' before ';' token
14 | G[0 =1 ;
| ^~
| ]
main.c:49:12: error: expected ';' before '}' token
49 | return 0;
| ... |
s610811405 | p02262 | C | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s295919281 | p02262 | C | #include <stdio.h>
int g[102], m;
int cnt;
void shell_sort(int n,int *a)
{
int i,j,h,lim;
int key;
lim=n/9;
if(lim<40) lim=40;
g[0]=1;
m=0;
do m++,g[m]=3*g[m-1]+1;
while(g[m]<n&&g[m]<=lim);
cnt=0,h=g[m-1];
while(h>0){
for(i=h,i<n;i++){
key=a[i];
j=i-h;
while(j>=0&&a[j]>key... | main.c: In function 'shell_sort':
main.c:20:20: error: expected ';' before ')' token
20 | for(i=h,i<n;i++){
| ^
| ;
|
s062894047 | p02262 | C | #include<stdio.h>
#include<iostream>
#define M 1000000/* your task*/
#define L 14
char H[M][L]; /* Hash Table */
int getChar(char ch){
if ( ch == 'A') return 1;
else if ( ch == 'C') return 2;
else if ( ch == 'G') return 3;
else if ( ch == 'T') return 4;
}
/* convert a string into an integer value */
long lo... | main.c:2:9: fatal error: iostream: No such file or directory
2 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s777159967 | p02262 | C | #include <iostream>
#include <utility>
#include <cstdio>
using namespace std;
void insertionSort(int A[], const int n, const int g, int *cnt)
{
for( int i = g; i < n; ++i ){
int tmp = A[i];
int j = i - g;
while( -1 < j && tmp < A[j] ){
//cout << A[j+g] << "<-->" << A[j] << endl;... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s279009909 | p02262 | C | #include<iostream>
#include<cmath>
using namespace std;
#include<vector>
#define ArrayNum 100
vector<int> g;
int insertionSort(int a[],int n,int g){
int i,j,cnt=0,v;
for(i=g;i<n;i++){
v= a[i];
j=i-g;
while(j>=0 && a[j]>v){
a[j+g]=a[j];
j=j-g;
cnt++;
}
a[j+g]=v;
}
return... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s196401443 | p02262 | C | #include<iostream>
#include<cmath>
using namespace std;
#include<vector>
#define ArrayNum 100
vector<int> g;
int insertionSort(int a[],int n,int g){
int i,j,cnt=0,v;
for(i=g;i<n;i++){
v= a[i];
j=i-g;
while(j>=0 && a[j]>v){
a[j+g]=a[j];
j=j-g;
cnt++;
}
a[j+g]=v;
}
return... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s130928972 | p02262 | C | #include<iostream>
#include<cmath>
using namespace std;
#include<vector>
#define ArrayNum 100
vector<int> g;
int insertionSort(int a[],int n,int g){
int i,j,cnt=0,v;
for(i=g;i<n;i++){
v= a[i];
j=i-g;
while(j>=0 && a[j]>v){
a[j+g]=a[j];
j=j-g;
cnt++;
}
a[j+g]=v;
}
return... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s474623098 | p02262 | C | #include<iostream>
#include<cmath>
using namespace std;
#include<vector>
#define ArrayNum 100
vector<int> g;
int insertionSort(int a[],int n,int g){
int i,j,cnt=0,v;
for(i=g;i<n;i++){
v= a[i];
j=i-g;
while(j>=0 && a[j]>v){
a[j+g]=a[j];
j=j-g;
cnt++;
}
a[j+g]=v;
}
return... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s132152008 | p02262 | C | #include <iostream>
#include <algorithm>
using namespace std;
#define MAX 1000000
int a[MAX+1];
int n;
int m = 2;
int g[2] = {2, 1};
int cnt = 0;
void insertionsort(int G) {
for(int i=G; i<n; i+=G) {
int v = a[i];
int j = i - G;
while(j>=0 && a[j] > v) {
a[j+G] = a[j];
j -= G;
++cnt;... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s053364572 | p02262 | C | 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#define N 100000
int main(){
int i, j, k, v, g, cnt=0, m=1, n, A[N], G[N];
scanf("%d",&n);
if(n > N) exit(1);
for(i = 0; i ... | main.c:1:1: error: expected identifier or '(' before numeric constant
1 | 1
| ^
In file included from /usr/include/stdio.h:47,
from main.c:47:
/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h:28:43: error: unknown type name 'size_t'
28 | ... |
s044900438 | p02262 | C | main(){
int i,n,A[N],v,k,j;
scanf("%d",&n);
for(i = 0; i < n; i++) scanf("%d",&A[i]);
while (3 * G[m-1] + 1 < n) {
G[m] = 3 * G[m-1] + 1;
m++;
}
// shellSort(A,n);
for (i = 0; i < m / 2; i++) {
v = G[i];
G[i] = G[m-1-i];
G[m-1-i] = v;
}
for (i = 0; i < m; i++) {
for (j = ... | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | main(){
| ^~~~
main.c: In function 'main':
main.c:2:13: error: 'N' undeclared (first use in this function)
2 | int i,n,A[N],v,k,j;
| ^
main.c:2:13: note: each undeclared identifier is reported only once for each func... |
s354718993 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int n, i, j, k;
int *A;
int cnt, m, G[12], v;
scanf("%d", &n);
A = (int *)malloc(sizeof(int) * n)
for (i = 0; i < n; i++) scanf("%d", &A[i]);
cnt = 0;
m = 1;
G[0] = 1;
while (3 * G[m-1] + 1 < n) {
G[m] = 3 * G[m-... | main.c: In function 'main':
main.c:12:37: error: expected ';' before 'for'
12 | A = (int *)malloc(sizeof(int) * n)
| ^
| ;
13 |
14 | for (i = 0; i < n; i++) scanf("%d", &A[i]);
| ~~~ ... |
s296208685 | p02262 | C | #include<stdio.h>
#define N 1000000
void insertionSort(int *,int,int);
void shellSort(int *,int);
int cnt = 0;
int a[N];
int main(){
int b,i;
scanf("%d",&b);
for(i=0;i<b;i++){
scanf("%d",&a[i]);
}
shellSort(a,n);
printf("%d\n",cnt);
for(i=0;i<b;i++){
printf("%d\n",a[i]);
}
return 0;
}
void i... | main.c: In function 'main':
main.c:14:15: error: 'n' undeclared (first use in this function)
14 | shellSort(a,n);
| ^
main.c:14:15: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'shellSort':
main.c:45:15: error: 'M' undeclared (first ... |
s414861374 | p02262 | C | #include<stdio.h>
#define N 1000000
void insertionSort(int [],int,int);
void shellSort(int [],int);
int cnt = 0;
int main(){
int b,i,a[N];
scanf("%d",&b);
for(i=0;i<b;i++){
scanf("%d",&a[i]);
}
shellSort(a,b);
printf("%d\n",cnt);
for(i=0;i<b;i++){
printf("%d\n",a[i]);
}
return 0;
}
void inse... | main.c: In function 'shellSort':
main.c:55:19: error: 'a' undeclared (first use in this function)
55 | insertionSort(a,n,G[i]);
| ^
main.c:55:19: note: each undeclared identifier is reported only once for each function it appears in
|
s457371745 | p02262 | C | #include<stdio.h>
#define N 1000000
void insertionSort(int [],int,int);
void shellSort(int [],int);
int cnt = 0;
main(){
int b,i,a[N];
scanf("%d",&b);
for(i=0;i<b;i++){
scanf("%d",&a[i]);
}
shellSort(a,b);
printf("%d\n",cnt);
for(i=0;i<b;i++){
printf("%d\n",a[i]);
}
return 0;
}
void insertio... | main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
7 | main(){
| ^~~~
main.c: In function 'shellSort':
main.c:55:19: error: 'a' undeclared (first use in this function)
55 | insertionSort(a,n,G[i]);
| ^
main.c:55:19: note: each undeclared identifier is reported onl... |
s974693474 | p02262 | C | #include<stdio.h>
#define N 1000000
void insertionSort(int [],int,int);
void shellSort(int [],int);
int cnt = 0;
main(){
int b,i,A[N];
scanf("%d",&b);
for(i=0;i<b;i++){
scanf("%d",&A[i]);
}
shellSort(A,b);
printf("%d\n",cnt);
for(i=0;i<b;i++){
printf("%d\n",A[i]);
}
return 0;
}
void insertio... | main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
7 | main(){
| ^~~~
main.c: In function 'shellSort':
main.c:55:19: error: 'a' undeclared (first use in this function)
55 | insertionSort(a,n,G[i]);
| ^
main.c:55:19: note: each undeclared identifier is reported onl... |
s270672549 | p02262 | C | #include<stdio.h>
#define N 1000000
void insertionSort(int [],int,int);
void shellSort(int [],int);
int cnt = 0;
main(){
int b,i,A[N];
scanf("%d",&b);
for(i=0;i<b;i++){
scanf("%d",&A[i]);
}
shellSort(A,b);
printf("%d\n",cnt);
for(i=0;i<b;i++){
printf("%d\n",A[i]);
}
return 0;
}
void insertio... | main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
7 | main(){
| ^~~~
main.c: In function 'shellSort':
main.c:57:19: error: 'a' undeclared (first use in this function)
57 | insertionSort(a,n,G[i]);
| ^
main.c:57:19: note: each undeclared identifier is reported onl... |
s012728274 | p02262 | C | #include <stdio.h>
#define ARRAY_MAX 1000000
#define ARRAY_INIT 0
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
void insert_sort( unsigned long *aulW_Dtestcase, unsigned long ulW_Dtc_cnt, unsigned long g );
unsigned long ulG_Csort_cnt = DIV_INIT;
int main( void )
{
unsigned long ulW_Dtc_cnt;
unsigned lo... | main.c: In function 'main':
main.c:27:41: error: 'ulW_Dloop_cnt' undeclared (first use in this function); did you mean 'ulW_Cloop_cnt'?
27 | for( ulW_Cloop_cnt = LOOP_INIT; ulW_Dloop_cnt < ulW_Dtc_cnt; ulW_Cloop_cnt++ ){
| ^~~~~~~~~~~~~
| ... |
s294406360 | p02262 | C | #include <stdio.h>
#define ARRAY_INIT 0
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
int main( void )
{
unsigned long ulW_Dtc_cnt;
unsigned long *aulW_Dtestcase;
unsigned long ulW_Dshell_p;
unsigned long ulW_Cloop_cnt;
unsigned long ulW_Cloop_sub_cnt;
unsigned long ulW_Csort_cnt = DIV_INIT;
unsigned... | main.c: In function 'main':
main.c:22:36: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
22 | aulW_Dtestcase = ( int * ) malloc ( sizeof ( int ) * ulW_Dtc_cnt );
| ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declarati... |
s271439397 | p02262 | C | #include <stdio.h>
#define ARRAY_INIT 0
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
int main( void )
{
unsigned long ulW_Dtc_cnt;
int *aulW_Dtestcase;
unsigned long ulW_Cloop_cnt;
unsigned long ulW_Cloop_sub_cnt;
unsigned long ulW_Csort_cnt = DIV_INIT;
unsigned long ulW_Dm;//????????????????????????... | main.c: In function 'main':
main.c:21:36: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
21 | aulW_Dtestcase = ( int * ) malloc ( sizeof ( int * ) ulW_Dtc_cnt );
| ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declarati... |
s781309532 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define ARRAY_INIT 0
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
int main( void )
{
unsigned long ulW_Dtc_cnt;
insigned long *aulW_Dtestcase;
unsigned long ulW_Cloop_cnt;
unsigned long ulW_Cloop_sub_cnt;
unsigned long ulW_Csort_cnt = DIV_INIT;
unsigned long ulW... | main.c: In function 'main':
main.c:12:9: error: 'insigned' undeclared (first use in this function)
12 | insigned long *aulW_Dtestcase;
| ^~~~~~~~
main.c:12:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:17: error: expected ';' before 'long'
... |
s809066963 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define ARRAY_INIT 0
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
#define FIRST_ITEM 0
#define EXIT_SUCCESS 0
int main( void )
{
unsigned long ulW_Dtc_cnt;
int *aulW_Dtestcase;
unsigned long ulW_Cloop_cnt;
unsigned long ulW_Cloop_sub_cnt;
unsigned long ulW_Csort_... | main.c: In function 'main':
main.c:31:34: error: 'ulW_Dm' undeclared (first use in this function); did you mean 'ulW_Dv'?
31 | ulW_Dcalc = 3 * aulW_DG[ ulW_Dm - 1 ] + 1
| ^~~~~~
| ulW_Dv
main.c:31:34: note: each undeclared identifi... |
s167068331 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define ARRAY_INIT 0
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
#define FIRST_ITEM 0
#define EXIT_SUCCESS 0
int main( void )
{
unsigned long ulW_Dtc_cnt;
int *aulW_Dtestcase;
unsigned long ulW_Cloop_cnt;
unsigned long ulW_Cloop_sub_cnt;
unsigned long ulW_Csort_... | main.c: In function 'main':
main.c:31:50: error: expected ';' before 'while'
31 | ulW_Dcalc = 3 * aulW_DG[ ulW_Dm - 1 ] + 1
| ^
| ;
32 | while( ulW_Dcalc < ulW_Dtc_cnt ){
| ~... |
s907023767 | p02262 | C | #include <stdio.h>
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
#define FIRST_ITEM 0
#define ONE 1
#define EXIT_SUCCESS 0
#define PREV_ITEM( x ) x - 1
#define THEREE_TIMES( x ) x * 3
#define HALF( x ) x / 2
int main( void )
{
unsigned long ulW_Dtc_cnt;
int *aulW_Dtestcase;
unsigned long ulW_Cloop_cnt;
... | main.c: In function 'main':
main.c:27:26: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
27 | aulW_Dtestcase = malloc ( sizeof( int ) * ulW_Dtc_cnt );
| ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
1 ... |
s901782615 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
#define FIRST_ITEM 0
#define ONE 1
#define EXIT_SUCCESS 0
#define PREV_ITEM( x ) x - 1
#define THEREE_TIMES( x ) x * 3
#define HALF( x ) x / 2
int main( void )
{
unsigned long ulW_Dtc_cnt;
int *aulW_Dtestcase;
unsigned l... | main.c: In function 'main':
main.c:34:21: error: implicit declaration of function 'THREE_TIMES'; did you mean 'THEREE_TIMES'? [-Wimplicit-function-declaration]
34 | ulW_Dcalc = THREE_TIMES( ulW_Dinterval_array[ PREV_ITEM( ulW_Dinterval_num ) ] ) + ONE;
| ^~~~~~~~~~~
| ... |
s931628668 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define DIV_INIT 0
#define LOOP_INIT 0
#define G_MAX 12
#define FIRST_ITEM 0
#define ONE 1
#define EXIT_SUCCESS 0
#define PREV_ITEM( x ) x-1
#define THEREE_TIMES( x ) x*3
#define HALF( x ) x/2
int main( void )
{
unsigned long ulW_Dtc_cnt;
int *aulW_Dtestcase;
unsigned long ul... | main.c: In function 'main':
main.c:34:21: error: implicit declaration of function 'THREE_TIMES'; did you mean 'THEREE_TIMES'? [-Wimplicit-function-declaration]
34 | ulW_Dcalc = THREE_TIMES( ulW_Dinterval_array[ PREV_ITEM( ulW_Dinterval_num ) ] ) + ONE;
| ^~~~~~~~~~~
| ... |
s695796959 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define DIV_INIT 0
#define LOOP_INIT 0
#define INTERVAL_ARRAY_MAX 12
#define FIRST_ITEM 0
#define ONE 1
#define EXIT_SUCCESS 0
#define PREV_ITEM( x ) x - 1
#define THREE_TIMES( x ) x * 3
#define HALF( x ) x / 2
int main( void )
{
unsigned long ulW_Dtc_cnt;
int *aulW_Dtestcase;... | main.c:76:2: error: stray '#' in program
76 | }#include <stdio.h>
| ^
main.c:76:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
76 | }#include <stdio.h>
| ^
|
s813944407 | p02262 | C | #define dbg(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
#define dpri(x) dbg(#x ": %d\n", x)
#define dprs(x) dbg(#x ": %s\n", x)
#include <stdio.h>
typedef long long ll;
#define MYINF (1000000007)
static int A[MYINF];
static int n;
static int cnt;
static int m;
static int G[128];
void insertion_sort(int g) {
int i, j, v... | /tmp/cc1JPZ6M.o: in function `insertion_sort':
main.c:(.text+0x74): relocation truncated to fit: R_X86_64_PC32 against `.bss'
main.c:(.text+0x7d): relocation truncated to fit: R_X86_64_PC32 against `.bss'
main.c:(.text+0xc8): relocation truncated to fit: R_X86_64_PC32 against `.bss'
/tmp/cc1JPZ6M.o: in function `shell_... |
s845324140 | p02262 | C | #include<stdio.h>
void insersort(int*,int,int);
#define N 1000000
int cnt=0;
int main(){
int a[N],g[N],i,n,m=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;;i++){
g[i]=1+3*i;
if(g[i]>=n)break;
m++;
}
for(i=m-1;i>=0;i--){
insersort(a,n,g[i]);
}
printf("%d\n... | main.c: In function 'main':
main.c:26:20: error: expected expression before '.' token
26 | printf("%d\n",m);.
| ^
|
s502650036 | p02262 | C | #include<stdio.h>
void insersort(int*,int,int);
#define N 1000000
int cnt=0;
int main(){
int a[N],g[N],i,n,m=0;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&a[i]);
}
for(i=0;;i++){
g[i]=1+3*i;
if(g[i]>=n)break;
m++;
}
for(i=m-1;i>=0;i--){
insersort(a,n,g[i]);
}
printf("%d\n... | main.c: In function 'main':
main.c:26:20: error: expected expression before '.' token
26 | printf("%d\n",m);.
| ^
|
s172454062 | p02262 | C | #include <stdio.h>
#define N 1000000000
#define SIZE 20
void insertionSort(int n,int g);
void shellSort(int n);
int A[N];
int G[SIZE] = {1,4,13,40,121,364,1093,3280,9841,29524,88573,205720,737161,2331484,7114453,21463360,64510081,193650244,581070733,1743332200};
int cnt=0,m;
int main(){
int i,j,n;
scanf("%d",&n);
... | /tmp/cctP3FW4.o: in function `main':
main.c:(.text+0x72): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cctP3FW4.o
main.c:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cctP3FW4.o
main.c:(.text+0xed): relocation... |
s175501988 | p02262 | C | #include <stdio.h>
#define N 1000000005
#define SIZE 14
void insertionSort(int n,int g);
void shellSort(int n);
int A[N];
int G[SIZE] = {1,4,13,40,121,364,1093,3280,9841,29524,88573,205720,737161,2331484};
int cnt=0,m;
int main(){
int i,j,n;
scanf("%d",&n);
for(i=0; i<n; i++){
scanf("%d",&A[i]);
}
... | /tmp/cckhJML9.o: in function `main':
main.c:(.text+0x72): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cckhJML9.o
main.c:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/cckhJML9.o
main.c:(.text+0xed): relocation... |
s277353826 | p02262 | C | void shellSort(int numbers[], int array_size)
{
int i, j, increment, temp;
increment = 4;
while (increment > 0)
{
for (i=0; i < array_size; i++)
{
j = i;
temp = numbers[i];
while ((j >= increment) && (numbers[j-increment] > temp))
{
numbers[j] = numbers[j - increment];
... | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
|
s551124472 | p02262 | C | #include <stdio.h>
#define Max 1000000
int cnt=0, count = 0, n;
int A[Max], G[Max];
void shellSort(int*,int);
void insertionSort(int*,int,int);
int main()
{
int i,len;
scanf("%d",&n);
for(i=0;i<n;i++){
scanf("%d",&A[i]);
}
shellSort(A,n);
printf("%d\n",count);
for(i=count-1;i>-1;i-- )... | main.c: In function 'insertionSort':
main.c:52:3: error: unknown type name 'it'; did you mean 'int'?
52 | it i, j, v;
| ^~
| int
|
s246576676 | p02262 | C | #include<stdio.h>
void insertionSort(int *,int ,int);
void shellSort(int *,int);
int count;
int main()
{
int n,i,A[1000001];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&A[i]);
}
shellSort(A,n);
for(i=0;i<n;i++)
{
printf("%d\n",A[i]);
}
return 0;
}
void insertionSort(... | main.c: In function 'insertionSort':
main.c:35:9: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
35 | cnt++;
| ^~~
| int
main.c:35:9: note: each undeclared identifier is reported only once for each function it appears in
|
s047316697 | p02262 | C | #include<stdio.h>
void insertionSort(int *,int ,int);
void shellSort(int *,int);
int count;
int main()
{
int n,i,A[1000000];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&A[i]);
}
shellSort(A,n);
for(i=0;i<n;i++)
{
printf("%d\n",A[i]);
}
return 0;
}
void insertionSort(... | main.c: In function 'insertionSort':
main.c:35:9: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
35 | cnt++;
| ^~~
| int
main.c:35:9: note: each undeclared identifier is reported only once for each function it appears in
|
s366363117 | p02262 | C | #include <stdio.h>
#include <iostream>
#include <math.h>
void shellSort(int numbers[], int array_size);
int calculation(int value);
int main(){
int N;
int i;
printf("??´??°?????°?????\??? N < 1000000 \n");
scanf("%d", &N);
static int a[1000000];
for (i = 0; i < N; i++){
scanf("%d", &a[i]);
}
shellSort(a,... | main.c:2:10: fatal error: iostream: No such file or directory
2 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s000340347 | p02262 | C |
//shell sort
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int i,j;
int n, cnt, a[1000000000] = {0}, g[100000] = {0};
void insertion_sort(int*, int, int);
int main(void)
{
int m;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
cnt = 0;
g[0] = 1;
m = 1;
for(i = 0; g[... | /tmp/ccwGlGad.o: in function `main':
main.c:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccwGlGad.o
main.c:(.text+0xbc): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccwGlGad.o
main.c:(.text+0xe2): relocation... |
s547008965 | p02262 | C |
//shell sort
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int i,j;
int n, cnt, a[1000000000] = {0}, g[100000] = {0};
void insertion_sort(int*, int, int);
int main(void)
{
int k;
int m;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
cnt = 0;
g[0] = 1;
m = 1;
for(i =... | /tmp/ccdDXwet.o: in function `main':
main.c:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccdDXwet.o
main.c:(.text+0xbc): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccdDXwet.o
main.c:(.text+0xe2): relocation... |
s177167785 | p02262 | C | #include <stdio.h>
int i,j;
int n, cnt, a[1000000000] = {0}, g[100000] = {0};
void insertion_sort(int*, int, int);
int main(void)
{
int k;
int m;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
cnt = 0;
g[0] = 1;
m = 1;
for(i = 0; g[i] < n; i++)
{
g[i+1] = 3 * g[i] + 1;
m++;
... | /tmp/cc5QZCgQ.o: in function `main':
main.c:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/cc5QZCgQ.o
main.c:(.text+0xbc): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/cc5QZCgQ.o
main.c:(.text+0xe2): relocation... |
s137692677 | p02262 | C | #include <stdio.h>
int n, cnt, a[1000000000] = {0}, g[100000] = {0};
void insertion_sort(int*, int, int);
int main(void)
{
int i,j,k;
int m;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
cnt = 0;
g[0] = 1;
m = 1;
for(i = 0; g[i] < n; i++)
{
g[i+1] = 3 * g[i] + 1;
m++;
}
f... | /tmp/ccptZFGO.o: in function `main':
main.c:(.text+0x78): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccptZFGO.o
main.c:(.text+0xa0): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccptZFGO.o
main.c:(.text+0xc3): relocation... |
s581355921 | p02262 | C |
#include <stdio.h>
int n, cnt, a[1000000000] = {0}, g[100000] = {0};
void insertion_sort(int);
int main(void)
{
int i,j,k;
int m;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
cnt = 0;
g[0] = 1;
m = 1;
for(i = 0; g[i] < n; i++)
{
g[i+1] = 3 * g[i] + 1;
m++;
}
for(k = 0; k ... | /tmp/ccFjtxiC.o: in function `main':
main.c:(.text+0x78): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccFjtxiC.o
main.c:(.text+0xa0): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/ccFjtxiC.o
main.c:(.text+0xc3): relocation... |
s555400562 | p02262 | C | #include <stdio.h>
int i,j;
int n, cnt, a[1000000000] = {0}, g[100000] = {0};
void insertion_sort(int*, int, int);
int main(void)
{
int k;
int m;
scanf("%d", &n);
for(i = 0; i < n; i++)
{
scanf("%d", &a[i]);
}
cnt = 0;
g[0] = 1;
m = 1;
for(i = 0; g[i] < n; i++)
{
g[i+1] = 3 * g[i] + 1;
m++;
}
... | /tmp/cczEju9c.o: in function `main':
main.c:(.text+0x8e): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/cczEju9c.o
main.c:(.text+0xbc): relocation truncated to fit: R_X86_64_PC32 against symbol `g' defined in .bss section in /tmp/cczEju9c.o
main.c:(.text+0xe2): relocation... |
s494719955 | p02262 | C | int main(){
int i,n,A[N];
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&A[i]);
shellSort(A,n);
for(i=0;i<n;i++) printf("%d\n",A[i]);
return 0;
}
void insertionSort(int *A,int n,int g){
int i,j,v;
for(i=g;i<n;i++){
v=A[i];
j=i-g;
while(j>=0 && A[j]>v){
A[j+g]=A[j];
j=j-... | main.c: In function 'main':
main.c:2:13: error: 'N' undeclared (first use in this function)
2 | int i,n,A[N];
| ^
main.c:2:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:4:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-d... |
s617509301 | p02262 | C | void insertionSort(int *A,int n,int g){
int i,j,v;
for(i=g;i<n;i++){
v=A[i];
j=i-g;
while(j>=0 && A[j]>v){
A[j+g]=A[j];
j=j-g;
cnt++;
}
A[j+g]=v;
}
}
void shellSort(int *A,int n){
int i,x=0,G[]={121,40,13,4,1};
cnt=0;
if(n<121) x++;
if(n<40) x++;
if(n<13) x++;
if... | main.c: In function 'insertionSort':
main.c:9:7: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
9 | cnt++;
| ^~~
| int
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'shellSort':
main.c:1... |
s473708492 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define N 1000000
void insertionSort(int *A,int n,int g);
void shellSort(int *A,int n);
int m=5,cnt;
int main(){
int i,n,A[N];
if(scanf("%d",&n)!=1){
printf("Too Large\n");
exit(4);
}
for(i=0;i<n;i++) scanf("%d",&A[i]);
shellSort(A,n);
for(i=0;i<n;i++) prin... | /usr/bin/ld: /tmp/cclOKTXJ.o: in function `main':
main.c:(.text+0x94): undefined reference to `shellSort'
collect2: error: ld returned 1 exit status
|
s536918733 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
#define N 1000000
void sellSort(int *A,int n);
void insertionSort(int *A,int n, int g);
int cnt;
int m=5;
int main(){
int i,j,n,A[N];
scanf("%d",&n);
if(n>1000000 ){
fprintf(stderr,"Too Large\n");
exit(8);
}
for(i=0;i<n;i++){
scanf("%d",&A[i]);
if(A[i]... | main.c: In function 'main':
main.c:72:1: error: expected declaration or statement at end of input
72 | }
| ^
|
s897408412 | p02262 | C | #include <stdio.h>
void insertionSort(int*, int, int);
void shellSort(int*, int);
void print(int, int*, int*, int);
int cnt;
int main(void){
int n, i;
int A[1000000];
scanf("%d", &n);
for(i = 0; i < n; i ++){
scanf("%d", &A[i]);
}
shellSort(A, n);
return 0;
}
void insertionSort(int *A, int n, int ... | main.c: In function 'shellSort':
main.c:41:28: error: 't' undeclared (first use in this function)
41 | if(G[i] == 0) G[i] = 1;t
| ^
main.c:41:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:41:29: error: expected ';' before 'if'
... |
s938903715 | p02262 | C | #include <iostream>
inline unsigned insertion_sort(unsigned a[], unsigned n, unsigned gap){
unsigned count = 0;
for(unsigned i = gap; i < n; i++){
unsigned v = a[i];
int j = i - gap;
while(j >= 0 && a[j] > v){
a[j+gap] = a[j];
j -= gap;
count++;
}
a[j+gap] = v;
}
return ... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s893358569 | p02262 | C | #include<stdio.h>
#define N 1000000
int count = 0;
void insertSort(int *, int ,int );
void shellSort(int *,int );
int main(){
int n,i;
int A[1000000];
scanf("%d",&n);
for(i = 0;i < n;i ++)
{
scanf("%d",&A[i]);
}
shellSort(A,n);
return 0;
}
void insertSort(int *A, int n,in... | /usr/bin/ld: /tmp/ccDeJf33.o: in function `main':
main.c:(.text+0x76): undefined reference to `shellSort'
collect2: error: ld returned 1 exit status
|
s327008744 | p02262 | C | #include<stdio.h>
#include<math.h>
#define MAX 1000000
long count;
int S[MAX];
int n;
int G[1000000000000000000];
int Glen=0;
void insertSort(int S[],int n,int gnum)
{
int i,j;
int t;
for(i=gnum;i<n;i++)
{
t=S[i];
j=i-gnum;
while(j>=0 &&S[j]>t)
{
S[j+gnum]=S[j];
j-=gnum;
count++;
... | /tmp/ccXV4NPs.o: in function `shellSort':
main.c:(.text+0x141): relocation truncated to fit: R_X86_64_PC32 against symbol `Glen' defined in .bss section in /tmp/ccXV4NPs.o
main.c:(.text+0x14a): relocation truncated to fit: R_X86_64_PC32 against symbol `Glen' defined in .bss section in /tmp/ccXV4NPs.o
main.c:(.text+0x15... |
s893921271 | p02262 | C | #include<stdio.h>
#include<stdlib.h>
int insertionSort(int *A, int n, int g) {
int i, j, k;
int count = 0;
for(i = g; i < n; i++) {
v = A[i];
j = i-g;
while(j >= 0 && A[j] > k) {
A[j+g] = A[j];
j = j-g;
count++;
}
A[j+g] = k;
}
return count;
}
int shellSort(int *... | main.c: In function 'insertionSort':
main.c:9:5: error: 'v' undeclared (first use in this function)
9 | v = A[i];
| ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'shellSort':
main.c:26:5: error: 'cnt' undeclared (first use in t... |
s803758951 | p02262 | C | #include<stdio.h>
#include<stdlib.h>
int insertionSort(int *A, int n, int g) {
int i, j, k;
int count = 0;
for(i = g; i < n; i++) {
k = A[i];
j = i-g;
while(j >= 0 && A[j] > k) {
A[j+g] = A[j];
j = j-g;
count++;
}
A[j+g] = k;
}
return count;
}
int shellSort(int *... | main.c: In function 'shellSort':
main.c:26:5: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
26 | cnt += insertionSort(A, n, G[i]);
| ^~~
| int
main.c:26:5: note: each undeclared identifier is reported only once for each function it appears in
|
s340785335 | p02262 | C | #include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<math.h>
void insert_sort(int *A,int n,int g,int *count){
int i=0,key=0,j=0;
for(i=g;i<=n-1;i++){
key=A[i];
j=i-g;
while(key < A[j] && j>=0){
A[j+g]=A[j];
j-=g;
count[0]++;
}
A[j+g]=key;
}
}
int main(){
in... | main.c: In function 'main':
main.c:41:1: error: expected declaration or statement at end of input
41 | }
| ^
|
s993735264 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int n, i, j, k;
int A[1000000];
int count, m, G[12], v;
scanf("%d", &n);
for (i = 0; i < n; i++) scanf("%d", &A[i]);
cnt = 0;
m = 1;
G[0] = 1;
while (3 * G[m-1] + 1 < n) {
G[m] = 3 * G[m-1] + 1;
m++;
}
... | main.c: In function 'main':
main.c:14:3: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
14 | cnt = 0;
| ^~~
| int
main.c:14:3: note: each undeclared identifier is reported only once for each function it appears in
|
s224969513 | p02262 | C | #include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int n, i, j, k;
int A[1000000];
int count, m, G[12], v;
scanf("%d", &n);
for (i = 0; i < n; i++) scanf("%d", &A[i]);
count = 0;
m = 1;
G[0] = 1;
while (3 * G[m-1] + 1 < n) {
G[m] = 3 * G[m-1] + 1;
m++;
}
... | main.c: In function 'main':
main.c:47:18: error: 'cnt' undeclared (first use in this function); did you mean 'int'?
47 | printf("%d\n", cnt);
| ^~~
| int
main.c:47:18: note: each undeclared identifier is reported only once for each function it appears in
|
s027361463 | p02262 | C | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;
void insertionSort(int A[], int n, int g) {
for(int i = g; i < n; i++) {
int v = A[i];
int j = i - g;
while(j >= 0 && A[j] > v) {
A[j + g]... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s250962042 | p02262 | C | #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
using namespace std;
long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;
void insertionSort(int A[], int n, int g) {
for(int i = g; i < n; i++) {
int v = A[i];
int j = i - g;
while(j >= 0 && A[j] > v) {
A[j + g]... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s990281020 | p02262 | C | #include <iostream>
using namespace std;
void insertionsort(int array[], int n, int g){
int i,j,v;
for (i=g;i<n;i+=g){
j=i-g;
v=array[i];
while(j>=0 and v<array[j]){
array[j+g]=array[j];
j-=g;
}
array[j+g]=v;
}
}
void shellsort(int array[... | main.c:1:10: fatal error: iostream: No such file or directory
1 | #include <iostream>
| ^~~~~~~~~~
compilation terminated.
|
s821542829 | p02262 | C | #include <stdio.h>
int main( ){
int n;
scanf("%d", &n);
int A[n];
int i;
for(i=0;i<n;i++)
scanf("%d", A+i);
printf("3\n");
printf("13 4 1\n");
shellSort(A, n);
for(i=0;i<n;i++){
printf("%d\n", A[i]);
}
}
int insertionSort(A, n, g){
int i,j,count=0;
for(i=g;i<n;i++... | main.c: In function 'main':
main.c:12:5: error: implicit declaration of function 'shellSort' [-Wimplicit-function-declaration]
12 | shellSort(A, n);
| ^~~~~~~~~
main.c: In function 'insertionSort':
main.c:18:5: error: type of 'A' defaults to 'int' [-Wimplicit-int]
18 | int insertionSort(A, n, g){
... |
s202068253 | p02262 | C | include<stdio.h>
#define N 1000000
#define MAXM 100
#define SPAN 4
int insertionSort(int[],int,int);
void shellSort(int[],int);
void printArray(int[],int);
int main(void)
{
int i,n;//counter
int arr[N];//array
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&arr[i]);
shellSort(arr,n);
return 0;
}
int insertionS... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'main':
main.c:12:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
12 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<... |
s225139563 | p02262 | C | include<stdio.h>
#define N 1000000
#define MAXM 100
#define SPAN 4
int insertionSort(int[],int,int);
void shellSort(int[],int);
void printArray(int[],int);
int main(void)
{
int i,n;//counter
int arr[N];//array
scanf("%d",&n);
for(i=0;i<n;i++) scanf("%d",&arr[i]);
shellSort(arr,n);
return 0;
}
int insertionS... | main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
1 | include<stdio.h>
| ^
main.c: In function 'main':
main.c:12:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
12 | scanf("%d",&n);
| ^~~~~
main.c:1:1: note: include '<... |
s397263461 | p02262 | C | #include <stdio.h>
int G[100];
int cnt=0,c=0;
void insertionSort(int A[],int n,int g){
int v,i,j,c=0;
for(i=g;i<n,i++){
v=A[i];
j=i-g;
while(j>=0&&A[j]>v){
A[j+g]=A[j];
j=j-g;
cnt++;
}
A[j+g]=v;
}
}
shellSort(int A[],int n){
int m,i;
m=1;
while(1){
if(m>n)break;
... | main.c: In function 'insertionSort':
main.c:8:18: error: expected ';' before ')' token
8 | for(i=g;i<n,i++){
| ^
| ;
main.c: At top level:
main.c:20:1: error: return type defaults to 'int' [-Wimplicit-int]
20 | shellSort(int A[],int n){
| ^~~~~~~~~
|
s570361186 | p02262 | C | #include<stdio.h>
#include<stdlib.h>
int insertionSort(int *A,int n,int g){
int v, i, j, cnt=0;
for(i=g; i<=n-1; i++){
v = A[i];
j = i - g;
while(j>=0 && A[j]>v){
A[j+g] = A[j];
j = j-g;
cnt++;
}
A[j+g] = v;
}
return cnt;
}
int main(){
int *A, N, i, *G, cnt, m, j;
s... | main.c: In function 'main':
main.c:35:10: error: expected ';' before 'for'
35 | j = m/2
| ^
| ;
36 | for(i=0; i<=m-1; i++){
| ~~~
|
s959398794 | p02262 | C | #include<iostream>
#include<csdio>
#include<algorythm>
#include<cmath>
#include<vector>
using namespace std;
long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;
void insertionSort(int A[],int n,int g){
for(int i = g; i < n; i++){
int v = A[i];
int j = i - g;
while(j>= 0 && A[j] > v... | main.c:1:9: fatal error: iostream: No such file or directory
1 | #include<iostream>
| ^~~~~~~~~~
compilation terminated.
|
s990369482 | p02262 | C | /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
| |
s877985099 | p02262 | C | #include<bits/stdc++.h>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define MAX 1000010
using namespace std;
int n,A[MAX],cnt;
void insertionSort(int g){
REP(i,g,n){
int v = A[i];
int j = i - g;
while( j >= 0 && A[j] > v ){
A[j+g] = A[j];
j = j - g;
cnt++;
... | main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
1 | #include<bits/stdc++.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
|
s663802614 | p02262 | C | insertionSort(A, n, g)
for i = g to n-1
v = A[i]
j = i - g
while j >= 0 && A[j] > v
A[j+g] = A[j]
j = j - g
cnt++
A[j+g] = v
shellSort(A, n)
cnt = 0
m = 1
G[] = {?, ?,..., ?}
for i = 0 to m-1
insertionSort(A, n, G[i]) | main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
1 | insertionSort(A, n, g)
| ^~~~~~~~~~~~~
main.c: In function 'insertionSort':
main.c:2:1: error: expected declaration specifiers before 'for'
2 | for i = g to n-1
| ^~~
main.c:15:1: error: expected declaration specifiers before 'for... |
s711532324 | p02262 | C++ | #include<iostream>
#include<vector>
using namespace std;
const static int N_MAX = 100;
int InsertionSort(int *A, int N, int g)
{
int cnt = 0;
int i,j,v;
for ( i = g; i < N; ++i)
{
v = A[i];
for (j = i - g; j > -1 && A[j] > v; j -= g)
{
A[j + g] = A[j];
++cnt;
}
A[j + g] = v;
}
return cnt;
}
... | a.cc: In function 'int main()':
a.cc:62:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
62 | scanf_s("%d",&N);
| ^~~~~~~
| scanf
|
s527893776 | p02262 | C++ | #include<cstdio>
#include<vector>
#include<iostream>
using namespace std;
const static int N_MAX = 100;
int InsertionSort(int *A, int N, int g)
{
int cnt = 0;
int i,j,v;
for ( i = g; i < N; ++i)
{
v = A[i];
for (j = i - g; j > -1 && A[j] > v; j -= g)
{
A[j + g] = A[j];
++cnt;
}
A[j + g] = v;
}... | a.cc: In function 'int main()':
a.cc:63:9: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
63 | scanf_s("%d",&N);
| ^~~~~~~
| scanf
|
s815319365 | p02262 | C++ | #include<cstdio>
#include<vector>
#include<iostream>
using namespace std;
const static int N_MAX = 100;
int InsertionSort(int *A, int N, int g)
{
int cnt = 0;
int i,j,v;
for ( i = g; i < N; ++i)
{
v = A[i];
for (j = i - g; j > -1 && A[j] > v; j -= g)
{
A[j + g] = A[j];
++cnt;
}
A[j + g] = v;
}... | a.cc: In function 'int main()':
a.cc:67:17: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'?
67 | scanf_s("%d", A+i);
| ^~~~~~~
| scanf
|
s195025897 | p02262 | C++ | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
static int cnt = 0;
public static void main (String[] args) throws java.lang.Exception
{
Scanner scanner = new Scann... | a.cc:3:1: error: 'import' does not name a type
3 | import java.util.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.lang.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1... |
s743484251 | p02262 | C++ | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Main
{
static int cnt = 0;
public static void main (String[] args) throws java.lang.Exception
{
Scanner scanner = new Scann... | a.cc:3:1: error: 'import' does not name a type
3 | import java.util.*;
| ^~~~~~
a.cc:3:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: 'import' does not name a type
4 | import java.lang.*;
| ^~~~~~
a.cc:4:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:5:1... |
s054752518 | p02262 | C++ | あにっめ
| a.cc:1:1: error: '\U00003042\U0000306b\U00003063\U00003081' does not name a type
1 | あにっめ
| ^~~~~~~~
|
s713677449 | p02262 | C++ | #include<bits/stdc++.h>
using namespace std;
int cnt = 0;
shell(int A[],int n,int g){
for(int i= 0;i<n-1;i++){
int v = i;
while(v >=0 && A[v]>A[v+g] && v+g<n){
int j = A[v];
A[v] = A[v+g];
A[v+g] = j;
v--;
cnt++;
}
}
}
int main(){
int n,m = 0;
cin>>n;
int A[n];
int g[13] = {1,4,13,40,121,3... | a.cc:4:1: error: ISO C++ forbids declaration of 'shell' with no type [-fpermissive]
4 | shell(int A[],int n,int g){
| ^~~~~
a.cc: In function 'int shell(int*, int, int)':
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
16 | }
| ^
|
s706449993 | p02262 | C++ | #include<bits/stdc++.h>
using namespace std;
int cnt = 0;
shell(int A[1000000],int n,int g){
for(int i= 0;i<n-1;i++){
int v = i;
while(v >=0 && A[v]>A[v+g] && v+g<n){
int j = A[v];
A[v] = A[v+g];
A[v+g] = j;
v--;
cnt++;
}
}
}
int main(){
int n,m = 0;
cin>>n;
int A[n];
int g[13] = {1,4,13,4... | a.cc:4:1: error: ISO C++ forbids declaration of 'shell' with no type [-fpermissive]
4 | shell(int A[1000000],int n,int g){
| ^~~~~
a.cc: In function 'int shell(int*, int, int)':
a.cc:16:1: warning: no return statement in function returning non-void [-Wreturn-type]
16 | }
| ^
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.