submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s094492813
p00205
C++
#include<stdio.h> int main(void) { int t[5]={0},t2=0,t3=0,t1=0,k,i; while(scanf("%d",&k)!=0){ t2=0; t3=0; t1=0; for(i=0;i<5;i++){ scnaf("%d",&t[i]); if(t[i]==1) t1++; else if(t[i]==2) t2++; else if(t[i]==3) t3++; } if(t1==0){ if(t2==0 or t3==0) for(i=0;i<5;i++) t[i]=3; else for(i=0;i<5;i++){ ...
a.cc: In function 'int main()': a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 12 | scnaf("%d",&t[i]); | ^~~~~ | scanf a.cc:51:9: error: expected ';' before '}' token 51 | return 0 | ^ | ; 52 | } | ~
s437982353
p00205
C++
#include<stdio.h> int main(void) { int t[5]={0},t2=0,t3=0,t1=0,k,i; while(scanf("%d",&k)!=0){ t2=0; t3=0; t1=0; for(i=0;i<5;i++){ scnaf("%d",&t[i]); if(t[i]==1) t1++; else if(t[i]==2) t2++; else if(t[i]==3) t3++; } if(t1==0){ if((t2==0) or (t3==0)) for(i=0;i<5;i++) t[i]=3; else for(i=0;i<5;i+...
a.cc: In function 'int main()': a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 12 | scnaf("%d",&t[i]); | ^~~~~ | scanf a.cc:51:9: error: expected ';' before '}' token 51 | return 0 | ^ | ; 52 | } | ~
s056417649
p00205
C++
#include<stdio.h> int main(void) { int t[5]={0},t2=0,t3=0,t1=0,k,i; while(scanf("%d",&k)!=0){ t2=0; t3=0; t1=0; for(i=0;i<5;i++){ scnaf("%d",&t[i]); if(t[i]==1) t1++; else if(t[i]==2) t2++; else if(t[i]==3) t3++; } if(t1==0){ if((t2==0) || (t3==0)) for(i=0;i<5;i++) t[i]=3; else for(i=0;i<5;i+...
a.cc: In function 'int main()': a.cc:12:1: error: 'scnaf' was not declared in this scope; did you mean 'scanf'? 12 | scnaf("%d",&t[i]); | ^~~~~ | scanf a.cc:51:9: error: expected ';' before '}' token 51 | return 0 | ^ | ; 52 | } | ~
s249370309
p00205
C++
#include <iostream> using namespace std; bool is_draw(int* first, int* last) { bool used[3] = {false, false, false}; for (int* p = first; p != last; p++) { used[*p - 1] = true; } return all_of(used, used + 3, [used](bool x) {return x;}); } int get_win(int* first, int* last) { int mi = 5, m...
a.cc: In function 'bool is_draw(int*, int*)': a.cc:9:12: error: 'all_of' was not declared in this scope 9 | return all_of(used, used + 3, [used](bool x) {return x;}); | ^~~~~~
s472590749
p00206
Java
import java.util.ArrayList; import java.util.Scanner; public class NextTrip { public static void main(String[] args) { Scanner scan = new Scanner(System.in); ArrayList<String> arr = new ArrayList<>(); while (true) { int border = Integer.parseInt(scan.next()); if (border == 0) { break; } String...
Main.java:4: error: class NextTrip is public, should be declared in a file named NextTrip.java public class NextTrip { ^ 1 error
s761646526
p00206
Java
import java.util.Scanner; class Main { public static void main(String[] args){ //declare ArrayList<String> answer = new ArrayList<>(); ArrayList<Integer> month = new ArrayList<>(); Scanner in = new Scanner(System.in); int L,M,N,total; //inmput while(true){ total=0; L = Integer...
Main.java:6: error: cannot find symbol ArrayList<String> answer = new ArrayList<>(); ^ symbol: class ArrayList location: class Main Main.java:6: error: cannot find symbol ArrayList<String> answer = new ArrayList<>(); ^ symbol: class ArrayList location: class Ma...
s598994318
p00206
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); while(true){ int tripCost = stdIn.nextInt(); if(tripCost == 0)break; for(int i=1;i<=12;i++){ if(i==12){ System.out.println("NA"); break; } savingMoney += stdIn.nextI...
Main.java:14: error: cannot find symbol savingMoney += stdIn.nextInt() - stdIn.nextInt(); ^ symbol: variable savingMoney location: class Main Main.java:15: error: cannot find symbol if(savingMoney >= tripCost){ ^ symbol: variable savingMoney location: class Main 2 errors
s079966513
p00206
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); while(true){ int tripCost = stdIn.nextInt(); if(tripCost == 0)break; for(int i=1;i<=12;i++){ if(i==12){ System.out.println("NA"); break; } savingMoney += (stdIn.next...
Main.java:14: error: cannot find symbol savingMoney += (stdIn.nextInt() - stdIn.nextInt()); ^ symbol: variable savingMoney location: class Main Main.java:15: error: cannot find symbol if(savingMoney >= tripCost){ ^ symbol: variable savingMoney location: class Main 2 errors
s400345653
p00206
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); while(true){ int tripCost = stdIn.nextInt(); if(tripCost == 0)break; for(int i=1;i<=12;i++){ if(i==12){ System.out.println("NA"); break; } savingMoney = savingMoney ...
Main.java:14: error: cannot find symbol savingMoney = savingMoney + stdIn.nextInt() - stdIn.nextInt(); ^ symbol: variable savingMoney location: class Main Main.java:14: error: cannot find symbol savingMoney = savingMoney + stdIn.nextInt() - stdIn.nextInt(); ^ symbol: variable sav...
s319824162
p00206
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); while(true){ int tripCost = stdIn.nextInt(); if(tripCost == 0)break; for(int i=1;i<=12;i++){ if(i==12){ System.out.println("NA"); break; } int income = stdIn.nextInt...
Main.java:16: error: cannot find symbol savingMoney = savingMoney + income - payOut; ^ symbol: variable savingMoney location: class Main Main.java:16: error: cannot find symbol savingMoney = savingMoney + income - payOut; ^ symbol: variable savingMoney location: class Main Main...
s812425371
p00206
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); while(true){ int tripCost = stdIn.nextInt(); if(tripCost == 0)break; int i = 1; while(true){ else{ int income = stdIn.nextInt(); int payOut = stdIn.nextInt(); in...
Main.java:12: error: 'else' without 'if' else{ ^ 1 error
s186746060
p00206
Java
import java.util.Scanner; class Main{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); while(true){ int tripCost = stdIn.nextInt(); if(tripCost == 0)break; int i = 1; while(true){ int income = stdIn.nextInt(); int payOut = stdIn.nextInt(); int savingMoney...
Main.java:14: error: variable savingMoney might not have been initialized int savingMoney = savingMoney + income - payOut; ^ 1 error
s647142628
p00206
C
#include<stdio.h> int main(void) { int a[11], b, c, d, e, g = 0; scanf_s("%d", &c); for (b = 0; b < 12; b++) { scanf("%d %d", &d, &e); a[b] = d - e; g = g + a[b]; if (g >= c) { printf("%d\n", b); break; } else if (b == 11) { printf("NA\n"); } } return 0; }
main.c: In function 'main': main.c:6:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 6 | scanf_s("%d", &c); | ^~~~~~~ | scanf
s032878339
p00206
C
#include<stdio.h> int main(void) { int a[12], b, c, d, e, f; while (1) { scanf_s("%d", &b); c = 0; if (b == 0) break; for (d = 0;d < 12;d++) { scanf_s("%d %d", &e, &f); c += e - f; a[d] = c; } for (d = 0;d < 12;d++){ if (a[d] >= b) { printf("%d\n", d + 1); break; } } if (c <...
main.c: In function 'main': main.c:7:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | scanf_s("%d", &b); | ^~~~~~~ | scanf main.c:25:1: error: 'return' with no value, in function returning n...
s405172876
p00206
C
#include<stdio.h> int main(void) { int M, N, L, s=0,i,num[12],z; while (1) { scanf_s("%d",&L); s = 0; if (L == 0)break; for (i = 0; i < 12; i++) { scanf_s("%d %d", &M, &N); s += M - N; num[i] = s; } for (i = 0; i < 12; i++) { if (num[i] >= L) { printf("%d\n", i + 1); break; } } ...
main.c: In function 'main': main.c:5:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 5 | scanf_s("%d",&L); | ^~~~~~~ | scanf
s406184140
p00206
C
include <stdio.h> int main(void){ int L,M1,M2,sum,i,month; while(1){ sum=0; scanf("%d",&L); if(L==0) break; for(i=0;i<12;i++){ scanf("%d %d",&M1,&M2); sum+=M1-M2; if(sum>=L){ printf("%d",i); break; ...
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s649355757
p00206
C
#include <stdio.h> int main(void){ int L,M1,M2,sum,i,month; while(1){ sum=0; month=0; scanf("%d",&L); if(L==0) break; for(i=0;i<12;i++){ scanf("%d %d",&M1,&M2); sum+=M1-M2; if(sum>=L&&month==0){ printf("%d"...
main.c:24:1: error: expected identifier or '(' before '~' token 24 | ~ | ^
s902521952
p00206
C
#include <stdio.h> int main(void){ int m, n, l; int sum = 0; i = 1; while(1){ scanf("%d", &l); if(l == 0) break; scanf("%d %d", &m, &n); sum += m - n; if(i == 12){ if(sum < l) printf("NA"); i = 1;...
main.c: In function 'main': main.c:7:5: error: 'i' undeclared (first use in this function) 7 | i = 1; | ^ main.c:7:5: note: each undeclared identifier is reported only once for each function it appears in
s051700446
p00206
C
#include <stdio.h> int main(void){ int L,M1,M2,sum,i,month; while(1){ sum=0; month=0; scanf("%d",&L); if(L==0) break; for(i=0;i<12;i++){ scanf("%d %d",&M1,&M2); sum+=M1-M2; if(sum>=L&&month==0){ month=i+1; ...
main.c:26:1: error: expected identifier or '(' before '~' token 26 | ~ | ^
s515052561
p00206
C
#include <stdio.h> int main(void){ int L,M1,M2,sum,i,month; while(1){ sum=0; month=0; scanf("%d",&L); if(L==0) break; for(i=0;i<12;i++){ scanf("%d %d",&M1,&M2); sum+=M1-M2; if(sum>=L&&month==0){ month=i+1; ...
main.c:26:1: error: expected identifier or '(' before '~' token 26 | ~ | ^
s540874256
p00206
C
main(l,m,n,a,i{for(;a=12,scanf("%d",&l),l;printf((a>11)?"NA\n":"%d\n",a+1))for(i=0;i<12;++i)if(scanf("%d%d",&m,&n),(l-=m-n)<1)a=(a<i)?a:i;}
main.c:1:15: error: expected ')' before '{' token 1 | main(l,m,n,a,i{for(;a=12,scanf("%d",&l),l;printf((a>11)?"NA\n":"%d\n",a+1))for(i=0;i<12;++i)if(scanf("%d%d",&m,&n),(l-=m-n)<1)a=(a<i)?a:i;} | ^ | )
s766925711
p00206
C++
#include<iostream> using namespace std; int main(){ int L; cin >> L; int t; t = 0; for(i=0;i<12;++i){ int Plus; int Minus; cin >> Plus >> Minus; t += Plus - Minus if (t>=L){ cout << i+1 << endl; break; } } if (t<L){ ...
a.cc: In function 'int main()': a.cc:8:9: error: 'i' was not declared in this scope 8 | for(i=0;i<12;++i){ | ^ a.cc:12:26: error: expected ';' before 'if' 12 | t += Plus - Minus | ^ | ; 13 | if (t>=L){ | ...
s027710312
p00206
C++
#include<iostream> using namespace std; int main(){ int L; cin >> L; int t; t = 0; for(int i=0;i<12;++i){ int Plus; int Minus; cin >> Plus >> Minus; t += Plus - Minus if (t>=L){ cout << i+1 << endl; break; } } if (t<...
a.cc: In function 'int main()': a.cc:12:26: error: expected ';' before 'if' 12 | t += Plus - Minus | ^ | ; 13 | if (t>=L){ | ~~
s356775667
p00206
C++
int main(){ int L; cin >> L; int t; t = 0; for(int i=0;i<12;++i){ int Plus; int Minus; cin >> Plus >> Minus; t += Plus - Minus if (t>=L){ cout << i+1 << endl; break; } }; if (t<L){ cout << "NA" << endl; }...
a.cc: In function 'int main()': a.cc:3:5: error: 'cin' was not declared in this scope 3 | cin >> L; | ^~~ a.cc:10:26: error: expected ';' before 'if' 10 | t += Plus - Minus | ^ | ; 11 | if (t>=L){ | ~~ ...
s784841453
p00206
C++
#include<iostream> using namespace std; int main(){ int L; cin >> L; int t; t = 0; for(int i=0;i<12;++i){ int Plus; int Minus; cin >> Plus >> Minus; t += Plus - Minus if (t>=L){ cout << i+1 << endl; break; } } if (t<...
a.cc: In function 'int main()': a.cc:12:26: error: expected ';' before 'if' 12 | t += Plus - Minus | ^ | ; 13 | if (t>=L){ | ~~
s411654880
p00206
C++
#include<iostream> using namespace std; int main(){ int L; cin >> L; int t; t = 0; for(int i=0;i<12;++i){ int Plus; int Minus; cin >> Plus >> Minus; t += Plus - Minus if (t>=L){ cout << i+1 << endl; break; } } ...
a.cc: In function 'int main()': a.cc:12:26: error: expected ';' before 'if' 12 | t += Plus - Minus | ^ | ; 13 | if (t>=L){ | ~~
s252184642
p00206
C++
#include<iostream> using namespace std; int main(){ int L; cin >> L; int t; t = 0; for(int i=0;i<12;++i){ int Plus; int Minus; cin >> Plus >> Minus; t += Plus - Minus if (t>=L){ cout << i+1 << endl; break; } }; if (t...
a.cc: In function 'int main()': a.cc:12:26: error: expected ';' before 'if' 12 | t += Plus - Minus | ^ | ; 13 | if (t>=L){ | ~~
s440368164
p00206
C++
#include <iostream> using namespace std; int main() { // your code goes here int n,m,s,sum; while(cin >> n && n!=0){ sum=0; int i; for(i=0;i<12;i++){ cin >> m >> s; sum+=m-s; if(sum>=n){ cout << i+1 << endl; break; } } for(i=i+1;i<12;i++){ cin >> m >> s; if(sum<n) cout << "NA" << ...
a.cc: In function 'int main()': a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:4:12: note: to match this '{' 4 | int main() { | ^
s051573833
p00206
C++
#include<stdio.h> int main(void) { int w,n,z,x,i,k,c; while(1){ scanf("%d",&n); if(n==0) break; c=0; k=0; for(i=0;i<12;i++){ scanf("%d %d",&z,&x); k+=z-x; if(k>=n){ c++ } } if(k<n){ printf("NA\n"); } else{ printf("%d\n",12-c+1); } } return 0; }
a.cc: In function 'int main()': a.cc:14:36: error: expected ';' before '}' token 14 | c++ | ^ | ; 15 | } | ~
s393327160
p00206
C++
#include <stdio.h> int main(){ int n,l,r,tot; bool f; while(1){ scanf("%d",&n); if(n==0)return 0; tot=0; f=false; for(int i=0;i<12;i++){ scanf("%d%d",&l,&r); tot+=l-r; if(tot>=n&&!f){ f=true; printf("...
a.cc: In function 'int main()': a.cc:18:13: error: 'F' was not declared in this scope 18 | if(!F)printf("NA\n"); | ^
s462302416
p00206
C++
#include<iostream> #define N 12 int main () { int L; int sum; int mon; bool skip; while ( true ) { cin >> L; if ( L == 0 ) break; //sum = L; skip = false; for ( int i=0; i<N; i++ ) { cin >> m >> n; L -= m-n; if ( L <= 0 && !skip ) mon = i+1; } if...
a.cc: In function 'int main()': a.cc:12:5: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 12 | cin >> L; | ^~~ | std::cin In file included from a.cc:1: /usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here 62 | extern istream cin; ///< Linked...
s020900505
p00206
C++
#include<iostream> int main(){ while(1){ int a; std::cin>>a; if(a==0)break; int b,c=0; for(int i=1;i<13;i++){ int n,m; std::cin>>n>>m; b+=n; b-=m; if(b>=a)std::cout<<i<<std::endl,c=1,break; } if(c==0)std::cout<<"NA"<<std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:61: error: expected primary-expression before 'break' 13 | if(b>=a)std::cout<<i<<std::endl,c=1,break; | ^~~~~
s886870679
p00206
C++
#include <iosteam> #include <vector> using namespace std; int main(void) { int cost,saving; vector< vector<int> > money(12,2); while(1){ cin >> cost; if(cost==0) break; saving=0; for(int i=0i<12;i++){ cin >> money[i][0] >> money[i][1]; } for(int i=0;i<12;i++){ saving+=money[i][0]-[i][1]; if(cost...
a.cc:1:10: fatal error: iosteam: No such file or directory 1 | #include <iosteam> | ^~~~~~~~~ compilation terminated.
s230108007
p00206
C++
#include <iostream> #include <vector> using namespace std; int main(void) { int cost,saving; vector< vector<int> > money(12,2); while(1){ cin >> cost; if(cost==0) break; saving=0; for(int i=0;i<12;i++){ cin >> money[i][0] >> money[i][1]; } for(int i=0;i<12;i++){ saving+=money[i][0]-money[i][1]; ...
a.cc: In function 'int main()': a.cc:7:41: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int, int)' 7 | vector< vector<int> > money(12,2); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /u...
s739179751
p00206
C++
#include <iostream> #include <vector> using namespace std; int main(void) { int cost,saving; vector< vector<int> > money(12,2); while(1){ cin >> cost; if(cost==0) break; saving=0; for(int i=0;i<12;i++){ cin >> money[i][0] >> money[i][1]; } for(int i=0;i<12;i++){ saving+=money[i][0]-money[i][1]; ...
a.cc: In function 'int main()': a.cc:7:41: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int, int)' 7 | vector< vector<int> > money(12,2); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /u...
s255387973
p00206
C++
#include <iostream> #include <vector> using namespace std; int main(void) { int cost,saving; vector< vector<int> > money(12,2); while(1){ cin >> cost; if(cost==0) break; saving=0; for(int i=0;i<12;i++){ cin >> money[i][0] >> money[i][1]; } for(int i=0;i<12;i++){ saving+=money[i][0]-money[i][1]; ...
a.cc: In function 'int main()': a.cc:7:41: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int, int)' 7 | vector< vector<int> > money(12,2); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /u...
s709213090
p00206
C++
#include <iostream> #include <vector> using namespace std; int main(void) { int cost,saving; vector< vector<int> > money(12,2); while(1){ cin >> cost; if(cost==0) break; saving=0; for(int i=0;i<12;i++){ cin >> money[i][0] >> money[i][1]; } for(int i=0;i<12;i++){ saving+=(money[i][0]-money[i][1]); ...
a.cc: In function 'int main()': a.cc:7:41: error: no matching function for call to 'std::vector<std::vector<int> >::vector(int, int)' 7 | vector< vector<int> > money(12,2); | ^ In file included from /usr/include/c++/14/vector:66, from a.cc:2: /u...
s977146649
p00206
C++
#include <iostream> #include <cstdio> #include <string> #include <vector> #include <map> #include <algorithm> #include <sstream> #define mp make_pair #define rep(i,n) for(int i = 0 ; i < n ; i++) #define ll long long using namespace std; int main(){ int l; while( cin >> l , l) { int money=0 , i , ans=0; for( ...
a.cc: In function 'int main()': a.cc:27:37: error: 'INT_MAX' was not declared in this scope 27 | l = INT_MAX; | ^~~~~~~ a.cc:8:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 7 |...
s695520968
p00206
C++
int main(void){ int L,M,N,k[12],i,kai; while(0==0){ scanf("%d\n",&L); if(L==0) break; kai=0; for(i=1;i<13;i++){ scanf("%d %d\n",&M,&N); k[i]=M-N; } for(i=1;i<1;i++){ L-=k[i]; if(L<=0){ kai=i; break; } } if(kai==0) printf("NA\n"); else printf("%d\n",kai); ...
a.cc: In function 'int main()': a.cc:5:17: error: 'scanf' was not declared in this scope 5 | scanf("%d\n",&L); | ^~~~~ a.cc:23:28: error: 'printf' was not declared in this scope 23 | if(kai==0) printf("NA\n"); | ^~~~~~ a.cc:1:...
s122903730
p00207
Java
20 20 1 1 9 9 7 2 0 1 1 5 1 1 3 2 1 3 3 1 1 5 2 5 1 7 3 2 0 2 7 2 0 6 8 20 20 9 9 1 1 6 2 0 1 1 1 0 5 1 2 1 1 3 5 0 1 7 3 1 5 5 4 1 8 5 0 0
Main.java:1: error: class, interface, enum, or record expected 20 20 ^ 1 error
s169174446
p00207
Java
import java.util.*; public class Main { int [][] field; int goalx; int goaly; int moveColor; private boolean move(int x, int y){ if(field[y][x] != moveColor){ return false; } if(x == goalx && y == goaly){ return true; } field[y][x] = -1; if(move(x+1,y) || move(x,y+1) || move(x-1,y) || move(x,...
Main.java:100: error: reached end of file while parsing } ^ 1 error
s784499133
p00207
Java
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.StringTokenizer; /** * Block */ public class P0207 { static int[][] board; final static int BLOCK_WIDTH = 4; final static int BLOCK_HEIGHT = 2; final static int EMPTY = 0; ...
Main.java:10: error: class P0207 is public, should be declared in a file named P0207.java public class P0207 { ^ 1 error
s470302525
p00207
Java
import java.util.ArrayDeque; import java.util.Queue; import java.util.Scanner; public class Main { public static final int[] blockW = {4,2}; public static final int[] blockH = {2,4}; public static final int INF = 100000000; public static final int[] vx = {1,0,-1,0}; public static final int[] vy = {0,-1,0,1}; publ...
Main.java:20: error: cannot find symbol Pos2d start = new Pos2d(sc.nextInt()-1,sc.nextInt()-1); ^ symbol: class Pos2d location: class Main Main.java:20: error: cannot find symbol Pos2d start = new Pos2d(sc.nextInt()-1,sc.nextInt()-1); ^ symbol: class Pos2d location: class Main ...
s230021623
p00207
Java
import java.lang.annotation.Retention; import java.util.*; import org.omg.CORBA.Principal; public class Main { Scanner in = new Scanner(System.in); public static void main(String[] args) { new Main(); } public Main() { new AOJ0207(); } class AOJ0207{ int w,h; int sx,sy,gx,gy; int[][] map; void m...
Main.java:4: error: package org.omg.CORBA does not exist import org.omg.CORBA.Principal; ^ 1 error
s023696103
p00207
C
#include <stdio.h> int search(xs, ys, c) { } struct blkinfo_t { int c; int d; int x; int y; }; int **board; int **flag; int xg, yg; void createmaze(int n, struct blkinfo_t *blks) { int i; int curx; int cury; for(i = 0; i < n; i++) { curx = blks[n].x; cury = blks[n].y; if(d == 0) { ...
main.c: In function 'search': main.c:3:5: error: type of 'xs' defaults to 'int' [-Wimplicit-int] 3 | int search(xs, ys, c) { | ^~~~~~ main.c:3:5: error: type of 'ys' defaults to 'int' [-Wimplicit-int] main.c:3:5: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c: In function 'createmaze': main....
s066125720
p00207
C
#include<stdio.h> int flag=0; int mp[102][102]; int sn[102][102]; int bc; int px[4]={0,1,0,-1}; int py[4]={1,0,-1,0}; int slv(int xs,int ys); int w,h,xg,yg; int n,c,d,x,y; int i,j,k; int main(){ int xs,ys; while(1){ cin>>w>>h; if(w==0 && h==0)return(0); cin>>xs>>ys; cin>>xg>>yg; flag=0; ...
main.c: In function 'main': main.c:20:5: error: 'cin' undeclared (first use in this function) 20 | cin>>w>>h; | ^~~ main.c:20:5: note: each undeclared identifier is reported only once for each function it appears in main.c:26:5: error: implicit declaration of function 'memset' [-Wimplicit-function-decl...
s107758454
p00207
C
20 20 1 1 9 9 7 2 0 1 1 5 1 1 3 2 1 3 3 1 1 5 2 5 1 7 3 2 0 2 7 2 0 6 8 20 20 9 9 1 1 6 2 0 1 1 1 0 5 1 2 1 1 3 5 0 1 7 3 1 5 5 4 1 8 5 0 0
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 20 20 | ^~
s275682885
p00207
C
20 20 1 1 9 9 7 2 0 1 1 5 1 1 3 2 1 3 3 1 1 5 2 5 1 7 3 2 0 2 7 2 0 6 8 20 20 9 9 1 1 6 2 0 1 1 1 0 5 1 2 1 1 3 5 0 1 7 3 1 5 5 4 1 8 5 0 0
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 20 20 | ^~
s173916540
p00207
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
s552822217
p00207
C++
#include<iostream> #include<cstdio> #include<queue> using namespace std; #define size_max 100+10 #define Y first #define X second int mx[4] = { 1,-1,0,0 }; int my[4] = { 0,0,1,-1 }; int map[size_max][size_max]; void paint(int c, int y, int x, int H, int W) { int i, j; for (i = y; i < y + H; i++) { for (j = x...
a.cc: In function 'int main()': a.cc:59:17: error: 'memset' was not declared in this scope 59 | memset(map, 0, sizeof map); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<queue> +++ |...
s948501035
p00207
C++
#include<map> #include<queue> #include<cstdio> #include<stdio.h> #include<iostream> #include<algorithm> #define SIZE 102 using namespace std; typedef pair<int,int> P; void input_data(void); //データ入力用関数 void make_mass(void); //マス作成用関数 void solve(void); //処理 void clear(void); //データの初期化 int n; ...
a.cc: In function 'void solve()': a.cc:123:10: error: reference to 'data' is ambiguous 123 | memset(data,-1,sizeof(data)); | ^~~~ In file included from /usr/include/c++/14/map:65, from a.cc:1: /usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> c...
s329446475
p00207
C++
#include<map> #include<queue> #include<stdio.h> #include<iostream> #include<algorithm> #define SIZE 110 using namespace std; typedef pair<int,int> P; void solve(void); //処理 int n; //ブロックの個数 int w,h; //ボードの幅、高さ int goal; //迷路になっているか int scolor; //スタート位置の色 int sx,sy,gx,gy; ...
a.cc: In function 'int main()': a.cc:47:3: error: 'memset' was not declared in this scope 47 | memset(mass,0,sizeof(mass)); | ^~~~~~ a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 5 | #include<algorithm> +++ |+#include <cstring> ...
s354756154
p00207
C++
include<iostream> using namespace std; #define MAX_H 100 #define MAX_W 100 #define INF 1000; int h,w; int field[MAX_H][MAX_W]; int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0}; void dfs(int y,int x,const int sc){ if(y<=0 || x<=0 || y>h || x>w)return; if(field[y][x]==sc){ field[y][x]=0; for(int i=0;i<4;i++)dfs(y+dy[i],x+dx[i...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:19:15: error: 'cin' was not declared in this scope 19 | while(cin>>w>>h){ | ^~~ a.cc:38:34: error: 'cout' was not declared in this scope 38 | i...
s927418791
p00207
C++
def g;gets.split.map &:to_i;end while(w,h=g)[0]>0 t,u=s=g;e=g m=[v=[6]*(w+2)]+(1..h).map{[6]+[0]*w<<6}<<v g[0].times{c,d,x,y=g;o=d<1?4:2;m[y,6-o].map{|i|i[x,o]=[c]*o}} q=[s] c=m[t][u] (q.uniq!;a,b=q.shift;m[a][b]=7;[[a,b+1],[a,b-1],[a+1,b],[a-1,b]].map{|i,j|m[i][j]==c&&q<<[i,j]})while q[0]&&q[0]!=e puts q[0]?:OK:"NG"en...
a.cc:4:18: error: too many decimal points in number 4 | m=[v=[6]*(w+2)]+(1..h).map{[6]+[0]*w<<6}<<v | ^~~~ a.cc:1:1: error: 'def' does not name a type 1 | def g;gets.split.map &:to_i;end | ^~~ a.cc:1:7: error: 'gets' does not name a type 1 | def g;gets.split.map &:to_i;end ...
s133467801
p00207
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int w,h,xs,ys,xg,yg,n,ban[101][101]={{0},{0}}; const int START=4545191; const int GOAL=454545; const int CHECKED=432535; bool dfs(int x,int y,int c){ //cout<<x<<" "<<y<<endl; if(ban[x][y+1]==CHECKED&&ban[x+1][y]==CHECKED)return false; ...
a.cc: In function 'int main()': a.cc:54:10: error: expected '}' at end of input 54 | } | ^ a.cc:26:11: note: to match this '{' 26 | int main(){ | ^
s235724663
p00207
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int w,h,xs,ys,xg,yg,n,ban[111][111]={{0},{0}}; bool visited [101][101]; const int START=4545191; const int GOAL=454545; bool dfs(int x,int y){ //cout<<x<<" "<<y<<endl; if(xg==x&&yg==y)return true; if(ban[x+1][y]==ban[xs][ys]&&visite...
a.cc: In function 'bool dfs(int, int)': a.cc:26:49: error: lvalue required as left operand of assignment 26 | if(y>=2&&ban[x][y-1]==ban[xs][y]&&visited[x][y]=false;){ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ a.cc:26:71: error: expected primary-expression before ')' toke...
s363353907
p00207
C++
#include<iostream> #include<algorithm> #include<string> using namespace std; int xs,ys,w,h,n,ban[111][111],xg,yg;bool visited[101][101]; bool dfs(int x,int y,int c){ //cout<<x<<" "<<y<<endl; if(c-1||ban[x][y]!=c)return false; if(xg==x&&yg==y)return true; //if(ban[xs][ys]==0)return false; if(ban[x+1][y]==...
a.cc: In function 'bool dfs(int, int, int)': a.cc:23:24: error: lvalue required as left operand of assignment 23 | if(y>=2&&ban[x][y-1]=c&&visited[x][y-1]==false){ | ~~~~^~~~~~~~~~~~~
s016930349
p00207
C++
if(ban[x][y+1]==c&&visited[x][y+1]==false){ visited[x][y+1]=true; if(dfs(x,y+1,c))return true; } if(x>=2&&ban[x-1][y]==c&&visited[x-1][y]==false){ visited[x-1][y]=true; if(dfs(x-1,y,c))return true; } if(y>=2&&ban[x][y-1]==c&&visited[x][y-1]==false){ visited[x][y-1]=true; if(dfs(x,y-1,c))retu...
a.cc:1:17: error: expected unqualified-id before 'if' 1 | if(ban[x][y+1]==c&&visited[x][y+1]==false){ | ^~ a.cc:5:17: error: expected unqualified-id before 'if' 5 | if(x>=2&&ban[x-1][y]==c&&visited[x-1][y]==false){ | ^~ a.cc:9:17: error...
s489224277
p00207
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int fie[101][101],ans,gol[101][101],st[101][101],col,muki,bx,by; int bex[4]={0,1,0,-1},bey[4]={1,0,-1,0},cou,a,b; int sx,sy,gx,gy,n; int func(int y,int x){ if(fie[sy][sx]==-1)return 0; if(y<1||x<1||y>b||x>a)return 0; if(fie[y][...
a.cc: In function 'int main()': a.cc:24:14: error: 'vis' was not declared in this scope 24 | fill(vis[0],vis[0]+101*101,true); | ^~~
s483977983
p00207
C++
int board[101][101]; int xg , yg; int w, h; int dx[]={1,0,-1,0}; int dy[]={0,1,0,-1}; int sc; bool b; void dfs(int x , int y){ if(x==xg&&y==yg) {b=true;return;} for(int i=0;i<4;++i){ int tx=x+dx[i]; int ty=y+dy[i]; if(tx<=0||ty<=0||tx>w||ty>h) continue; if(board[tx][ty]!=sc || board[tx][ty]==0) continue; i...
a.cc: In function 'int main()': a.cc:22:15: error: 'cin' was not declared in this scope 22 | while(cin >> w >> h , w||h){ | ^~~ a.cc:26:17: error: 'memset' was not declared in this scope 26 | memset(board,0,sizeof(board)); | ^~~~~~ a.cc:1:1: note: ...
s884167296
p00207
C++
void Eratosthenes(){ for(int i = 0; i < N; i++){ arr[i] = 1; } for(int i = 2; i < sqrt(N); i++){ if(arr[i]){ for(int j = 0; i * (j + 2) < N; j++){ arr[i *(j + 2)] = 0; } } } for(int i = 2; i < N; i++){ if(arr[i]){ //cout << i << endl; } } }
a.cc: In function 'void Eratosthenes()': a.cc:2:28: error: 'N' was not declared in this scope 2 | for(int i = 0; i < N; i++){ | ^ a.cc:3:17: error: 'arr' was not declared in this scope 3 | arr[i] = 1; | ^~~ a.cc:5:33: error: 'N' was ...
s328526413
p00207
C++
#include <bits/stdc++.h> using namespace std; // #define int long long #define pb push_back typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<vector<int> > vii; template <class X> void print(X Target){ cout << Target << '\n'; } const int dx[] = {0, 1, 0, -1}, dy[] = {...
a.cc: In function 'int main()': a.cc:39:12: error: 'field' was not declared in this scope 39 | memset(field, false, sizeof(check)); | ^~~~~
s008343676
p00207
C++
#include<bits/stdc++.h> using namespace std; #define ANSWER(x) cout<<x<<endl #define debug(x) cout<<#x<<": "<<x const int BA = 1000; const int INFTY = (1<<21); int xg,yg,w,h,gc; int maps[101][101]; int solve(int ys,int xs); int main(){ int tate[2] = {2,4}; int yoko[2] = {4,2}; int xs,ys,n; int c[101],d[101],x[1...
a.cc: In function 'int solve(int, int)': a.cc:42:74: error: missing template arguments before '[' token 42 | if(xs < 0 || ys < 0 || xs > w-1 || ys > h-1 || maps[ys][xs] == 0 || map[ys][xs] != gc){ | ^
s708891178
p00207
C++
#include <iostream> using namespace std; int F[102][102]; void DFScolor(int X,int Y,int color){ if(F[X][Y]!=color) return; F[X][Y]=9; DFScolor(X-1,Y,color); DFScolor(X,Y+1,color); DFScolor(X+1,Y,color); DFScolor(X,Y-1,color); } int main(){ while(1){ int H,W,xg,yg,xs,ys,n,count=0; cin>>H; if(H==0) c...
a.cc: In function 'int main()': a.cc:60:33: error: too many arguments to function 'void DFScolor(int, int, int)' 60 | DFScolor(xb[i],yb[i],colo[i],xg,yg); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:5:6: note: declared here 5 | void DFScolor(int X,int Y,int co...
s237095157
p00207
C++
#include <iostream> using namespace std; int F[102][102]; void DFScolor(int X,int Y,int color){ if(F[X][Y]!=color) return; F[X][Y]=9; DFScolor(X-1,Y,color); DFScolor(X,Y+1,color); DFScolor(X+1,Y,color); DFScolor(X,Y-1,color); } int main(){ while(1){ int H,W,xg,yg,xs,ys,n,count=0; cin>>H; if(H==0) c...
a.cc: In function 'int main()': a.cc:60:33: error: too many arguments to function 'void DFScolor(int, int, int)' 60 | DFScolor(xb[i],yb[i],colo[i],xg,yg); | ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~ a.cc:5:6: note: declared here 5 | void DFScolor(int X,int Y,int co...
s025630401
p00207
C++
#include<bits/stdc++.h> #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) range(i,0,b) #define pb(a) push_back(a) #define all(a) (a).begin(), (a).end() #define debug(x) cout << "debug " << x << endl; using namespace std; bool isMaze; int blocks[105][105], xg, yg, w,h; void dfs(int target, int x, in...
a.cc: In function 'int main()': a.cc:41:45: error: 'b' was not declared in this scope 41 | rep(j, (d?4:2)) rep(k, (d?2:4)) b[x + j][y + k] = c; | ^
s152080703
p00207
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; #define INF 1010001000 #define loop(i, n) for (int i = 0; i < n; i++) #define mp make_pair typedef pair<int, int> i_i; int sx, sy, gx, gy; int n, m; int main() { while(cin >> n >> m,(n|m)){ m++; n++; vector<vector<int> > graph(m,vecto...
a.cc: In function 'int main()': a.cc:38:8: error: 'dfs' was not declared in this scope 38 | cout<<(dfs(graph))?"OK":"NG"<<endl; | ^~~ a.cc:38:29: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<' 38 | cout<<(dfs(graph))?"OK":"NG"<<end...
s302846425
p00207
C++
#include <iostream> #include <vector> #include <algorithm> #include <queue> using namespace std; #define INF 1010001000 #define loop(i, n) for (int i = 0; i < n; i++) #define mp make_pair typedef pair<int, int> i_i; bool dfs(vector<vector<int> > &g); int sx, sy, gx, gy; int n, m; int dx[4]={0,1,0,-1}; int dy[4]={1,0...
a.cc: In function 'int main()': a.cc:43:36: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<' 43 | cout << (dfs(graph)) ? "OK" : "NG" << endl; | ~~~~~^~~~~~~ a.cc: In function 'bool dfs(std::vector<std::vector<int>...
s689547970
p00207
C++
#include<cstdio> #include<cstring> #include<stack> struct p{ int x; int y; }; using namespace std; int main(){ int w,h,sx,sy,gx,gy,n,c,d,x,y,i,j,k,o; int map[100][100]; int used[100][100]; int mx[4]={-1,0,1,0}; int my[4]={0,-1,0,1}; p v,u; stack<p> s; while(1){ scanf("%d %d",&w,&h); if(w==0&&h==0){ bre...
a.cc: In function 'int main()': a.cc:69:42: error: cannot convert 'std::stack<p>::empty' from type 'bool (std::stack<p>::)() const' to type 'bool' 69 | while(!s.empty){ | ^~~~~ a.cc:69:42: error: in argument to unary ! 69 | ...
s487833019
p00207
C++
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < n; ++i) #define rep2(i, n) for(int i = 1; i <= n; ++i) #define INF 0 #define MAX 102 using namespace std; const int dx[] = {1, 0, -1, 0}; const int dy[] = {0, 1, 0, -1}; int field[102][102]; int h, w, sx, sy, gx, gy, n; int col, dire, x, y; int scol; b...
a.cc: In function 'int main()': a.cc:48:34: error: 'a' was not declared in this scope 48 | }a | ^
s379882824
p00207
C++
#include<iostream> using namespace std; int F[102][102]; bool DFS(int X, int Y, int Xg, int Yg, int c){ if(F[Y][X] != c){ return false; }else if(F[Y][X] == c && X == Xg && Y == Yg){ return true; } F[Y][X] = -1; if(DFS(X, Y - 1, Xg, Yg, c)){ return true; }else if(DFS(X + 1, Y, Xg, Yg, c)){ return true; ...
a.cc:59:38: error: stray '#' in program 59 | cout << "NG" << "\n";#include<iostream> | ^ a.cc: In function 'int main()': a.cc:59:39: error: 'include' was not declared in this scope 59 | cout << "NG" << "\n";#include<iostream> | ...
s242302511
p00207
C++
#include<iostream> using namespace std; int Array[200][200]; #define START 20 void DFS(int h,int w,int c){ if(Array[h][w] == GOAL){ is_goal = true; return; } if(Array[h][w] != c || Array[h][w] == 0 || Array[h][w] == 6){ return; } int tmp=Array[h][w]; Array[h][w] = 6; ...
a.cc: In function 'void DFS(int, int, int)': a.cc:10:23: error: 'GOAL' was not declared in this scope 10 | if(Array[h][w] == GOAL){ | ^~~~ a.cc:11:7: error: 'is_goal' was not declared in this scope 11 | is_goal = true; | ^~~~~~~
s070525875
p00207
C++
#include<iostream> using namespace std; char F[102][102]; void DFS(int Y,int X,char C){ if(F[Y][X]!=C) return; F[Y][X]='.'; DFS(Y-1,X,C); DFS(Y,X+1,C); DFS(Y+1,X,C); DFS(Y,X-1,C); } int main(){ while(1){ int w,h; cin>>w>>h; if(w==0&&h==0) break; int xs,ys,xg,yg; cin>>xs>>ys>>xg>>yg; int n; c...
a.cc: In function 'int main()': a.cc:32:1: error: expected primary-expression before 'using' 32 | using namespace std; | ^~~~~ a.cc:36:29: error: a function-definition is not allowed here before '{' token 36 | void DFS(int Y,int X,char C){ | ^ a.cc:50:9: warning: empty pare...
s688291874
p00207
C++
include <iostream> using namespace std; int F[101][102]; void DFS(int Y, int X, int c) { //cout << Y << " " << X << endl; if (F[Y][X] != c || F[Y][X] == 0) return; F[Y][X] = 10; DFS(Y - 1, X, c);//??? //DFS(Y - 1, X+1, A_...
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:29:17: error: 'cin' was not declared in this scope 29 | cin >> W >> H; | ^~~ a.cc:57:25: error: 'cout' was not declared in this scope 57 | ...
s976198168
p00207
C++
#include "stdafx.h" #include <iostream> using namespace std; int F[102][102]; void DFS(int Y, int X, int c) { //cout << Y << " " << X << endl; if (F[Y][X] != c || c != 0) return; F[Y][X] = 10; DFS(Y - 1, X, c);//??? //DFS(Y - 1, X+1, A_ito);//?????? DFS(Y, X + 1, c);//??? //DFS(Y + 1, X+1, A_ito);/...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s252853809
p00207
C++
#include "stdafx.h" #include <iostream> using namespace std; int F[102][102] = { 0 }; void DFS(int Y, int X, int c) { //cout << Y << " " << X << endl; if (F[Y][X] != c) return; F[Y][X] = 10; DFS(Y - 1, X, c);//??? //DFS(Y - 1, X+1, A_ito);//?????? DFS(Y, X + 1, c);//??? //DFS(Y + 1, X+1, A_ito);//?...
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s156398423
p00207
C++
#include<iostream> using namespace std; int F[102][102]; void DFS(int Y,int X,int C){ if(F[Y][X]!=C) return; F[Y][X]=6; DFS(Y-1,X,C); DFS(Y,X+1,C); DFS(Y+1,X,C); DFS(Y,X-1,C); } int main(){ int w,h,xs,ys,xg,yg,n; int c,d,x,y; while(true){ cin >> w >> h; if(w==0&&h==0) ...
a.cc: In function 'int main()': a.cc:49:16: error: 'xy' was not declared in this scope; did you mean 'y'? 49 | if(F[xs][xy]!=1&&F[xs][xy]!=2&&F[xs][xy]!=3&&F[xs][xy]!=4&&F[xs][xy]!=5) | ^~ | y
s988934961
p00207
C++
#include<functional> #include<algorithm> #include<iostream> #include<utility> #include<string> #include<vector> #include<cmath> #include<stack> #include<queue> #include<deque> #include<map> #define rep(i,n) for(int i=0;i<n;i++) #define loop(i,x,n) for(int i=x;i<n;i++) #define all(v) (v).begin(),(v).end() #define pf pus...
/tmp/ccCsALhd.o: in function `dfs(long long, long long, long long)': a.cc:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `h' defined in .bss section in /tmp/ccCsALhd.o a.cc:(.text+0x3e): relocation truncated to fit: R_X86_64_PC32 against symbol `w' defined in .bss section in /tmp/ccCsALhd.o a.c...
s514088375
p00207
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
s880364448
p00207
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
s903855738
p00207
C++
#include<iostream> #include<algorithm> #include<vector> #include<string> #define ll long long #define loop(i,n) for (int i = 0; i < n; i++) #define loops(i,f,n) for (int i = (f); i < n; i++) #define INF 100000000000000 #define sort(a) sort(a.begin(),a.end()) #define rsort(a) sort(a.rbegin(),a.rend()) using namespace st...
a.cc:85:2: error: stray '#' in program 85 | }#include<iostream> | ^ a.cc:85:3: error: 'include' does not name a type 85 | }#include<iostream> | ^~~~~~~ a.cc:96:5: error: redefinition of 'int w' 96 | int w, h, sx, sy, gx, gy, n; | ^ a.cc:12:5: note: 'int w' previously declared here 1...
s656440694
p00207
C++
#include <iostream> using namespace std; int F[102][102]; int xg,yg; int flag = 0; void DFS(int Y,int X,int c){ if(F[Y][X]!=c){ return 0; } if(Y == xg && X == yg){ flag = 1; } F[Y][X] = 0; DFS(Y-1,X ,c); //DFS(Y-1,X+1,c); DFS(Y ,X+1,c); //DFS(Y+1,X+1,c); DFS(Y+1,X ,c); //DFS(Y+1,X-1,...
a.cc: In function 'void DFS(int, int, int)': a.cc:10:12: error: return-statement with a value, in function returning 'void' [-fpermissive] 10 | return 0; | ^
s498071429
p00207
C++
#include <iostream> using namespace std; int F[102][102]; int xg,yg; int flag = 0; void DFS(int Y,int X,int c){ if(F[Y][X]!=c){ return; } if(Y == xg && X == yg){ flag = 1; } F[Y][X] = 0; DFS(Y-1,X ,c); //DFS(Y-1,X+1,c); DFS(Y ,X+1,c); //DFS(Y+1,X+1,c); DFS(Y+1,X ,c); //DFS(Y+1,X-1,c)...
a.cc:39:13: error: stray '#' in program 39 | } else {#include <iostream> | ^ a.cc: In function 'int main()': a.cc:39:14: error: 'include' was not declared in this scope 39 | } else {#include <iostream> | ^~~~~~~ a.cc:39:31: error: expected primary-expression before '>'...
s793727403
p00207
C++
#include <iostream> using namespace std; int F[102][102]; bool DFS(int Y, int X, int C, int yg, int xg) { if(Y == yg && X == xg) return true; if(F[Y][X]!=C) return false; F[Y][X] = 0; bool tmp = 0; tmp += DFS(Y-1, X, C, yg, xg); tmp += DFS(Y+1, X, C, yg, xg); tmp += DFS(Y, X-1, C, yg, xg); t...
a.cc: In function 'int main()': a.cc:26:21: error: expected ';' before 'int' 26 | F[102][102] = {} | ^ | ; 27 | 28 | int w, h; | ~~~ a.cc:29:12: error: 'w' was not declared in this scope 29 | cin >> w >> h; | ...
s659140428
p00207
C++
#include <iostream> using namespace std; int F[105][105]; int xg,yg; void DFS(int Y,int X,int c){ if(F[Y][X] != c){ return; } F[Y][X] = -1; DFS(Y-1,X ,c); DFS(Y ,X+1,c); DFS(Y+1,X ,c); DFS(Y ,X-1,c); } int main(){ int w,h,xs,ys,n; while(1){ cin >> w >> h; if(w == 0 && h == 0) ...
a.cc: In function 'int main()': a.cc:30:26: error: expected ';' before '}' token 30 | F[i][j]=0 | ^ | ; 31 | } | ~
s281557462
p00207
C++
#include <iostream> using namespace std;
/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
s140961469
p00207
C++
#include <iostream> using namespace std; int F[105][105]; void DFS(int Y,int X,int c){ if(F[Y][X] != c){ return; } F[Y][X] = -1; DFS(Y-1,X ,c); DFS(Y ,X+1,c); DFS(Y+1,X ,c); DFS(Y ,X-1,c); } int main(){ int w,h,xs,ys,xgyg,n; while(1){ cin >> w >> h; if(w == 0 && h == 0) bre...
a.cc: In function 'int main()': a.cc:32:24: error: 'xg' was not declared in this scope; did you mean 'xs'? 32 | cin >> xs >> ys >> xg >> yg >> n; | ^~ | xs a.cc:32:30: error: 'yg' was not declared in this scope; did you mean 'ys'? 32 | cin >> xs >>...
s504671967
p00207
C++
#include <iostream> using namespace std; int F[102][102]; int DFS(int Y,int X,int c){ int cnt = 0; if(F[Y][X] != c){ return 0; } F[Y][X] = -1; cnt += DFS(Y-1,X ,c); cnt += DFS(Y ,X+1,c); cnt += DFS(Y+1,X ,c); cnt += DFS(Y ,X-1,c); return cnt; } int main(){ int w,h,xs,ys,xg,yg,n; whil...
a.cc: In function 'int main()': a.cc:52:23: error: expected ';' before 'if' 52 | DFS(xs,ys,F[xs][ys]) | ^ | ; 53 | if(1){ | ~~ a.cc:55:5: error: 'else' without a previous 'if' 55 | } else { | ^~~~
s303066708
p00207
C++
#include <iostream> using namespace std; int F[102][102]; int DFS(int Y,int X,int c){ int cnt = 0; if(F[Y][X] != c){ return 0; } F[Y][X] = -1; cnt += DFS(Y-1,X ,c); cnt += DFS(Y ,X+1,c); cnt += DFS(Y+1,X ,c); cnt += DFS(Y ,X-1,c); return cnt; } int main(){ int w,h,xs,ys,xg,yg,n; whil...
a.cc: In function 'int main()': a.cc:52:23: error: expected ';' before 'if' 52 | DFS(xs,ys,F[xs][ys]) | ^ | ; 53 | if(x == 8){ | ~~ a.cc:55:5: error: 'else' without a previous 'if' 55 | } else { | ^~~~
s218683590
p00207
C++
#include <iostream> using namespace std; int F[102][102]; int DFS(int Y,int X,int c){ int cnt = 0; if(F[Y][X] != c){ return 0; } F[Y][X] = -1; cnt += DFS(Y-1,X ,c); cnt += DFS(Y ,X+1,c); cnt += DFS(Y+1,X ,c); cnt += DFS(Y ,X-1,c); return cnt; } int main(){ int w,h,xs,ys,xg,yg,n; whil...
a.cc: In function 'int main()': a.cc:53:6: error: 'x' was not declared in this scope 53 | if(x == 8){ | ^
s209043774
p00207
C++
#include <iostream> using namespace std; int C[102][102]; int ans; int xg,yg; void meiro(int W,int H,int c){ if(W==xg && H==yg){ ans = 1; return; } if(C[W][H]!=c){ return; } C[W][H] = '.'; meiro(W-1,H ,c); meiro(W ,H+1,c); meiro(W+1,H ,c); meiro(W ,H-1,c); } int main(){ while(1){ int w,...
a.cc: In function 'int main()': a.cc:70:4: error: 'cbasew' was not declared in this scope; did you mean 'cbase'? 70 | if(cbasew == 0){ | ^~~~~~ | cbase
s405045718
p00207
C++
include<iostream> using namespace std; struct board{ int mass[102][102]; }; bool goal_flag; void DFS(int x,int y,int gx,int gy,board b,int c){ if(b.mass[y][x]!=c)return; if(!b.mass[y][x])return; b.mass[y][x]=-1; if(x==gx&&y==gy)goal_flag=true; DFS(x+1,y,gx,gy,b,c); DFS(x-1,y,gx,gy,b,c); ...
a.cc:1:1: error: 'include' does not name a type 1 | include<iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:27:5: error: 'cin' was not declared in this scope 27 | cin>>w>>h; | ^~~ a.cc:51:18: error: 'cout' was not declared in this scope 51 | if(goal_flag)cout<<"OK"; | ...
s350046923
p00207
C++
#include <iostream> using namespace std; int C[102][102]; int ans; int xg,yg; void meiro(int W,int H,int c){ if(W==xg && H==yg){ ans = 1; return; } if(C[W][H]!=c){ return; } C[W][H] = '.'; meiro(W-1,H ,c); meiro(W ,H+1,c); meiro(W+1,H ,c); meiro(W ,H-1,c); } int main(){ while(1...
a.cc: In function 'int main()': a.cc:80:25: error: invalid types 'int[int]' for array subscript 80 | if(ans != 1 || c[xs][ys] == 0){ | ^
s711158644
p00207
C++
\#include <iostream> using namespace std; int F[105][105]; int xg,yg; void DFS(int Y,int X,int c){ if(F[Y][X] != c){ return; } F[Y][X] = -2000; DFS(Y-1,X ,c); DFS(Y ,X+1,c); DFS(Y+1,X ,c); DFS(Y ,X-1,c); } int main(){ int w,h,xs,ys,n; while(1){ cin >> w >> h; if(w == ...
a.cc:1:1: error: stray '\' in program 1 | \#include <iostream> | ^ a.cc:1:2: error: stray '#' in program 1 | \#include <iostream> | ^ a.cc:1:3: error: 'include' does not name a type 1 | \#include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:24:5: error: 'cin' was not declar...
s143841984
p00207
C++
#include <iostream> using namespace std; int F[105][105]; int xg,yg; void DFS(int Y,int X,int c){ if(F[Y][X] != c){ return; } F[Y][X] = -2000; DFS(Y-1,X ,c); DFS(Y ,X+1,c); DFS(Y+1,X ,c); DFS(Y ,X-1,c); } int main(){ int w,h,xs,ys,n; while(1){ cin >> w >> h; if(w == 0...
a.cc: In function 'int main()': a.cc:36:16: error: expected ';' before 'else' 36 | ca = 10 | ^ | ; 37 | else if(i == n-1) | ~~~~
s837009959
p00207
C++
#include <iostream> using namespace std; int F[105][105]; int xg,yg; void DFS(int Y,int X,int c){ if(F[Y][X] != c){ return; } F[Y][X] = -2000; DFS(Y-1,X ,c); DFS(Y ,X+1,c); DFS(Y+1,X ,c); DFS(Y ,X-1,c); } int main(){ int w,h,xs,ys,n; while(1){ cin >> w >> h; if(w == 0...
a.cc: In function 'int main()': a.cc:38:11: error: incompatible types in assignment of 'int' to 'int [n]' 38 | c = 0; | ~~^~~
s199482843
p00207
C++
#include <iostream> using namespace std; int F[105][105]; int xg,yg,w,h; void DFS(int Y,int X,int c){ if(F[Y][X] != c){ return; } F[Y][X] = -1; DFS(Y+1,X ,c); DFS(Y-1 ,X,c); DFS(Y,X+1 ,c); DFS(Y ,X-1,c); } int main(){ int xs,ys,n; while(1){ cin >> w >> h; if(w == 0 &&...
a.cc: In function 'int main()': a.cc:63:2: error: expected '}' at end of input 63 | } | ^ a.cc:21:11: note: to match this '{' 21 | int main(){ | ^
s783050159
p00207
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
s606864832
p00207
C++
#include<iostream> using namespace std; char F[102][102]; void DFS(int x,int y,char c){ if(F[x][y]!=c) return; F[x][y]='@'; DFS(x-1,y,c); DFS(x,y+1,c); DFS(x+1,y,c); DFS(x,y-1,c); } void Block(int c,int d,int x,int y){ char b; if(c=0) b='+'; if(c=1) b='-'; if(c=2) b='*'; if(c=3) ...
a.cc: In function 'int main()': a.cc:64:12: error: 'yscout' was not declared in this scope 64 | DFS(xs,yscout<<endl;,F[xs][ys]); | ^~~~~~ a.cc:64:25: error: expected primary-expression before ',' token 64 | DFS(xs,yscout<<endl;,F[xs][ys]); | ^
s066237023
p00207
C++
#include<stdio.h> #include<windows.h> int main(void) { int w,h; int map[101][101]; int st[2],go[2]; int i,j,k,l,m; int num; int b_c,b_ang,b_x,b_y; int sign; int ans; for(;;) { ans=0; for(i=0;i<100;i++) { for(j=0;j<100;j++) map[i][j]=0; } scanf("%d%d",&w,&h); if(w==0 && h==0) b...
a.cc:2:9: fatal error: windows.h: No such file or directory 2 | #include<windows.h> | ^~~~~~~~~~~ compilation terminated.