submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s704347588
p00032
C++
#include<cstdio> using namespace std; int main(){ int a,b,c,x=0,y=0; While(scanf("%d,%d,%d",&a,&b,&c)!=EOF){ If(a==b)x++; if(a*a+b*b==c*c)y++; } printf("%d?\n%d?\n",y,x); return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'While' was not declared in this scope 6 | While(scanf("%d,%d,%d",&a,&b,&c)!=EOF){ | ^~~~~
s536664595
p00032
C++
#include<cstdio> using namespace std; int main(){ int a,b,c,x=0,y=0; While(scanf("%d,%d,%d",&a,&b,&c)!=EOF){ if(a==b)x++; if(a*a+b*b==c*c)y++; } printf("%d?\n%d?\n",y,x); return 0; }
a.cc: In function 'int main()': a.cc:6:1: error: 'While' was not declared in this scope 6 | While(scanf("%d,%d,%d",&a,&b,&c)!=EOF){ | ^~~~~
s515261853
p00032
C++
#include <cstdio> using namespace std; #define scanf scanf_s #define printf printf_s int a, b, c, r = 0, d = 0; int main(){ while (scanf("%d,%d,%d", &a, &b, &c) != EOF) { if (a*a + b*b == c*c) { r++; } if (a == b) { d++; } } printf("%d\n%d\n", r, d); return 0; }
a.cc: In function 'int main()': a.cc:4:15: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 4 | #define scanf scanf_s | ^~~~~~~ a.cc:10:16: note: in expansion of macro 'scanf' 10 | while (scanf("%d,%d,%d", &a, &b, &c) != EOF) { | ^~~~~ a.cc:5:16: error: 'printf_s' was not declared in this scope; did you mean 'printf'? 5 | #define printf printf_s | ^~~~~~~~ a.cc:18:9: note: in expansion of macro 'printf' 18 | printf("%d\n%d\n", r, d); | ^~~~~~
s189630604
p00032
C++
#include<iostream> #include<stdio.h> using namespace std; int main() { int sides[3]; int square=0,para=0; while (scanf("%d,%d,%d", &sides[0], &sides[1], &sides[2]) != EOF) { //??£?????¢???check if (sides[0] * sides[0] + sides[1] * sides[1] == sides[2] * sides[2]) { square++; para++; } //??????????????¢???check else if (sides[0] == sides[1]) { para++; } cout << square << endl << para << endl; }
a.cc: In function 'int main()': a.cc:17:10: error: expected '}' at end of input 17 | } | ^ a.cc:5:12: note: to match this '{' 5 | int main() { | ^
s927820418
p00032
C++
import sys x,y=0,0 for line in sys.stdin: a,b,c = map(int,line[:-1].split(',')) if a*a + b*b == c*c: x += 1 if a == b: y += 1 print("{}\n{}".format(x,y))
a.cc:1:1: error: 'import' does not name a type 1 | import sys | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
s784243840
p00032
C++
#include<iostream> int main() { int cnt[2] = { 0,0 }; while (true) { int a, b, c; char foo; std::cin >> a >> foo >> b >> foo >> c; if (std::cin.eof()) { break; } if (c == hypot(a, b)) { cnt[0]++; } else if (a == b) { cnt[1]++; } } std::cout << cnt[0] << std::endl; std::cout << cnt[1] << std::endl; return 0; }
a.cc: In function 'int main()': a.cc:14:26: error: 'hypot' was not declared in this scope 14 | if (c == hypot(a, b)) | ^~~~~
s795691267
p00032
C++
#include <cstdio> using namespace std; int main() { int x, y, r, hisi = 0, tyou = 0; while (scanf("%d %d %d ", &x, &y, &r) == 3) { if (x == y) {hisi++;} if (x * x + y * y = r * r) {tyou++;} } printf("%d\n%d\n", hisi, tyou); }
a.cc: In function 'int main()': a.cc:10:15: error: lvalue required as left operand of assignment 10 | if (x * x + y * y = r * r) {tyou++;} | ~~~~~~^~~~~~~
s964630500
p00032
C++
#include <cstdio> using namespace std; int main() { int x, y, r, hisi = 0, tyou = 0; while (scanf("%d,%d,%d ", &x, &y, &r) == 3) { if (x == y) {hisi++;} if (x * x + y * y = r * r) {tyou++;} } printf("%d\n%d\n", hisi, tyou); }
a.cc: In function 'int main()': a.cc:10:15: error: lvalue required as left operand of assignment 10 | if (x * x + y * y = r * r) {tyou++;} | ~~~~~~^~~~~~~
s573238066
p00032
C++
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <string> #include <set> using namespace std; int main() { int t=0, h=0; set<vector<int> > T, H; int a, b, c; string buf; while(cin>>buf){ if(buf=="0") break; sscanf(buf.c_str(),"%d,%d,%d", &a, &b, &c); vector<int> all; all.push_back(a); all.push_back(b); all.push_back(c); sort(all.begin(), all.end()); if(all[0]==all[1] || all[1]==all[2]); H.insert(all) if(all[0]*all[0]+all[1]*all[1]==all[2]*all[2]) T.insert(all); } cout<<T.size()<<endl<<H.size()<<endl; return 0; }
a.cc: In function 'int main()': a.cc:23:68: error: expected ';' before 'if' 23 | if(all[0]==all[1] || all[1]==all[2]); H.insert(all) | ^ | ; 24 | if(all[0]*all[0]+all[1]*all[1]==all[2]*all[2]) T.insert(all); | ~~
s794654017
p00032
C++
#include <iostream> #include <cstdio> using namespace std; int main(void) { int a,b; int t; int countt; int counth; char input[100]; while(1) { gets(input); a = input[0] - '0'; b = input[2] - '0'; t = input[4] - '0'; if(a*a+b*b == t*t)//直角を持つ { if(a == b) ++countt; else ++counth; } else if(a == b) ++counth; if(input[5] == EOF) break; } cout << countt << endl; cout << counth << endl; return 0; }
a.cc: In function 'int main()': a.cc:17:17: error: 'gets' was not declared in this scope; did you mean 'getw'? 17 | gets(input); | ^~~~ | getw
s101365285
p00032
C++
#include <cstdio> using namespace std; int main() { int a,b,c,tc,rc; tc = rc = 0; while(scanf("%d,%d,%d",&a,&b,&c) == 3) { if(a == b) ++ rc; else if(a * a + b * b == c * c) ++tc; } cout << tc << endl << rc << endl; }
a.cc: In function 'int main()': a.cc:13:9: error: 'cout' was not declared in this scope 13 | cout << tc << endl << rc << endl; | ^~~~ a.cc:2:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>' 1 | #include <cstdio> +++ |+#include <iostream> 2 | using namespace std; a.cc:13:23: error: 'endl' was not declared in this scope 13 | cout << tc << endl << rc << endl; | ^~~~ a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>' 1 | #include <cstdio> +++ |+#include <ostream> 2 | using namespace std;
s660076783
p00032
C++
#include <iostream> using namespace std; int main() { int a = 0, b = 0; int x,y,z; char a, b; while(cin >> x >> a >> y >> b >> t) { if(((x * x) + (y * y)) == z* z) a++; if(x == y) h++; }j cout << a << endl; cout << b << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: conflicting declaration 'char a' 8 | char a, b; | ^ a.cc:6:9: note: previous declaration as 'int a' 6 | int a = 0, b = 0; | ^ a.cc:8:13: error: conflicting declaration 'char b' 8 | char a, b; | ^ a.cc:6:16: note: previous declaration as 'int b' 6 | int a = 0, b = 0; | ^ a.cc:9:38: error: 't' was not declared in this scope 9 | while(cin >> x >> a >> y >> b >> t) | ^ a.cc:12:20: error: 'h' was not declared in this scope 12 | if(x == y) h++; | ^ a.cc:13:6: error: 'j' was not declared in this scope 13 | }j | ^
s027316022
p00032
C++
#include <iostream> using namespace std; int main() { int a = 0, b = 0; int x,y,z; char a, b; while(cin >> x >> a >> y >> b >> z) { if(((x * x) + (y * y)) == z* z) a++; if(x == y) b++; }j cout << a << endl; cout << b << endl; return 0; }
a.cc: In function 'int main()': a.cc:8:10: error: conflicting declaration 'char a' 8 | char a, b; | ^ a.cc:6:9: note: previous declaration as 'int a' 6 | int a = 0, b = 0; | ^ a.cc:8:13: error: conflicting declaration 'char b' 8 | char a, b; | ^ a.cc:6:16: note: previous declaration as 'int b' 6 | int a = 0, b = 0; | ^ a.cc:13:6: error: 'j' was not declared in this scope 13 | }j | ^
s848514545
p00032
C++
3,4,5 5,5,8 4,4,4 5,4,3
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 3,4,5 | ^
s169119199
p00033
Java
import java.util.*; class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int k=new int[n][10]; for(int i=0;i<n;i++){ for(int j=0;j<10;j++){ k[i][j]=sc.nextInt(); } } for(int g=0;g<n;g++){ if(dfs(g,0,0,0,k)==true){System.out.println("YES");} else{System.out.println("NO");} } } public static boolean dfs(int i,int j,int r,int l,final int[][] k){ if(j==10){return true;} else if(k[i][j]>r&&k[i][j]>l){ if(r>l){r=k[i][j];} else{l=k[i][j];} } else if(k[i][j]>r){r=k[i][j];} else if(k[i][j]>l){l=k[i][j];} else{return false;} return dfs(i,j+1,r,l,k); } }
Main.java:7: error: incompatible types: int[][] cannot be converted to int int k=new int[n][10]; ^ Main.java:10: error: array required, but int found k[i][j]=sc.nextInt(); ^ Main.java:14: error: incompatible types: int cannot be converted to int[][] if(dfs(g,0,0,0,k)==true){System.out.println("YES");} ^ Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output 3 errors
s223445433
p00033
Java
import java.util.*; ?? public class Main { ?? ????????public static void main(String[] args) { ????????????????Scanner sc = new Scanner(System.in); ????????????????int n = sc.nextInt(); ????????????????for(int i=0; i<n; i++){ ????????????????????????int b = 0; ????????????????????????int c = 0; ????????????????????????for(int j=0; j<10; j++){ ????????????????????????????????int read = sc.nextInt(); ????????????????????????????????if( (b>c ? b : c) < read ){ ????????????????????????????????????????if(b > c) b = read; ????????????????????????????????????????else c = read; ????????????????????????????????} ????????????????????????????????else if(b < read && c > read) b=read; ????????????????????????????????else if(c < read && b < read) c=read; ????????????????????????????????else { System.out.println("NO"); break; } ????????????????????????????????if(j==9) System.out.println("YES"); ????????????????????????} ????????????????} ????????} }
Main.java:2: error: class, interface, enum, or record expected ?? ^ Main.java:4: error: illegal start of type ?? ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: illegal start of expression ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: : expected ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:6: error: : expected ????????????????Scanner sc = new Scanner(System.in); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: illegal start of expression ????????????????int n = sc.nextInt(); ^ Main.java:7: error: '.class' expected ????????????????int n = sc.nextInt(); ^ Main.java:7: error: : expected ????????????????int n = sc.nextInt(); ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:8: error: illegal start of expression ????????????????for(int i=0; i<n; i++){ ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: illegal start of expression ????????????????????????int b = 0; ^ Main.java:9: error: '.class' expected ????????????????????????int b = 0; ^ Main.java:9: error: : expected ????????????????????????int b = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ Main.java:10: error: illegal start of expression ????????????????????????int c = 0; ^ 100 errors only showing the first 100 errors, of 166 total; use -Xmaxerrs if you would like to see more printing javac parameters to: /w/javac.20260128_021751.args
s328017398
p00033
Java
import java.util.Scanner; /** * Created by sotetsuk on 2015/07/31. */ public class AOMain { static final int K = 10; static int N; static int[] balls = new int[10]; static Scanner sc = new Scanner(System.in); static int l, r; public static void read() { for(int i = 0; i < K; i++) { balls[i] = sc.nextInt(); } } public static boolean dfs(int i) { // stop condition if(i == K) return true; // recursive boolean flag_l = false; boolean flag_r = false; if(l == -1 || balls[l] < balls[i]) { int tmp_l = l; l = i; flag_l = dfs(i + 1); l = tmp_l; } if(r == -1 || balls[r] < balls[i]) { int tmp_r = r; r = i; flag_r = dfs(i + 1); r = tmp_r; } return flag_l || flag_r; } public static void solve() { l = -1; r = -1; String ans = dfs(0) ? "YES" : "NO"; System.out.println(ans); } public static void main(String[] args) { N = sc.nextInt(); for(int i = 0; i < N; i++) { read(); solve(); } } }
Main.java:6: error: class AOMain is public, should be declared in a file named AOMain.java public class AOMain { ^ 1 error
s444085672
p00033
Java
import java.util.*; class Main{ int N; int[] m=new int [10]; int l=0; int r=0; String ans="YES"; Main(){ Scanner sc=new Scanner(System.in); N=sc.nextInt(); for(int i=0; i<N; i++){ for(int j=0; j<10; j++){ m[j] =sc.nextInt(); if(l m[j] public static void main(String[] args){ new Main(); } }
Main.java:14: error: ')' expected if(l m[j] ^ Main.java:14: error: not a statement if(l m[j] ^ Main.java:14: error: ';' expected if(l m[j] ^ Main.java:22: error: illegal start of expression public static void main(String[] args){ ^ 4 errors
s753256082
p00033
Java
import java.util.*; class main{ Scanner sc=new Scanner(System.in); void aa(){ int n=sc.nextInt(); for(int i=0;i<n;i++){ String YN="YES"; int r=sc.nextInt(); int l=0; for(int j=0;j<9;j++){ int ball=sc.nextInt(); if(ball>r)r=ball; else if(ball>l)l=ball; else YN="NO"; } System.out.println(YN); } } public static void main(String[]arg){ new Main().aa(); } }
Main.java:2: error: duplicate class: main class main{ ^ Main.java:20: error: cannot access Main new Main().aa(); ^ bad source file: ./Main.java file does not contain class Main Please remove or make sure it appears in the correct subdirectory of the sourcepath. 2 errors
s983260236
p00033
Java
import java.util.*; import java.io.*; public class Ball{ static int a = 0; //??????????????¢??° static int b = 0; static int n; static int[][] input; public static void main(String[] args)throws IOException{ Scanner sc = new Scanner(System.in); BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); n = sc.nextInt(); input = new int[n][10]; for(int i = 0;i < input.length;i++){ for(int j = 0;j < 10;j++){ input[i][j] = Integer.parseInt(sc.next()); } } for(int i = 0;i < input.length;i++){ if(dfs(0,input[i])){ System.out.println("yes"); }else{ System.out.println("no"); } } } static boolean dfs(int i,int[] k){ if(i == 10) return a == k[9] || b == k[9]; if(k[i] > a){ a = k[i]; }else if(k[i] > b){ b = k[i]; } if(dfs(i+1,k)) return true; return false; } }
Main.java:4: error: class Ball is public, should be declared in a file named Ball.java public class Ball{ ^ 1 error
s786389746
p00033
Java
import java.util.Scanner; public class aoj0033 { public static int[] b; public static int[] f; public static int[] s; public static boolean ok; public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); while(n--!=0){ b = new int[10]; for(int i=0;i<10;i++){ b[i]=scan.nextInt(); } f = new int[10]; s = new int[2]; ok = false; dfs(0); System.out.println(ok?"YES":"NO"); } } public static boolean check(){ s[0] = s[1] = 0; for(int i=0;i<10;i++){ if(s[f[i]]>=b[i])return false; s[f[i]] = b[i]; } return true; } public static void dfs(int k){ if(k==10){ ok |= check(); }else{ f[k] = 0; dfs(k+1); f[k] = 1; dfs(k+1); } } }
Main.java:3: error: class aoj0033 is public, should be declared in a file named aoj0033.java public class aoj0033 { ^ 1 error
s803829158
p00033
Java
package aoj0033; import java.util.Scanner; public class Main { void run() { return; // ??\??? int n, x; Scanner scan = new Scanner(System.in); n = scan.nextInt(); int[] ans = new int[n]; for( int i = 0; i < n; i++ ) { // ??± int box1 = 0, box2 = 0; // ?????? for( int j = 0; j < 10; j++ ) { x = scan.nextInt(); if( x > box1 ) box1 = x; else if( x > box2 ) box2= x; else { // ans[i] = -1; System.out.println("NO"); break; } if( j == 9 ) { // ans[i] = 1; System.out.println("YES"); } } } // for( int i = 0; i < n; i++ ) { // if( ans[i] == 1 ) System.out.println("YES"); // else System.out.println("NO"); // } } public static void main(String[] args) { new Main().run(); } }
Main.java:9: error: unreachable statement int n, x; ^ 1 error
s547819891
p00033
Java
public class Main { void run() { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] boll = new int[10]; for(int k = 0; k < n; k++) { for(int i = 0; i < 10; i++) { boll[i] = scan.nextInt(); } int judg = 0; for(int i = 0; i < n; i++) { int right,left; right = boll[0]; left = 0; for(int m = 1; m < 10; m++) { if(right > boll[m]) { if(left < boll[m]) { left = boll[m]; } else { judg = 0; break; } } else if(right < boll[m]) { right = boll[m]; } judg = 1; } if(judg == 0) { System.out.println("NO"); } else { System.out.println("YES"); } } } } public static void main(String[] args) { new Main().run(); } }
Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main Main.java:3: error: cannot find symbol Scanner scan = new Scanner(System.in); ^ symbol: class Scanner location: class Main 2 errors
s648727175
p00033
Java
import java.util.Scanner; /** * Created by The Illsionist on 2018/1/6. */ public class AOJ0033 { public static void main(String args[]){ Scanner input = new Scanner(System.in); int N = input.nextInt(); int[] array = new int[10]; int preB = -1,preC = -1; while(N-- > 0){ for(int i = 0;i < 10;i++){ array[i] = input.nextInt(); } if(dfs(preB,preC,0,array)) System.out.println("YES"); else System.out.println("NO"); } } public static boolean dfs(int preB,int preC,int i,int[] array){ if(i == 10) return true; if(array[i] > preB && array[i] < preC){ return dfs(array[i],preC,i + 1,array); }else if(array[i] > preC && array[i] < preB){ return dfs(preB,array[i],i + i,array); }else if(array[i] > preB && array[i] > preC){ return dfs(array[i],preC,i + 1,array) || dfs(preB,array[i],i + i,array); }else return false; } }
Main.java:6: error: class AOJ0033 is public, should be declared in a file named AOJ0033.java public class AOJ0033 { ^ 1 error
s082383825
p00033
Java
import java.util.*;class Main{public static void main(String[]_){Integer i,n,f=0,a[]=new Integer[10];Scanner S=new Scanner(System.in);for(n=S.nextInt();n-->0;System.out.println(f>0?"NO":"YES")){for(i=0;i<10;)a[i++]=S.nextInt();for(f=i=0;i<8;)f+=a[i]<a[i+++2]?0:1;}}}
Main.java:1: error: as of release 9, '_' is a keyword, and may not be used as an identifier import java.util.*;class Main{public static void main(String[]_){Integer i,n,f=0,a[]=new Integer[10];Scanner S=new Scanner(System.in);for(n=S.nextInt();n-->0;System.out.println(f>0?"NO":"YES")){for(i=0;i<10;)a[i++]=S.nextInt();for(f=i=0;i<8;)f+=a[i]<a[i+++2]?0:1;}}} ^ 1 error
s288732189
p00033
Java
import java.util.Scanner; public class Main2 { int[][] arr = new int[10][10]; void run() { Scanner scan = new Scanner(System.in); int n; n = scan.nextInt(); for(int i = 0; i < n; i++) { for(int j = 0; j < 9; j++) { arr[i][j] = scan.nextInt(); } } for(int i = 0; i < n; i++) { int ch; ch = check(arr[i]); if(ch == 1) { System.out.println("YES"); } else { System.out.println("NO"); } } } int check(int[] arr) { int box1 = 0, box2 = 0; for(int i = 0; i < 9; i++) { if(arr[i] > box1) { box1 = arr[i]; } else if(arr[i] > box2) { box2 = arr[i]; } else { return -1; } } return 1; } public static void main(String args[]) { new Main2().run(); } }
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s975211093
p00033
Java
import java.util.Scanner; public class Main2 { int[][] arr = new int[10][10]; void run() { Scanner scan = new Scanner(System.in); int n; n = scan.nextInt(); for(int i = 0; i < n; i++) { for(int j = 0; j < 9; j++) { arr[i][j] = scan.nextInt(); } } for(int i = 0; i < n; i++) { int ch; ch = check(arr[i]); if(ch == 1) { System.out.println("YES"); } else { System.out.println("NO"); } } } int check(int[] arr) { int box1 = 0, box2 = 0; for(int i = 0; i < 9; i++) { if(arr[i] > box1) { box1 = arr[i]; } else if(arr[i] > box2) { box2 = arr[i]; } else { return -1; } } return 1; } public static void main(String args[]) { new Main2().run(); } }
Main.java:3: error: class Main2 is public, should be declared in a file named Main2.java public class Main2 { ^ 1 error
s643550993
p00033
Java
import java.util.*; public class Main { /** * @param args */ static Scanner sc = new Scanner(System.in); static int[] balls; public static void main(String[] args) { // TODO Auto-generated method stub int n = sc.nextInt(); while(n-- > 0) { // read input Queue<Integer> que = new LinkedList<Integer>(); for(int i = 0; i < 10; i++) que.add(sc.nextInt()); int b = 0, c = 0; while(!que.isEmpty()) { int d = que.poll(); if(b < d) { b = d; } else if(c < d) { c = d; } else { break; } } if(que.isEmpty()) { System.out.println("YES"); } else { System.out.println("NO"); } } }
Main.java:35: error: reached end of file while parsing } ^ 1 error
s938468536
p00033
Java
import java.util.ArrayList; import java.util.Scanner; public class Main { private static final int LEFT = 0; private static final int RIGHT = 1; private static final int EndOfDirection = 2; private static ArrayList<Integer> a = new ArrayList<Integer>(10); private static ArrayList<Integer> left = new ArrayList<Integer>(10); private static ArrayList<Integer> right = new ArrayList<Integer>(10); private static ArrayList<String> result = new ArrayList<String>(); private static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int numDataSet = sc.nextInt(); for(int i = 0; i < numDataSet; i++){ pushBallsToA(); if(popBallsAscendingOrder()){ result.add("YES"); } else{ result.add("NO"); } } for(int i = 0; i < result.size(); i++){ System.out.println(result.get(i)); } } public static void setA(ArrayList<Integer> a) { Ball.a = a; } public static void pushBallsToA(){ a.clear(); for(int i = 0; i < 10; i++){ a.add(sc.nextInt()); } } public static boolean popBallsAscendingOrder(){ left.clear(); right.clear(); for(int directionBall1 = LEFT; directionBall1 < EndOfDirection; directionBall1++){ for(int directionBall2 = LEFT; directionBall2 < EndOfDirection; directionBall2++){ for(int directionBall3 = LEFT; directionBall3 < EndOfDirection; directionBall3++){ for(int directionBall4 = LEFT; directionBall4 < EndOfDirection; directionBall4++){ for(int directionBall5 = LEFT; directionBall5 < EndOfDirection; directionBall5++){ for(int directionBall6 = LEFT; directionBall6 < EndOfDirection; directionBall6++){ for(int directionBall7 = LEFT; directionBall7 < EndOfDirection; directionBall7++){ for(int directionBall8 = LEFT; directionBall8 < EndOfDirection; directionBall8++){ for(int directionBall9 = LEFT; directionBall9 < EndOfDirection; directionBall9++){ for(int directionBall10 = LEFT; directionBall10 < EndOfDirection; directionBall10++){ popBall(directionBall1, 0); popBall(directionBall2, 1); popBall(directionBall3, 2); popBall(directionBall4, 3); popBall(directionBall5, 4); popBall(directionBall6, 5); popBall(directionBall7, 6); popBall(directionBall8, 7); popBall(directionBall9, 8); popBall(directionBall10, 9); /* System.out.print("left:"); for(int i = 0; i < left.size(); i++){ System.out.print(left.get(i) + " "); } System.out.println(); System.out.print("right:"); for(int i = 0; i < right.size(); i++){ System.out.print(right.get(i) + " "); } System.out.println(); */ if(isAscendingOrder(left) && isAscendingOrder(right)){ return true; } left.clear(); right.clear(); } } } } } } } } } } return false; } private static void popBall(int direction, int indexBall){ switch(direction){ case LEFT: left.add(a.get(indexBall)); break; case RIGHT: right.add(a.get(indexBall)); break; } } public static boolean isAscendingOrder(ArrayList<Integer> list){ for(int i = 0; i < list.size() - 2; i++){ if(list.get(i) > list.get(i + 1)){ return false; } } return true; } }
Main.java:35: error: cannot find symbol Ball.a = a; ^ symbol: variable Ball location: class Main 1 error
s696793952
p00033
Java
import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) throws java.io.IOException{ Scanner scan = new Scanner(System.in); int [] ball =new int [10]; int n=scan.nextInt(); while(n--){ for(int i=0;i<10;i++)ball[i] = scan.nextInt(); boolean flag =true; Stack <Integer> b =new Stack <Integer>(); Stack <Integer> c =new Stack<Integer>(); int i; for(i=0;i<10;i++){ if(b.peek() > ball[i]){ if(c.peek()>ball[i]){ System.out.println("NO"); flag = false; break; } else {c.push(ball[i]);} } else { if(c.peek() > ball[i]){ b.push(ball[i]);} else { if(ball[i]-b.peek()<ball[i]-c.peek()){ b.push(ball[i]); } else{c.push(ball[i]);} } } }if(flag)System.out.println("YES"); } } }
Main.java:10: error: incompatible types: int cannot be converted to boolean while(n--){ ^ 1 error
s867649025
p00033
Java
import java.io.*; import java.util.*; import java.math.*; public class Main { public static void main(String[] args) throws java.io.IOException{ Scanner scan = new Scanner(System.in); int [] ball =new int [10]; int n=scan.nextInt(); while(n!=0){ for(int i=0;i<10;i++)ball[i] = scan.nextInt(); boolean flag =true; Stack <Integer> b =new Stack <Integer>(); Stack <Integer> c =new Stack<Integer>(); int i; for(i=0;i<10;i++){ if(b.peek() > ball[i]){ if(c.peek()>ball[i]){ System.out.println("NO"); flag = false; break; } else {c.push(ball[i]);} } else { if(c.peek() > ball[i]){ b.push(ball[i]);} else { if(ball[i]-b.peek()<ball[i]-c.peek()){ b.push(ball[i]); } else{c.push(ball[i]);} } }if(flag)System.out.println("YES"); n--; } } }
Main.java:40: error: reached end of file while parsing } ^ 1 error
s594082584
p00033
Java
import java.util.Stack; import java.io.IOException; import java.io.InputStreamReader; import java.io.BufferedReader; public class Ball { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); Stack<Integer> a = new Stack<Integer>(); Stack<Integer> b = new Stack<Integer>(); boolean yes_no; for (int i = 0; i < n; i++) { String s = br.readLine(); a.push(0); b.push(0); yes_no = true; for (int j = 0; j < 10; j++) { int num = Integer.parseInt(s.split(" ")[j]); int subA = num - a.peek(); int subB = num - b.peek(); if(subA < 0 && subB < 0){ yes_no = false; break; } else if (subA > 0 && subB > 0) { if(subA <= subB) a.push(num); else b.push(num); } else if (subB >= subA) b.push(num); else a.push(num); } if(yes_no) System.out.println("YES"); else System.out.println("NO"); } } }
Main.java:6: error: class Ball is public, should be declared in a file named Ball.java public class Ball { ^ 1 error
s833270563
p00033
Java
import java.util.*; public class AOJ0033{ static int ball[]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); ball=new int[10]; for(int i=0;i<n;i++){ for(int j=0;j<10;j++)ball[j]=sc.nextInt(); result = false; dfs(0,0,cnt); if(result)System.out.println("YES"); else System.out.println("NO"); } } static int L=0,R=0,cnt=0; static boolean result; static boolean dfs(int L, int R, int cnt){ if(cnt==10){ result = true; return true; }else{ if(L<ball[cnt])dfs(ball[cnt],R,cnt+1); else if(R<ball[cnt])dfs(L,ball[cnt],cnt+1); return false; } } }
Main.java:2: error: class AOJ0033 is public, should be declared in a file named AOJ0033.java public class AOJ0033{ ^ 1 error
s604287234
p00033
Java
import java.util.Scanner; public class Main1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); for(int i=0; i<N; i++){ int l=0; int r=0; for(int j=0; j<10; j++){ int num = sc.nextInt(); if(l<num){ l=num; }else if(r<num){ r=num; }else{ System.out.println("NO"); break; } if(j==9)System.out.println("YES"); } } } }
Main.java:4: error: class Main1 is public, should be declared in a file named Main1.java public class Main1 { ^ 1 error
s039024656
p00033
C
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<string.h> using namespace std; int main() { int t;scanf("%d",&t); while(t--) { int a[10]; for(int i=0;i<10;i++) scanf("%d",&a[i]); int p=0,q=0,flag=0; for(int i=0;i<10;i++) { if(a[i]>p)p=a[i]; else if(a[i]>q)q=a[i]; else {flag=1;break;} } if(flag)printf("NO\n"); else printf("YES\n"); } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s894346109
p00033
C
#include<stdio.h> #include<string.h> int a[100][11]; int b[100][11],c[100][11]; int flag[100][11]; int by = 0,cy = 0; int lb = 0; int lc = 0; void dfs(int y){ // flag[x][y]=1; if(b[by]<a[y]){ b[++by]=a[y]; ++lb; } else if(c[cy]<a[y]){ c[++cy] = a[y]; ++lc; } ++y; if(y<10) dfs(x,y); } void solve(){ int n; while(cin>>n&&n){ // memset(flag,0,sizeof(flag)); for(int i = 0; i < n; i++) for(int j = 0; j < 10; j++) cin>>a[j]; for(int i = 0; i < n; i++){ dfs(i,0); if(lb+lc==10) printf("YES\n"); else printf("NO\n");} } } int main(){ solve(); return 0; }
main.c: In function 'dfs': main.c:14:16: error: assignment to expression with array type 14 | b[++by]=a[y]; | ^ main.c:18:17: error: assignment to expression with array type 18 | c[++cy] = a[y]; | ^ main.c:23:9: error: 'x' undeclared (first use in this function) 23 | dfs(x,y); | ^ main.c:23:9: note: each undeclared identifier is reported only once for each function it appears in main.c:23:5: error: too many arguments to function 'dfs' 23 | dfs(x,y); | ^~~ main.c:11:6: note: declared here 11 | void dfs(int y){ | ^~~ main.c: In function 'solve': main.c:27:11: error: 'cin' undeclared (first use in this function) 27 | while(cin>>n&&n){ | ^~~ main.c:33:17: error: too many arguments to function 'dfs' 33 | dfs(i,0); | ^~~ main.c:11:6: note: declared here 11 | void dfs(int y){ | ^~~
s762212215
p00033
C
#include<iostream> #include<queue> using namespace std; int main (){ int n; cin>>n; queue <int > p,q; int a[10]; while(n--){ for (int i=0;i<10;i++){ cin>>a[i]; if(!i) p.push(a[i]); if(a[i]<p.back()) q.push(a[i]); else p.push(a[i]); } int t=q.front(),k=0; q.pop(); while(!q.empty()){ if(t>q.front()){ k=1; break; }else { q.pop(); } } if(k) cout<<"NO"<<endl; else cout<<"YES"<<endl; } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s580939674
p00033
C
#include<stdio.h> #include<stack> using namespace std; stack<int> ss; stack<int> s; int main() { int f,t,a,b,i; scanf("%d",&t); while (t--) { f=0; for (i=0;i<10;i++) { scanf("%d",&a); if (i==0) { ss.push(a); } else { b=ss.top(); if (b<a) { ss.push(a); } else { if (s.size()>0) { if (s.top()<a) s.push(a); else { f=1; printf("NO\n"); break; } } else { s.push(a); } } } } if (f==0) { printf("YES\n"); } } }
main.c:2:9: fatal error: stack: No such file or directory 2 | #include<stack> | ^~~~~~~ compilation terminated.
s532459849
p00033
C
#include<iostream> #include<stdio.h> #include<stack> using namespace std; stack<int> ss; stack<int> s; int main() { int f,t,a,b,i; scanf("%d",&t); while (t--) { f=0; for (i=0;i<10;i++) { scanf("%d",&a); if (i==0) { ss.push(a); } else { b=ss.top(); if (b<a) { ss.push(a); } else { if (s.size()>0) { if (s.top()<a) s.push(a); else { f=1; printf("NO\n"); break; } } else { s.push(a); } } } } if (f==0) { printf("YES\n"); } } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s454182106
p00033
C
#include<cstdio> #include<string.h> int x[15],l[15],r[15]; int kase; void dfs(int i,int j,int k) { if(i>10) { kase=1; return; } if(kase) return; if(x[i]>l[j-1]) { l[j]=x[i]; dfs(i+1,j+1,k); } if(x[i]>r[k-1]) { r[k]=x[i]; dfs(i+1,j,k+1); } } int main() { int t; scanf("%d",&t); while(t--) { for(int i=1;i<=10;++i) { scanf("%d",&x[i]); } kase=0; dfs(1,1,1); if(kase) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s906175945
p00033
C
#include<stdio.h> #include<stack> using namespace std; stack<int>ss; stack<int>ss2; int main() { int t,n,a; scanf("%d",&t); while (t--) { n=10; int f=0; while(n--) { scanf("%d",&a); if (ss.empty()) { ss.push(a); } else if (ss.top()<a) { ss.push(a); } else if (ss2.empty()) { ss2.push(a); } else if (ss2.top()<a) { ss2.push(a); } else { f=1; break; } } if (f==1) { printf("NO\n"); } else { printf("YES\n"); } } return 0; }
main.c:2:9: fatal error: stack: No such file or directory 2 | #include<stack> | ^~~~~~~ compilation terminated.
s536576454
p00033
C
#include<stdio.h> int ball[10]; int func(int i,int a,int b); int main(){ int n; scanf("%d",&n); for(i=0;i<n;i++){ for(j=0;j<10;j++){ scanf("%d",&ball[j]); } if(func(0,0,0)){ printf("YES\n"); } else{ printf("NO\n"); } } return 0; } int func(int i,int a,int b){ int ans=0; if(i==10){ ans=1; return; } else if(a<ball[i]){ a=ball[i]; i++; func(i,a,b); } else if(b<ball[i]){ b=ball[i]; i++; func(i,a,b); } return ans; }
main.c: In function 'main': main.c:8:7: error: 'i' undeclared (first use in this function) 8 | for(i=0;i<n;i++){ | ^ main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in main.c:10:9: error: 'j' undeclared (first use in this function) 10 | for(j=0;j<10;j++){ | ^ main.c: In function 'func': main.c:28:5: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch] 28 | return; | ^~~~~~ main.c:24:5: note: declared here 24 | int func(int i,int a,int b){ | ^~~~
s901845710
p00033
C
import java.util.Scanner; public class Main { private static final int N = 12; int[] a = new int[N]; int small = 0; int big = 0; private int s; //数?的个数 public static void main(String[] args) { Main m = new Main(); m.Sort(); } private void Sort(){ Scanner sc = new Scanner(System.in); s = sc.nextInt(); while(s!= 0){ for (int i = 1; i <= 10; i++) { a[i] = sc.nextInt(); } /*for (int m = 1; m <= 10; m++) { System.out.print(a[m]+ " "); }*/ if (a[1] > a[2]) { big = a[1]; small = a[2]; }else { big = a[2]; small = a[1]; } //System.out.println(big); for (int j = 3; j <= 10; j++) { if (a[j] > big) { big = a[j]; } if (a[j] < big && a[j] > small) { small = a[j]; } if (a[j] < small) { System.out.printf("NO\n"); break; } if (j == 10) { System.out.printf("YES\n"); } } //System.out.println(s); s--; } sc.close(); } }
main.c:2:1: error: unknown type name 'import' 2 | import java.util.Scanner; | ^~~~~~ main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 2 | import java.util.Scanner; | ^ main.c:4:1: error: unknown type name 'public' 4 | public class Main { | ^~~~~~ main.c:4:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main' 4 | public class Main { | ^~~~
s287249220
p00033
C
int n, i , j, k; int d[10]; int s; scanf( "%d", &n ); for(i = 0; i < n; i++){ for(j = 0; j < 10; j++){ scanf( "%d", &d[j]); s = 0; for(k = 0; k < j; k++){ if(d[k] > d[j]) s++; } if (s >= 2){ printf( "NO" ); break; } } if(j == 10) printf( "YES" ); putchar('\n'); } return 0; }
main.c:4:12: error: expected declaration specifiers or '...' before string constant 4 | scanf( "%d", &n ); | ^~~~ main.c:4:18: error: expected declaration specifiers or '...' before '&' token 4 | scanf( "%d", &n ); | ^ main.c:5:5: error: expected identifier or '(' before 'for' 5 | for(i = 0; i < n; i++){ | ^~~ main.c:5:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 5 | for(i = 0; i < n; i++){ | ^ main.c:5:24: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 5 | for(i = 0; i < n; i++){ | ^~ main.c:21:5: error: expected identifier or '(' before 'return' 21 | return 0; | ^~~~~~ main.c:22:1: error: expected identifier or '(' before '}' token 22 | } | ^
s848150100
p00033
C
#include <stdio.h> int main() { int n; int i, j; int Ball[10]; int left[10], right[10]; int left_num, right_num; int flag; scanf("%d", &n); for (i = 0; i < n; i++) { for (j = 0; j < 10; j++) scanf("%d", &Ball[j]); for (j = 0; j < 10; j++) { left[j] = 0; right[j] = 0; } left_num = 0; right_num = 0; flag = 1; for (j = 0; j < 10; j++) { if (left_num == 0 || left[left_num - 1] < Ball[j]) { left[left_num] = Ball[j]; left_num++; } else if (right_num == 0 || right[right_num - 1] < Ball[j]) { right[right_num] = Ball[j]; right_num++; } else if { flag = 0; break; } } if (flag) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c: In function 'main': main.c:40:15: error: expected '(' before '{' token 40 | else if { | ^ | (
s458222821
p00033
C
#include <stdio.h> int l[12],r[12],q[12]; bool yon; void dfs(int i,int j,int k){ if(i == 10){ yon = true; return ; } if(q[i] > l[j-1]){ l[j] = q[i]; dfs(i+1,j+1,k); } if(q[i] > r[k-1]){ r[k] = q[i]; dfs(i+1,j,k+1); } } int main() { int t; scanf("%d",&t); while(t--){ for(int i=1;i<=10;i++){ scanf("%d",&q[i]); } yon = false; l[0] = -1; r[0] = -1; dfs(1,1,1); if(yon){ printf("YES\n"); }else{ printf("NO\n"); } } return 0; }
main.c:3:1: error: unknown type name 'bool' 3 | bool yon; | ^~~~ main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' 1 | #include <stdio.h> +++ |+#include <stdbool.h> 2 | int l[12],r[12],q[12]; main.c: In function 'dfs': main.c:6:23: error: 'true' undeclared (first use in this function) 6 | yon = true; | ^~~~ main.c:6:23: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:6:23: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'main': main.c:26:23: error: 'false' undeclared (first use in this function) 26 | yon = false; | ^~~~~ main.c:26:23: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s548224185
p00033
C
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> using namespace std; int a[20]; int b[20],c[20]; int n; bool flag; void dfs(int i,int j,int k) { if(i == 10) { flag = true; return ; } if(flag == true) return ; if(a[i] > c[j - 1]){ /* printf("游街、?\n"); printf("a[i] = %d\n",a[i]); printf("c[j - 1] = %d\n",c[j - 1]);*/ c[j] = a[i]; /* printf("c[j] = %d\n",c[j]); printf("j = %d\n",j); printf("i = %d\n",i);*/ dfs(i + 1,j + 1,k); memset(c,0,sizeof(c)); } printf("\n\n\n\n"); if(a[i] > b[k - 1]){ //printf("a[i] = %d\n",a[i]); // printf("b[k - 1] = %d\n",b[k - 1]); b[k] = a[i]; /* printf("b[k] = %d\n",b[k]); printf("k = %d\n",k); printf("i = %d\n",i);*/ dfs(i + 1,j,k + 1); } // printf("OKOKOK\n\n\n\n"); return ; } int main() { scanf("%d",&n); while(n --) { for(int i = 0; i < 10; i++) scanf("%d",&a[i]); flag = false; memset(b,0,sizeof(b)); memset(c,0,sizeof(c)); dfs(0 , 1, 1); //printf("b[1] = %d\n",b[1]); if(flag == true) printf("YES\n"); else printf("NO\n"); /* for(int i = 0; i <= 10; i++) printf("%d ",c[i]); printf("\n"); for(int i = 0; i <= 10; i++) printf("%d ",b[i]); printf("b[1] = %d\n",b[1]);*/ } return 0; } /* 100 1 2 3 4 8 5 6 7 9 10 */
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s957142347
p00033
C
#include <stdio.h> int main(void) { int a,b,c[10]={0},d,e,f,g,h,i; int e=1; scanf("%d",&a); for (b=0;b<a;b++) { e=1; for (i=0;i<10;i++) { scanf("%d",&f); c[i]=f; } if (e==1) { for (g=1;g<8;g++) { if (c[g-1]<c[g]||c[g-1]<c[g+1]) { e=0; } else { e=1; } } } if (e==0) { printf("Yes\n"); } if (e==1) { printf("NO\n"); } } return 0; }
main.c: In function 'main': main.c:5:13: error: redeclaration of 'e' with no linkage 5 | int e=1; | ^ main.c:4:29: note: previous declaration of 'e' with type 'int' 4 | int a,b,c[10]={0},d,e,f,g,h,i; | ^
s471337058
p00033
C
#include <stdio.h> int main(void) { int a,b,c[10]={0},d,e,f,g,h,i; int e=1; scanf("%d",&a); for (b=0;b<a;b++) { e=1; for (i=0;i<10;i++) { scanf("%d",&f); c[i]=f; } if (e==1) { for (g=1;g<9;g++) { if (c[g-1]<c[g]||c[g-1]<c[g+1]) { e=0; } else { e=1; } } } if (e==0) { printf("Yes\n"); } if (e==1) { printf("NO\n"); } } return 0; }
main.c: In function 'main': main.c:5:13: error: redeclaration of 'e' with no linkage 5 | int e=1; | ^ main.c:4:29: note: previous declaration of 'e' with type 'int' 4 | int a,b,c[10]={0},d,e,f,g,h,i; | ^
s240146649
p00033
C
#include <stdio.h> int main(void) { int a,b,c[10]={0},d,e,f,g,h,i; int e=1; scanf("%d",&a); for (b=0;b<a;b++) { e=1; for (i=0;i<10;i++) { scanf("%d",&f); c[i]=f; } if (e==1) { for (g=1;g<8;g++) { if (c[g-1]<c[g]||c[g-1]<c[g+1]) { e=0; } else { e=1; } } } if (e==0) { printf("Yes\n"); } if (e==1) { printf("NO\n"); } } return 0; }
main.c: In function 'main': main.c:5:13: error: redeclaration of 'e' with no linkage 5 | int e=1; | ^ main.c:4:29: note: previous declaration of 'e' with type 'int' 4 | int a,b,c[10]={0},d,e,f,g,h,i; | ^
s724003486
p00033
C
#include<stdio.h> int main(void) { int n,ball[10],b[10]={0},c[10]={0},i; scanf("%d",&n); for(n0=0;n0<n;n0++){ int p=0,o=0,j=0; for(i=0;i<10;i++){ scanf("%d",&ball[i]); } b[0]=ball[0]; c[0]=0; for(i=1;i<10;i++){ if(b[p]<ball[i]){ p++; b[p]=ball[i]; } else if(c[o-1]<ball[i]&&o>=1||c[o]<ball[i]&&o==0){ c[o]=ball[i]; o++; } else{ j=1; c[o]=ball[i]; o++; } } if(j==0){ printf("YES\n"); } else{ printf("NO\n"); } } return 0; }
main.c: In function 'main': main.c:6:13: error: 'n0' undeclared (first use in this function); did you mean 'n'? 6 | for(n0=0;n0<n;n0++){ | ^~ | n main.c:6:13: note: each undeclared identifier is reported only once for each function it appears in
s648046768
p00033
C
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { int T; while(T--) { int a,b=-1,c=-1; bool X=true; for(int i=0;i<10;i++) { cin>>a; if(X) { if(a>b) { b=a; } else if(a>c) { c=a; } else { X=false; } } } if(X) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } } return 0; } v
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s673210500
p00033
C
#include<cstdio> int main() { int k; scanf("%d",&k); while(k>0) { int last1=-100,last2=-100,flag=0; for(int i=1;i<=10;i++) { int x; scanf("%d",&x); if(x>last1) last1=x; else if(x>last2) last2=x; else { printf("NO\n"); flag=1; break; } } if(flag==0) printf("YES\n"); k--; } return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s504252466
p00033
C
#include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int num[12]; int a[12]; int b[12]; int main() { int n; cin>>n; while(n--) { memset(a,0,sizeof(a)); memset(b,0,sizeof(b)); for(int i=0;i<10;i++) { cin>>num[i]; } a[0]=num[0]; b[0]=num[1]; int k=0; int t=0; int flag=0; for(int i=2;i<10;i++) { if(num[i]>a[k]) { a[k]=num[i]; k++; } else if(num[i]<a[k]&&num[i]>b[t]) { b[t]=num[i]; t++; } else { flag=1; break; } } if(flag) cout<<"NO"<<endl; else cout<<"YES"<<endl; } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s806316712
p00033
C
//Radio Station #include <bits/stdc++.h> using namespace std; int n,m; map<string,string> dic; int main(){ #ifdef LOCAL_DEFINE freopen("rush_in.txt", "r", stdin); #endif ios::sync_with_stdio(0),cin.tie(0); cin >> n >> m; for (int i = 1;i <= n;i++){ string name,ip; cin >> name>>ip; dic[ip] = name; } for (int i = 1;i <= m;i++){ string x,y; cin >> x >> y; cout<<x<<' '<<y; int len = y.size(); y = y.substr(0,len-1); cout<<" #"<<dic[y]<<endl; } return 0; }
main.c:2:10: fatal error: bits/stdc++.h: No such file or directory 2 | #include <bits/stdc++.h> | ^~~~~~~~~~~~~~~ compilation terminated.
s519317765
p00033
C
#include <stdio.h> main(){ int a[10],i,n; scanf("%d",&n); for(i=0,i<n,i++){ scanf("%d%d%d%d%d%d%d%d%d%d",a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]); if(a[0]<a[2]<a[4]<a[6]<a[8]&&a[1]<a[3]<a[5]<a[7]<a[9]) printf("YES"); else printf("NO"); return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:5:18: error: expected ';' before ')' token 5 | for(i=0,i<n,i++){ | ^ | ; main.c:5:18: error: expected expression before ')' token main.c:11:1: error: expected declaration or statement at end of input 11 | } | ^
s291646645
p00033
C
#include <stdio.h> main(){ int a[10],i,n; scanf("%d",&n); for(i=0,i<n,i++){ scanf("%d%d%d%d%d%d%d%d%d%d",a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]); if(a[0]<a[2]<a[4]<a[6]<a[8]&&a[1]<a[3]<a[5]<a[7]<a[9]) printf("YES"); else printf("NO"); } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:5:18: error: expected ';' before ')' token 5 | for(i=0,i<n,i++){ | ^ | ; main.c:5:18: error: expected expression before ')' token
s714317934
p00033
C
#include <stdio.h> main(){ int a[10],i,n; scanf("%d",&n); for(i=0,i<n,i++){ scanf("%d%d%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&a[4],&a[5],&a[6],&a[7],&a[8],&a[9]); if(a[0]<a[2]<a[4]<a[6]<a[8]&&a[1]<a[3]<a[5]<a[7]<a[9]) printf("YES"); else printf("NO"); } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:5:18: error: expected ';' before ')' token 5 | for(i=0,i<n,i++){ | ^ | ; main.c:5:18: error: expected expression before ')' token
s147499584
p00033
C
main(n,i,t,m,c){scanf("%d",&n);while(n--)for(m=99,i=c=0;i++<10;c+=t<m,m=m>t?t:m)scanf("%d",&t);puts(c<3?"YES":"NO"); }exit(0);}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(n,i,t,m,c){scanf("%d",&n);while(n--)for(m=99,i=c=0;i++<10;c+=t<m,m=m>t?t:m)scanf("%d",&t);puts(c<3?"YES":"NO"); | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 't' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'm' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'c' defaults to 'int' [-Wimplicit-int] main.c:1:17: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | main(n,i,t,m,c){scanf("%d",&n);while(n--)for(m=99,i=c=0;i++<10;c+=t<m,m=m>t?t:m)scanf("%d",&t);puts(c<3?"YES":"NO"); | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | main(n,i,t,m,c){scanf("%d",&n);while(n--)for(m=99,i=c=0;i++<10;c+=t<m,m=m>t?t:m)scanf("%d",&t);puts(c<3?"YES":"NO"); main.c:1:17: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | main(n,i,t,m,c){scanf("%d",&n);while(n--)for(m=99,i=c=0;i++<10;c+=t<m,m=m>t?t:m)scanf("%d",&t);puts(c<3?"YES":"NO"); | ^~~~~ main.c:1:17: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:96: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | main(n,i,t,m,c){scanf("%d",&n);while(n--)for(m=99,i=c=0;i++<10;c+=t<m,m=m>t?t:m)scanf("%d",&t);puts(c<3?"YES":"NO"); | ^~~~ main.c:1:96: note: include '<stdio.h>' or provide a declaration of 'puts' main.c: At top level: main.c:2:7: error: expected declaration specifiers or '...' before numeric constant 2 | }exit(0);} | ^ main.c:2:10: error: expected identifier or '(' before '}' token 2 | }exit(0);} | ^
s496558612
p00033
C
i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;}
main.c:1:1: warning: data definition has no type or storage class 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'f' [-Wimplicit-int] 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} | ^ main.c:1:5: error: return type defaults to 'int' [-Wimplicit-int] 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} | ^~~~ main.c: In function 'main': main.c:1:5: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:17: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} | ^~~~ main.c:1:27: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} main.c:1:27: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} | ^~~~~ main.c:1:27: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:54: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | i,f;main(b){for(gets(&b);~scanf("%d",&b);i-10||(f=i/=puts(f?"NO":"YES")))f|=b-++i>2;} | ^~~~ main.c:1:54: note: include '<stdio.h>' or provide a declaration of 'puts'
s078241032
p00033
C
#include<stdio.h> int main() { int ball[10]; int i,j,n,larger,flg; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d %d %d %d %d %d %d % d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); flg=1; larger=0; for(j=0;j<10;j++) { while(ball[j]<larger) { if(ball[j+1]<ball[j]) { flg=0; } j++; } larger=ball[j]; } if(flg) { puts("YES"); } else { puts("NO"); } } return 0; }
main.c: In function 'main': main.c:11:23: warning: missing terminating " character 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^ main.c:11:23: error: missing terminating " character 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:2: warning: missing terminating " character 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ main.c:13:2: error: missing terminating " character 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:1: error: 'd' undeclared (first use in this function) 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in main.c:13:2: error: expected ')' before 'flg' 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ | ) 14 | flg=1; | ~~~ main.c:11:22: note: to match this '(' 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^ main.c:35:18: error: expected ';' before '}' token 35 | } | ^ | ; 36 | } | ~
s703719299
p00033
C
#include<stdio.h> int main() { int ball[10]; int i,j,n,larger,flg; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d %d %d %d %d %d %d % d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); flg=1; larger=0; for(j=0;j<10;j++) { while(ball[j]<larger&&j<8) { if(ball[j+1]!=ball[j]+1&&ball[j+1]<larger) { flg=0; } j++; } larger=ball[j]; } if(flg) { puts("YES"); } else { puts("NO"); } } return 0; }
main.c: In function 'main': main.c:11:23: warning: missing terminating " character 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^ main.c:11:23: error: missing terminating " character 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:2: warning: missing terminating " character 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ main.c:13:2: error: missing terminating " character 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:13:1: error: 'd' undeclared (first use in this function) 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ main.c:13:1: note: each undeclared identifier is reported only once for each function it appears in main.c:13:2: error: expected ')' before 'flg' 13 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ | ) 14 | flg=1; | ~~~ main.c:11:22: note: to match this '(' 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^ main.c:35:18: error: expected ';' before '}' token 35 | } | ^ | ; 36 | } | ~
s468006719
p00033
C
#include<stdio.h> int main() { int ball[10]; int i,j,n,larger,flg; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d %d %d %d %d %d %d %d %d % d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); flg=1; larger=0; for(j=0;j<10;j++) { while(ball[j]<larger&&j<8) { if(ball[j+1]!=ball[j]+1&&ball[j+1]<larger) { flg=0; } j++; } larger=ball[j]; } if(flg) { puts("YES"); } else { puts("NO"); } } return 0; }
main.c: In function 'main': main.c:11:23: warning: missing terminating " character 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^ main.c:11:23: error: missing terminating " character 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:12:2: warning: missing terminating " character 12 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ main.c:12:2: error: missing terminating " character 12 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:12:1: error: 'd' undeclared (first use in this function) 12 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ main.c:12:1: note: each undeclared identifier is reported only once for each function it appears in main.c:12:2: error: expected ')' before 'flg' 12 | d",ball,ball+1,ball+2,ball+3,ball+4,ball+5,ball+6,ball+7,ball+8,ball+9); | ^ | ) 13 | flg=1; | ~~~ main.c:11:22: note: to match this '(' 11 | scanf("%d %d %d %d %d %d %d %d %d % | ^ main.c:34:18: error: expected ';' before '}' token 34 | } | ^ | ; 35 | } | ~
s925718450
p00033
C
a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);}
main.c:1:1: warning: data definition has no type or storage class 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:7: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~ main.c: In function 'main': main.c:1:9: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~~ main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:55: error: lvalue required as left operand of assignment 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:72: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);--i?c>a?a:c>b?b:t=c,i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~ main.c:1:72: note: include '<stdio.h>' or provide a declaration of 'puts'
s546972748
p00033
C
a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);}
main.c:1:1: warning: data definition has no type or storage class 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:7: error: type defaults to 'int' in declaration of 't' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^ main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~ main.c: In function 'main': main.c:1:9: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:23: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} main.c:1:23: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~~ main.c:1:23: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:77: error: implicit declaration of function 'puts' [-Wimplicit-function-declaration] 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ^~~~ main.c:1:77: note: include '<stdio.h>' or provide a declaration of 'puts' main.c:1:96: error: expected ')' before ':' token 1 | a,b,c,t;main(i){for(;~scanf("%d",&c);*(c>a?&a:c>b?&b:&t)=c,!i|i%10||(a=b=t=!puts(t?"NO":"YES")):0);} | ~ ^ | )
s231692178
p00033
C
#include <stdio.h> #define BALLS 10 /* d=0(ツ債カ) =1(ツ右) */ int bin[2][BALLS], p[2]; void push(int d, int n){ bin[d][p[d]++]=n; show(); } int peek(int d){ if(p[d]==0) return 0; else return bin[d][p[d]-1]; } int main(void){ int n, ball, t, i; scanf("%d",&n); for(; n>0; n--){ for(i=0; i<BALLS; i++){ scanf("%d",&ball); if(peek(0)>ball && peek(1)>ball) break; t=(peek(0)>peek(1))?0:1; if(peek(t)<ball) push(t,ball); else push(!t,ball); } if(i==BALLS) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c: In function 'push': main.c:8:44: error: implicit declaration of function 'show' [-Wimplicit-function-declaration] 8 | void push(int d, int n){ bin[d][p[d]++]=n; show(); } | ^~~~
s193183445
p00033
C
#include <stdio.h> #define BALLS 10 /* d=0(ツ債カ) =1(ツ右) */ int bin[2][BALLS], p[2]; void push(int d, int n){ bin[d][p[d]++]=n; show(); } int peek(int d){ if(p[d]==0) return 0; else return bin[d][p[d]-1]; } int main(void){ int n, ball, t, i; scanf("%d",&n); for(; n>0; n--){ for(i=0; i<BALLS; i++){ scanf("%d",&ball); if(peek(0)>ball && peek(1)>ball) break; t=(peek(0)>peek(1))?0:1; if(peek(t)<ball) push(t,ball); else push(!t,ball); } if(i==BALLS) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c: In function 'push': main.c:8:44: error: implicit declaration of function 'show' [-Wimplicit-function-declaration] 8 | void push(int d, int n){ bin[d][p[d]++]=n; show(); } | ^~~~
s884917118
p00033
C
#include <stdio.h> #define BALLS 10 /* d=0(ツ債カ) =1(ツ右) */ int main(void){ int n, ball, top[2]={0,0}, i; scanf("%d",&n); for(; n>0; n--){ for(i=0; i<BALLS; i++){ scanf("%d",&ball); if(top[0]>ball && top[1]>ball) break; t=(top[0]>top[1])?0:1; if(top[t]<ball) top[t]=ball; else top[!t]=ball; } if(i==BALLS) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c: In function 'main': main.c:17:25: error: 't' undeclared (first use in this function) 17 | t=(top[0]>top[1])?0:1; | ^ main.c:17:25: note: each undeclared identifier is reported only once for each function it appears in
s502037466
p00033
C
#include <stdio.h> int main(void){ int n, b[10], top[2]={0,0}, i, t, ok; scanf("%d",&n); for(; n>0; n--){ scanf("%d %d %d %d %d %d %d %d %d %d",&b[0],&b[1],&b[2],&b[3],&b[4],&b[5],&b[6],&b[7],&b[8],&b[9]); for(i=0; i<10; i++){ if(top[0]>ball[i] && top[1]>ball[i]) break; t=(top[0]>top[1])?0:1; if(top[t]<ball) top[t]=ball; else top[!t]=ball; } if(i==10) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c: In function 'main': main.c:11:35: error: 'ball' undeclared (first use in this function) 11 | if(top[0]>ball[i] && top[1]>ball[i]) break; | ^~~~ main.c:11:35: note: each undeclared identifier is reported only once for each function it appears in
s015803307
p00033
C
#include<stdio.h> int main(void) { int ball[10]; int i,j; int B,C; int n,flag; scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n"); } return 0;}
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include<stdio.h> int main(void) { int ball[10]; int i,j; int B,C; int n,flag; | ^~~ main.c:3:7: error: expected declaration specifiers or '...' before string constant 3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n"); | ^~~~ main.c:3:12: error: expected declaration specifiers or '...' before '&' token 3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n"); | ^ main.c:3:17: error: expected identifier or '(' before 'for' 3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n"); | ^~~ main.c:3:26: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n"); | ^ main.c:3:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 3 | scanf("%d",&n); for(i=0;i<n;i++) { flag=1; for(j=0;j<10;j++) { scanf("%d",&ball[j]); } B=C=0; for(j=0;j<10;j++) { if(B<ball[j]) B=ball[j]; else if(C<ball[j]) C=ball[j]; else { flag=0; break; } } if(flag==1) printf("YES\n"); else printf("NO\n"); | ^~ main.c:7:1: error: expected identifier or '(' before 'return' 7 | return 0;} | ^~~~~~ main.c:7:10: error: expected identifier or '(' before '}' token 7 | return 0;} | ^
s022609999
p00033
C
#include<stdio.h> int main() { int x[10]; int b,c,d,e,i,n=0; scanf("%d",&d); while(n<d) { scanf("%d %d %d %d %d %d %d %d %d %d",x,x+1,x+2,x+3,x+4,x+5,x+6,x+7,x+8,x+9); n++; b=0; c=0; e=1; for(i=0;i<10;i++) { if(x[i]>((b<=c)?b:c)) ((b<=c)?b:c)=x[i]; else { e=0; break; } } if(e) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c: In function 'main': main.c:22:45: error: lvalue required as left operand of assignment 22 | ((b<=c)?b:c)=x[i]; | ^
s222588397
p00033
C
#include<stdio.h> int main() { int x[10],y[10]; int b,c,d,e,i,n=0,br; scanf("%d",&d); while(n<d) { scanf("%d %d %d %d %d %d %d %d %d %d",x,x+1,x+2,x+3,x+4,x+5,x+6,x+7,x+8,x+9); br=0; for(i=0;i<10;i++) y[i]=0; for(i=0;i<10;i++) { if(x[i]<1||x[i]>10) { br=1; break; } y[x[i]-1]++; if(y[x[i]-1]>1) { br=1; break; } } if(br) continue; n++; b=0; c=0; e=1; for(i=0;i<10;i++) { if(x[i]>((b>=c)?b:c)) ((b>=c)?b:c)=x[i]; else if(x[i]>((b>c)?c:b)) ((b>c)?c:b)=x[i]; else { e=0; break; } } if(e) printf("YES\n"); else printf("NO\n"); } return 0; }
main.c: In function 'main': main.c:41:45: error: lvalue required as left operand of assignment 41 | ((b>=c)?b:c)=x[i]; | ^ main.c:43:44: error: lvalue required as left operand of assignment 43 | ((b>c)?c:b)=x[i]; | ^
s776900718
p00033
C
#include<stdio.h> int main(){ int i,j,n,x[10][10]={},A,B,a,b,c,d,e,f,g,h,k,l; A=0; B=0; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d %d %d %d %d %d %d",&a,&b,&c,&d,&e,&f,&g,&h,&k,&l); x[i][1]=a; x[i][2]=b; x[i][3]=c; x[i][4]=d; x[i][5]=e; x[i][6]=f; x[i][7]=g; x[i][8]=h; x[i][9]=k; x[i][10]=l; } for(i=0;i<n;i++){ for(j=0;j<10;j++){ if(x[i][j]>A){ A=x[i][j]; } else if(x[i][j]>B){ B=x[i][j]; } else if(x[i][j]<A && x[i][j]<B){ printf("NO\n"); break; } if(j==9){ printf("YES\n"); } } } return 0; } x[7]=g; x[8]=h; x[9]=k; x[10]=l; for(j=0;j<10;j++){ if(x[j]>A){ A=x[j]; } else if(x[j]>B){ B=x[j]; } else if(x[j]<A && x[j]<B){ printf("NO\n"); break; } if(j==9){ printf("OK\n"); } } } return 0; }
main.c:41:9: warning: data definition has no type or storage class 41 | x[7]=g; | ^ main.c:41:9: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] main.c:41:14: error: 'g' undeclared here (not in a function) 41 | x[7]=g; | ^ main.c:42:9: warning: data definition has no type or storage class 42 | x[8]=h; | ^ main.c:42:9: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] main.c:42:9: error: conflicting types for 'x'; have 'int[8]' main.c:41:9: note: previous definition of 'x' with type 'int[7]' 41 | x[7]=g; | ^ main.c:42:14: error: 'h' undeclared here (not in a function) 42 | x[8]=h; | ^ main.c:43:9: warning: data definition has no type or storage class 43 | x[9]=k; | ^ main.c:43:9: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] main.c:43:9: error: conflicting types for 'x'; have 'int[9]' main.c:41:9: note: previous definition of 'x' with type 'int[7]' 41 | x[7]=g; | ^ main.c:43:14: error: 'k' undeclared here (not in a function) 43 | x[9]=k; | ^ main.c:44:9: warning: data definition has no type or storage class 44 | x[10]=l; | ^ main.c:44:9: error: type defaults to 'int' in declaration of 'x' [-Wimplicit-int] main.c:44:9: error: conflicting types for 'x'; have 'int[10]' main.c:41:9: note: previous definition of 'x' with type 'int[7]' 41 | x[7]=g; | ^ main.c:44:15: error: 'l' undeclared here (not in a function) 44 | x[10]=l; | ^ main.c:45:9: error: expected identifier or '(' before 'for' 45 | for(j=0;j<10;j++){ | ^~~ main.c:45:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 45 | for(j=0;j<10;j++){ | ^ main.c:45:23: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token 45 | for(j=0;j<10;j++){ | ^~ main.c:60:9: error: expected identifier or '(' before '}' token 60 | } | ^ main.c:61:9: error: expected identifier or '(' before 'return' 61 | return 0; | ^~~~~~ main.c:62:1: error: expected identifier or '(' before '}' token 62 | } | ^
s514217102
p00033
C
#include <stdio.h> int main( void ) { int i, n, a[ 10 ], bTop, cTop; for ( scanf( "%d", &n ); n--; puts( i != -2 ? "YES" : "NO" ) ) { for ( i = 10; i--; scanf( "%d", a + i ) ); bTop = cTop = 0; for ( i = 10; i-- > 0; a[ i ] > bTop ? bTop = a[ i ] : a[ i ] > cTop ? cTop = a[ i ] : i = -1 ) ; } return 0; }
main.c: In function 'main': main.c:10:106: error: lvalue required as left operand of assignment 10 | for ( i = 10; i-- > 0; a[ i ] > bTop ? bTop = a[ i ] : a[ i ] > cTop ? cTop = a[ i ] : i = -1 ) ; | ^
s046389862
p00033
C
#include<stdio.h> #include<iostream> int main(){ int i,j,a,b,c,d,n,p; scanf("%d",&n); for(i=1;i<=n;i++){ a=-1; b=-1; d=0; for(j=1;j<=10;j++){ scanf("%d",&c); if(a<b){ p=a; a=b; b=p; } if(c>a) a=c; else { if(c>b) b=c; else { printf("NO\n"); d=1; break; } } } if(d==0) printf("YES\n"); } return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s011640408
p00033
C
#include<stdio.h> #include<iostream> int main(){ int i,j,a,b,c,d,n,p; scanf("%d",&n); for(i=1;i<=n;i++){ a=-1; b=-1; d=0; for(j=1;j<=10;j++){ scanf("%d",&c); if(a<b){ p=a; a=b; b=p; } if(c>a) a=c; else { if(c>b) b=c; else { printf("NO\n"); d=1; break; } } } if(d==0) printf("YES\n"); } system("pause"); return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s505245783
p00033
C
#include <iostream> #include <algorithm> using namespace std; int balls[20]; int R, L; bool dfs(int n) { if (n == 10) { return true; } if (R < balls[n]) { R = balls[n]; if (dfs(n+1)) { return true; } } if (L < balls[n]) { L = balls[n]; if (dfs(n+1)) { return true; } } return false; } int main(void) { int N; cin >> N; while (N--) { for (int i = 0; i < 10; i++) { cin >> balls[i]; } R = balls[0]; if (dfs(1)) { cout << "YES" << endl; } else { cout << "NO" << endl; } } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s530078774
p00033
C++
#include <cstdio> #include <algorithm> #include <stack> using namespace std; stack<int> B, C; int A[10]; bool dfs(int index) { bool ret = false; char s[11]; if (index >= 10) { return true; } for (int i = 0; i < 11; i++) { if (i < index) s[i] = '>'; else s[i] = 0; } if (B.empty() || B.top() < A[index]) { B.push(A[index]); // printf("%spush %d into B\n", s, A[index]); ret = dfs(index + 1); // printf("%s%s. pop %d from B\n", s, ret ? "succeeded" : "failed", A[index]); B.pop(); } if (!ret && (C.empty() || C.top() < A[index])) { C.push(A[index]); // printf("%spush %d into C\n", s, A[index]); ret = dfs(index + 1); // printf("%s%s. pop %d from C\n", s, ret ? "succeeded" : "failed", A[index]); C.pop(); } return ret; } bool solve() { while (!B.empty()) B.pop(); while (!C.empty()) C.pop(); B.push(A[0]); bool ret = dfs(1); B.pop(); return ret; } int main() { int N; scor (int j = 0; j < 10; j++) { scanf("%d", A + j); } if (solve()) { printf("Yes\n"); } else { printf("No\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:56:9: error: expected primary-expression before 'int' 56 | scor (int j = 0; j < 10; j++) { | ^~~ a.cc:56:20: error: 'j' was not declared in this scope 56 | scor (int j = 0; j < 10; j++) { | ^ a.cc: At global scope: a.cc:68:3: error: expected unqualified-id before 'return' 68 | return 0; | ^~~~~~ a.cc:69:1: error: expected declaration before '}' token 69 | } | ^
s981302626
p00033
C++
#include <cstdio> #include <algorithm> #include <stack> using namespace std; stack<int> B, C; int A[10]; bool dfs(int index) { bool ret = false; char s[11]; if (index >= 10) { return true; } for (int i = 0; i < 11; i++) { if (i < index) s[i] = '>'; else s[i] = 0; } if (B.empty() || B.top() < A[index]) { B.push(A[index]); // printf("%spush %d into B\n", s, A[index]); ret = dfs(index + 1); // printf("%s%s. pop %d from B\n", s, ret ? "succeeded" : "failed", A[index]); B.pop(); } if (!ret && (C.empty() || C.top() < A[index])) { C.push(A[index]); // printf("%spush %d into C\n", s, A[index]); ret = dfs(index + 1); // printf("%s%s. pop %d from C\n", s, ret ? "succeeded" : "failed", A[index]); C.pop(); } return ret; } bool solve() { while (!B.empty()) B.pop(); while (!C.empty()) C.pop(); B.push(A[0]); bool ret = dfs(1); B.pop(); return ret; } int main() { int N; scor (int j = 0; j < 10; j++) { scanf("%d", A + j); } if (solve()) { printf("Yes\n"); } else { printf("No\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:56:9: error: expected primary-expression before 'int' 56 | scor (int j = 0; j < 10; j++) { | ^~~ a.cc:56:20: error: 'j' was not declared in this scope 56 | scor (int j = 0; j < 10; j++) { | ^ a.cc: At global scope: a.cc:68:3: error: expected unqualified-id before 'return' 68 | return 0; | ^~~~~~ a.cc:69:1: error: expected declaration before '}' token 69 | } | ^
s887628726
p00033
C++
#include <cstdio> #include <algorithm> #include <stack> using namespace std; stack<int> B, C; int A[10]; bool dfs(int index) { bool ret = false; char s[11]; if (index >= 10) { return true; } for (int i = 0; i < 11; i++) { if (i < index) s[i] = '>'; else s[i] = 0; } if (B.empty() || B.top() < A[index]) { B.push(A[index]); // printf("%spush %d into B\n", s, A[index]); ret = dfs(index + 1); // printf("%s%s. pop %d from B\n", s, ret ? "succeeded" : "failed", A[index]); B.pop(); } if (!ret && (C.empty() || C.top() < A[index])) { C.push(A[index]); // printf("%spush %d into C\n", s, A[index]); ret = dfs(index + 1); // printf("%s%s. pop %d from C\n", s, ret ? "succeeded" : "failed", A[index]); C.pop(); } return ret; } bool solve() { while (!B.empty()) B.pop(); while (!C.empty()) C.pop(); B.push(A[0]); bool ret = dfs(1); B.pop(); return ret; } int main() { int N; scor (int j = 0; j < 10; j++) { scanf("%d", A + j); } if (solve()) { printf("Yes\n"); } else { printf("No\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:56:9: error: expected primary-expression before 'int' 56 | scor (int j = 0; j < 10; j++) { | ^~~ a.cc:56:20: error: 'j' was not declared in this scope 56 | scor (int j = 0; j < 10; j++) { | ^ a.cc: At global scope: a.cc:68:3: error: expected unqualified-id before 'return' 68 | return 0; | ^~~~~~ a.cc:69:1: error: expected declaration before '}' token 69 | } | ^
s083253140
p00033
C++
include<cstdio> include<iostream> sing namespace std; nt main() int T; scanf("%d",&T); while(T--) { int n1=0,n2=0,x,jd; for(int i=1;i<=10;++i) { scanf("%d",&x); if(x>n1){n1=x;continue;} if(x>n2){n2=x;continue;} jd=1; } if(jd) puts("NO"); else puts("YES"); }
a.cc:1:1: error: 'include' does not name a type 1 | include<cstdio> | ^~~~~~~ a.cc:4:1: error: 'nt' does not name a type; did you mean 'int'? 4 | nt main() | ^~ | int a.cc:7:9: error: expected constructor, destructor, or type conversion before '(' token 7 | scanf("%d",&T); | ^ a.cc:8:4: error: expected unqualified-id before 'while' 8 | while(T--) | ^~~~~
s986629134
p00033
C++
#include<iostream> using namespace std; int l,r,x,ball[11],le[11],ri[11],ans,n; int dfs(int i,int l,int r){ if(i > 9){ return ans=1; } if(le[l]<ball[i]){ le[++l]=ball[i++]; dfs(i,l,r); } else if(ri[r]<ball[i]){ ri[++r]=ball[i++]; dfs(i,l,r); } else ans=0; } void solve(){ cin>>n; while(n--){ for(int j = 0;j < 10;j++) cin>>ball[i]; ans= 0; dfs(0,0,0); if(ans) cout>>"YES">>endl; else cout>>"NO">>endl; } }
a.cc: In function 'void solve()': a.cc:25:23: error: 'i' was not declared in this scope 25 | cin>>ball[i]; | ^ a.cc:29:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [4]') 29 | cout>>"YES">>endl; | ~~~~^~~~~~~ | | | | | const char [4] | std::ostream {aka std::basic_ostream<char>} In file included from /usr/include/c++/14/string:55, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:29:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout>>"YES">>endl; | ^~~~~ In file included from /usr/include/c++/14/bits/memory_resource.h:38, from /usr/include/c++/14/string:68: /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:29:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 29 | cout>>"YES">>endl; | ^~~~ In file included from /usr/include/c++/14/istream:1109, from /usr/include/c++/14/iostream:42: /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:29:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout>>"YES">>endl; | ^~~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:29:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout>>"YES">>endl; | ^~~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:29:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout>>"YES">>endl; | ^~~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:29:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 29 | cout>>"YES">>endl; | ^~~~~ /usr/include/c++/14/istream:939:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char*)' 939 | operator>>(basic_istream<char, _Traits>& __in, unsigned char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:939:5: note: template argument deduction/substitution failed: a.cc:29:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout>>"YES">>endl; | ^~~~~ /usr/include/c++/14/istream:945:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char*)' 945 | operator>>(basic_istream<char, _Traits>& __in, signed char* __s) | ^~~~~~~~ /usr/include/c++/14/istream:945:5: note: template argument deduction/substitution failed: a.cc:29:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 29 | cout>>"YES">>endl; | ^~~~~ /usr/include/c++/14/istream:1099:5: note: candidate: 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&)' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ /usr/include/c++/14/istream:1099:5: note: template argument deduction/substitution failed: /usr/include/c++/14/istream: In substitution of 'template<class _Istream, class _Tp> _Istream&& std::operator>>(_Istream&&, _Tp&&) [with _Istream = std::basic_ostream<char>&; _Tp = const char (&)[4]]': a.cc:29:19: required from here 29 | cout>>"YES">>endl; | ^~~~~ /usr/include/c++/14/istream:1099:5: error: no type named 'type' in 'struct std::enable_if<false, void>' 1099 | operator>>(_Istream&& __is, _Tp&& __x) | ^~~~~~~~ a.cc:31:17: error: no match for 'operator>>' (operand types are 'std::ostream' {aka 'std::basic_ostream<char>'} and 'const char [3]') 31 | cout>>"NO">>endl; | ~~~~^~~~~~ | | | | | const char [3] | std::ostream {aka std::basic_ostream<char>} /usr/include/c++/14/bits/basic_string.tcc:835:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 835 | operator>>(basic_istream<_CharT, _Traits>& __in, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.tcc:835:5: note: template argument deduction/substitution failed: a.cc:31:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 31 | cout>>"NO">>endl; | ^~~~ /usr/include/c++/14/cstddef:131:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator>>(byte, _IntegerType)' 131 | operator>>(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:131:5: note: template argument deduction/substitution failed: a.cc:31:13: note: cannot convert 'std::cout' (type 'std::ostream' {aka 'std::basic_ostream<char>'}) to type 'std::byte' 31 | cout>>"NO">>endl; | ^~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT&)' 978 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT& __c) | ^~~~~~~~ /usr/include/c++/14/bits/istream.tcc:978:5: note: template argument deduction/substitution failed: a.cc:31:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 31 | cout>>"NO">>endl; | ^~~~ /usr/include/c++/14/istream:849:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, unsigned char&)' 849 | operator>>(basic_istream<char, _Traits>& __in, unsigned char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:849:5: note: template argument deduction/substitution failed: a.cc:31:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 31 | cout>>"NO">>endl; | ^~~~ /usr/include/c++/14/istream:854:5: note: candidate: 'template<class _Traits> std::basic_istream<char, _Traits>& std::operator>>(basic_istream<char, _Traits>&, signed char&)' 854 | operator>>(basic_istream<char, _Traits>& __in, signed char& __c) | ^~~~~~~~ /usr/include/c++/14/istream:854:5: note: template argument deduction/substitution failed: a.cc:31:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<char, _Traits>' 31 | cout>>"NO">>endl; | ^~~~ /usr/include/c++/14/istream:896:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_istream<_CharT, _Traits>& std::operator>>(basic_istream<_CharT, _Traits>&, _CharT*)' 896 | operator>>(basic_istream<_CharT, _Traits>& __in, _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/istream:896:5: note: template argument deduction/substitution failed: a.cc:31:19: note: 'std::ostream' {aka 'std::basic_ostream<char>'} is not derived from 'std::basic_istream<_CharT, _Traits>' 31 | cout>>"NO">>endl; | ^~~~ /usr/include/c+
s287067228
p00033
C++
#include<stdio.h> #include<algorithm> using namespace std; int a[10],left[10],right[10]; void dfs(int i,int l,int r) { if(i>9) { printf("YES\n"); return; } else if(a[i]>left[l-1]) { left[l++]=a[i++]; dfs(i,l,r); } else if(a[i]>right[r-1]) { right[r++]=a[i++]; dfs(i,l,r); } else { printf("NO\n"); return; } } int main() { int t; scanf("%d",&t); while(t--) { memset(a,0,sizeof(a)); memset(left,0,sizeof(left)); memset(right,0,sizeof(right)); for(int i=0;i<10;i++) scanf("%d",&a[i]); dfs(0,1,1); } return 0; }
a.cc: In function 'int main()': a.cc:34:17: error: 'memset' was not declared in this scope 34 | memset(a,0,sizeof(a)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> +++ |+#include <cstring> 3 | using namespace std;
s923223617
p00033
C++
#include<iostream> using namespace std; int main(void){ int a[11],fir,n; int i; cin>>n; while(c--){ int sec = 0; for(i=0;i<10;i++){ cin>>a[i]; } fir=a[0]; for(i=1;i<10;i++){ if(fire<a[i])fir=a[i]; else if(sec<a[i])sec=a[i]; else break; } if(i==10)cout<<"YES"<<endl; else cout<<"NO"<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:15: error: 'c' was not declared in this scope 9 | while(c--){ | ^ a.cc:16:28: error: 'fire' was not declared in this scope; did you mean 'fir'? 16 | if(fire<a[i])fir=a[i]; | ^~~~ | fir
s686049810
p00033
C++
int a[10]; bool dfs(int k, int B, int C){ if(k == 10) return true; if(a[k] > B){ if(dfs(k + 1, a[k], C)) return true; } if(a[k] > C){ if(dfs(k + 1, B, a[k])) return true; } return false; } void solve(){ if(dfs(0, 0, 0)) printf("YES\n"); else printf("NO\n"); } int main(int argc, char const *argv[]){ int t; scanf("%d", &t); while(t --){ for(int i = 0; i < 10; i ++) scanf("%d", &a[i]); solve(); } return 0; }
a.cc: In function 'void solve()': a.cc:18:9: error: 'printf' was not declared in this scope 18 | printf("YES\n"); | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | int a[10]; a.cc:20:9: error: 'printf' was not declared in this scope 20 | printf("NO\n"); | ^~~~~~ a.cc:20:9: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' a.cc: In function 'int main(int, const char**)': a.cc:26:5: error: 'scanf' was not declared in this scope 26 | scanf("%d", &t); | ^~~~~
s117966013
p00033
C++
a
a.cc:1:1: error: 'a' does not name a type 1 | a | ^
s823998276
p00033
C++
def s(a,i,b,c): return b==sorted(b) and c==sorted(c) if i==10 else s(a,i+1,b+[a[i]],c) or s(a,i+1,b,c+[a[i]]) for roop in range(int(raw_input())): print "YES" if s(map(int,raw_input().split()),0,[],[]) else "NO"
a.cc:1:1: error: 'def' does not name a type 1 | def s(a,i,b,c): | ^~~
s869433135
p00033
C++
#include <iostream> using namespace std; int balls[10]; bool dfs(int i=0,int b_top=0,int c_top=0){ //10個のボールを落とせたらtrue if(i == 10) return true; //Bのほうに入れる if(balls[i] > b_top && dfs(i+1,balls[i],c_top)) return true; //Cの方に入れる if(balls[i] > c_top && dfs(i+1,b_top,balls[i])) return true; return false } int main(){ int n; cin >> n; for(int i=0;i<n;i++){ for(int j=0;j<10;j++) cin >> balls[j]; cout << (dfs() ? "YES":"NO") << endl; } return 0; }
a.cc: In function 'bool dfs(int, int, int)': a.cc:18:15: error: expected ';' before '}' token 18 | return false | ^ | ; 19 | } | ~
s593845465
p00033
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; while(n--){ vector<int> v(10); rep(i,10) cin >> v[i]; int a=0, b=0; bool is = true; for(int i=0; i< 10; i++){ if(v[i] < a && v[i] < b){is = false; break;} if(a < b) (b<v[i]?b:a) = v[i]; else (a<v[i]?a:b) = v[i]; } cout << (is?"YES":"NO") << endl; } }
a.cc: In function 'int main()': a.cc:9:13: error: 'i' was not declared in this scope 9 | rep(i,10) cin >> v[i]; | ^ a.cc:9:9: error: 'rep' was not declared in this scope 9 | rep(i,10) cin >> v[i]; | ^~~
s979772584
p00033
C++
#include<iostream> #include<string.h> using namespace std; int N; int balls[10]; void dfs(int n, int a, int b){ if(n==10)return true; if(balls[n]>a) return dfs(n+1,balls[n],b); if(balls[n]>b) return dfs(n+1,a,balls[n]); return false; } int main(){ cin>>N; for(int i=0;i<N;i++){ for(int j=0;j<10;j++){ cin>>balls[j]; } if(dfs(0,0,balls[0]))cout<<"YES"<<endl; else cout<<"NO"<<endl; } }
a.cc: In function 'void dfs(int, int, int)': a.cc:9:17: error: return-statement with a value, in function returning 'void' [-fpermissive] 9 | if(n==10)return true; | ^~~~ a.cc:12:8: error: return-statement with a value, in function returning 'void' [-fpermissive] 12 | return false; | ^~~~~ a.cc: In function 'int main()': a.cc:20:7: error: could not convert 'dfs(0, 0, balls[0])' from 'void' to 'bool' 20 | if(dfs(0,0,balls[0]))cout<<"YES"<<endl; | ~~~^~~~~~~~~~~~~~ | | | void
s118775190
p00033
C++
#include<iostream> using namespace std; int main() { int balls[10]; int out[2][10]; int outCount[2]={0}; int num; cin>>num; while(num!=0){ bool flag=false; int a[10]={0}; for(int i=0;i<10;i++){ cin>>balls[i]; } for(a[0]=0;a[0]<2;a[0]++){ for(a[1]=0;a[1]<2;a[1]++){ for(a[2]=0;a[2]<2;a[2]++){ for(a[3]=0;a[3]<2;a[3]++){ for(a[4]=0;a[4]<2;a[4]++){ for(a[5]=0;a[5]<2;a[5]++){ for(a[6]=0;a[6]<2;a[6]++){ for(a[7]=0;a[7]<2;a[7]++){ for(a[8]=0;a[8]<2;a[8]++){ for(a[9]=0;a[9]<2;a[9]++){ for(int i=0;i<10;i++){ out[a[i]][outCount[a[i]]]=balls[i]; if(out[a[i]][outCount[a[i]]-1]>balls[i]&&outCount[a[i]]!=0){ break; } if(i==9){ count++; flag=true; } outCount[a[i]]++; } for(int i=0;i<10;i++){ out[0][i]=0; out[1][i]=0; } outCount[0]=0; outCount[1]=0; } } } } } } } } } } if(flag){ cout<<"YES"<<endl; } else{ cout<<"NO"<<endl; } num--; } return 0; }
a.cc: In function 'int main()': a.cc:33:57: error: 'count' was not declared in this scope; did you mean 'out'? 33 | count++; | ^~~~~ | out
s590560022
p00033
C++
#include <iostream> #include <cstdio> using namespace std; int main(){ int n,s; cin >> n; for (int i=-; i < n; i++){ int a=0, b=0, flg=0; for (int j = 0; j < 10; j++)}{ cin >> s; if (s > a) a=s; else (s > b) b=s; else flg = 1; } printf("%s\n", flg==0? "YES": "NO"); } }
a.cc: In function 'int main()': a.cc:8:17: error: expected primary-expression before ';' token 8 | for (int i=-; i < n; i++){ | ^ a.cc:10:37: error: expected primary-expression before '}' token 10 | for (int j = 0; j < 10; j++)}{ | ^ a.cc:12:21: error: 'a' was not declared in this scope 12 | if (s > a) a=s; | ^ a.cc:13:23: error: 'b' was not declared in this scope 13 | else (s > b) b=s; | ^ a.cc:14:13: error: 'else' without a previous 'if' 14 | else flg = 1; | ^~~~ a.cc:14:18: error: 'flg' was not declared in this scope 14 | else flg = 1; | ^~~ a.cc:16:24: error: 'flg' was not declared in this scope 16 | printf("%s\n", flg==0? "YES": "NO"); | ^~~ a.cc: At global scope: a.cc:18:1: error: expected declaration before '}' token 18 | } | ^
s661891387
p00033
C++
#include<stdio.h> int main(){ int n[11]={}; int m[11]={},p[11]={}; int N; bool f=true; while(1){ scanf("%d",&N);if(N==0)break; for(int i=0;i<10;i++) scanf("%d",&n[i]); for(int i=0;i<10;i++) if(m[M]<n[i]){M++;m[M]=n[i];} else if(p[P]<n[i]){P++;p[P]=n[i];} else f=false; } if(f=true)printf("YES\n"); else printf("NO\n"); for(int i=0;i<10;i++) {p[i]=0;m[i]=0;} bool f=true; } return 0; }
a.cc: In function 'int main()': a.cc:17:6: error: 'M' was not declared in this scope 17 | if(m[M]<n[i]){M++;m[M]=n[i];} | ^ a.cc:18:11: error: 'P' was not declared in this scope 18 | else if(p[P]<n[i]){P++;p[P]=n[i];} | ^ a.cc:28:6: error: redeclaration of 'bool f' 28 | bool f=true; | ^ a.cc:8:6: note: 'bool f' previously declared here 8 | bool f=true; | ^ a.cc: At global scope: a.cc:32:1: error: expected unqualified-id before 'return' 32 | return 0; | ^~~~~~ a.cc:33:1: error: expected declaration before '}' token 33 | } | ^
s283853032
p00033
C++
#include<stdio.h> int main(){ int n[11]={}; int m[11]={},p[11]={}; int N; int P=0,M=0; bool f=true; while(1){ scanf("%d",&N);if(N==0)break; for(int i=0;i<10;i++) scanf("%d",&n[i]); for(int i=0;i<10;i++) if(m[M]<n[i]){M++;m[M]=n[i];} else if(p[P]<n[i]){P++;p[P]=n[i];} else f=false; } if(f=true)printf("YES\n"); else printf("NO\n"); for(int i=0;i<10;i++) {p[i]=0;m[i]=0;} bool f=true; P=0,M=0; } return 0; }
a.cc: In function 'int main()': a.cc:29:6: error: redeclaration of 'bool f' 29 | bool f=true; | ^ a.cc:9:6: note: 'bool f' previously declared here 9 | bool f=true; | ^ a.cc: At global scope: a.cc:34:1: error: expected unqualified-id before 'return' 34 | return 0; | ^~~~~~ a.cc:35:1: error: expected declaration before '}' token 35 | } | ^
s654421749
p00033
C++
a.cc:1:1: error: '\U0000ff56' does not name a type 1 | v | ^~
s861334626
p00033
C++
#include <iostream> const size = 10; int num[size]; bool dfs(int beforeB, int beforeC, int depth) { if(depth == 10) return true; if(num[depth] > beforeB) return dfs(num[depth], beforeC, depth + 1); else if(num[depth] > beforeC) return dfs(beforeB, num[depth], depth + 1); else return false; } int main() { int n = 0; std::cin >> n; for(int i = 0; i < n; ++i) { for(auto&& x : num) std::cin >> x; std::cout << dfs(0, 0, 0) ? "YES" : "NO" << std::endl; } }
a.cc:3:7: error: 'size' does not name a type; did you mean 'size_t'? 3 | const size = 10; | ^~~~ | size_t a.cc:5:9: error: 'size' was not declared in this scope; did you mean 'std::size'? 5 | int num[size]; | ^~~~ | std::size In file included from /usr/include/c++/14/string:53, from /usr/include/c++/14/bits/locale_classes.h:40, from /usr/include/c++/14/bits/ios_base.h:41, from /usr/include/c++/14/ios:44, from /usr/include/c++/14/ostream:40, from /usr/include/c++/14/iostream:41, from a.cc:1: /usr/include/c++/14/bits/range_access.h:272:5: note: 'std::size' declared here 272 | size(const _Tp (&)[_Nm]) noexcept | ^~~~ a.cc: In function 'bool dfs(int, int, int)': a.cc:11:12: error: 'num' was not declared in this scope; did you mean 'enum'? 11 | if(num[depth] > beforeB) | ^~~ | enum a.cc: In function 'int main()': a.cc:24:32: error: 'num' was not declared in this scope; did you mean 'enum'? 24 | for(auto&& x : num) | ^~~ | enum a.cc:27:58: error: invalid operands of types 'const char [3]' and '<unresolved overloaded function type>' to binary 'operator<<' 27 | std::cout << dfs(0, 0, 0) ? "YES" : "NO" << std::endl; | ~~~~~^~~~~~~~~~~~
s130001794
p00033
C++
#include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int n; cin >> n; for(int q=0; q<n;q++) { vector <int> ball; ball.resize(10); for(int i=0;i<10;i++) cin >> ball[i]; reverse(ball.begin(),ball.end()); int a[10] = {0},b[11] = {0}; a[0] = ball.back(); ball.pop_back(); int ac = 1; int bc = 1; int t,flg = 0; // cout << "t:a:b" << endl; for(int i=0;i<9;i++) { t = ball.back(); ball.pop_back(); // cout << t <<":"<< a[ac-1]<<":" << b[bc-1]<<endl; if(t > a[ac-1] && a[ac-1] >= b[bc-1]) { a[ac] = t; ac++; } else if(t > b[bc-1]) { b[bc] = t; bc++; } else { flg = 1; break; } } if(flg == 0) cout << "YES" << endl; else cout << "NO" << endl; ball.clear(); } return 0; } l.clear(); } return 0; }
a.cc:57:1: error: 'l' does not name a type 57 | l.clear(); | ^ a.cc:59:3: error: expected declaration before '}' token 59 | } | ^ a.cc:61:3: error: expected unqualified-id before 'return' 61 | return 0; | ^~~~~~ a.cc:63:1: error: expected declaration before '}' token 63 | } | ^
s275305829
p00033
C++
#include <iostream> #include <stack> using namespace std; bool Solution() { int n; int left = 0; int right = 0; int a[10]; cin>>n; where(n--) { for (int i = 0; i < 10; i++) { cin>>a[i]; } for (int i = 0; i < 10; i++) { if (a[i] > left) // at the beginning, compare with first ball and the ball before first ball (empty) { left = a[i]; } else if (a[i] > right) { right = a[i]; } else //when can not enter to the both bottles to the end, then return false { return false; } } } } int main() { if (Solution()) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } return 0; }
a.cc: In function 'bool Solution()': a.cc:17:5: error: 'where' was not declared in this scope 17 | where(n--) | ^~~~~ a.cc:40:1: warning: no return statement in function returning non-void [-Wreturn-type] 40 | } | ^
s503399116
p00033
C++
#include <iostream> #include <stack> using namespace std; bool Solution() { int n; int left = 0; int right = 0; int a[10]; cin>>n; where(n--) { for (int i = 0; i < 10; i++) { cin>>a[i]; } for (int i = 0; i < 10; i++) { if (a[i] > left) // at the beginning, compare with first ball and the ball before first ball (empty) { left = a[i]; } else if (a[i] > right) { right = a[i]; } else //when can not enter to the both bottles to the end, then return false { return false; } } return true; } } int main() { if (Solution()) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } return 0; }
a.cc: In function 'bool Solution()': a.cc:17:5: error: 'where' was not declared in this scope 17 | where(n--) | ^~~~~ a.cc:42:1: warning: no return statement in function returning non-void [-Wreturn-type] 42 | } | ^
s981433326
p00033
C++
#include <iostream> #include <stack> using namespace std; bool Solution() { int n; int left = 0; int right = 0; int a[10]; cin>>n; where(n--) { for (int i = 0; i < 10; i++) { cin>>a[i]; } for (int i = 0; i < 10; i++) { if (a[i] > left) // at the beginning, compare with first ball and the ball before first ball (empty) { left = a[i]; } else if (a[i] > right) { right = a[i]; } else //when can not enter to the both bottles to the end, then return false { return false; } } } return true; } int main() { if (Solution()) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } return 0; }
a.cc: In function 'bool Solution()': a.cc:17:5: error: 'where' was not declared in this scope 17 | where(n--) | ^~~~~