submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s034873098
p00023
C++
#include <cstdio.h> #include <algorithm> using namespace std; int main(void) { double xa, ya, ra, xb, yb, rb; int n; scanf("%d", &n); for (int i = 0; i < n; i++){ scanf("%lf %lf %lf %lf %lf %lf", &xa, &ya, &ra, &xb, &yb, &rb); if ((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) <= (ra + rb) * (ra + rb)){ if ((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) + rb * rb <= ra * ra){ printf("2\n"); } else if ((xa - xb) * (xa - xb) + (ya - yb) * (ya - yb) + ra * ra <= rb * rb){ printf("-2\n"); } else printf("1\n"); } else { printf("0\n"); } } return (0); }
a.cc:1:10: fatal error: cstdio.h: No such file or directory 1 | #include <cstdio.h> | ^~~~~~~~~~ compilation terminated.
s446614599
p00024
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine())!=null){ double n=Double.parseDouble(str); int f=(Math.pow(n,2)/98)+2; System.out.println(f); } } }
Main.java:9: error: incompatible types: possible lossy conversion from double to int int f=(Math.pow(n,2)/98)+2; ^ 1 error
s908475380
p00024
Java
import java.io.*; class Main{ public static void main(String[] args){ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String str; while((str=br.readLine())!=null){ double n=Double.parseDouble(str); int f=(int)(Math.pow(n,2)/98)+2; System.out.println(f); } } }
Main.java:7: error: unreported exception IOException; must be caught or declared to be thrown while((str=br.readLine())!=null){ ^ 1 error
s218127614
p00024
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); double min_v; try { while (true) { min_v = scn.nextFloat(); int n = (int)(Math.ceil(min_v*min_v / 98 + 1) + 0.1); System.out.println(n); } catch (Exception e) {} } }
Main.java:6: error: 'catch' without 'try' catch (Exception e) {} ^ Main.java:5: error: 'try' without 'catch', 'finally' or resource declarations try { while (true) { min_v = scn.nextFloat(); int n = (int)(Math.ceil(min_v*min_v / 98 + 1) + 0.1); System.out.println(n); } ^ Main.java:8: error: reached end of file while parsing } ^ 3 errors
s630701959
p00024
Java
import java.util.*; public class Main{ private static final Scanner scan = new Scanner(System.in); public static void main(String[] args){ while(scan.hasNext()){ double v = scan.nextDouble(); double t = v / 9.8; double y = 4.9 * t * t; int N = (y + 5) / 5; System.out.printf("%d\n", N); } } }
Main.java:12: error: incompatible types: possible lossy conversion from double to int int N = (y + 5) / 5; ^ 1 error
s491339233
p00024
Java
import java.util.Scanner; public classツ Math { public static void main(String[] args) { Scanner s = new Scanner(System.in); while(s.hasNext()){ double in = s.nextDouble(); for(int i=2 ; ; i++){ if(Math.sqrt(19.6*5*(i-1))>in){ System.out.println(i); break; } } } } }
Main.java:3: error: illegal character: '\u3000' public class??Math { ^ Main.java:5: error: unnamed classes are a preview feature and are disabled by default. public static void main(String[] args) { ^ (use --enable-preview to enable unnamed classes) Main.java:17: error: class, interface, enum, or record expected } ^ 3 errors
s640087571
p00024
Java
import java.io.*; import java.util.*; import java.math.*; import java.lang.*; public class Main { public static void main(String[] args) throws java.io.IOException{ Scanner scan = new Scanner(System.in); while(scan.hasNext()){ float v = scan.nextFloat(); double t = v / 9.8; double y = 4.9 * Math.pow(t,2); int i=1; while(true){ if(5*(i-1)>=y){System.out.println(i);break;} i++; } } }
Main.java:19: error: reached end of file while parsing } ^ 1 error
s927314916
p00024
Java
import java.io.*; import java.util.*; class Main{ public static void main(String[] args){ BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); try{ String t; while((t = sc.readLine()) != null){ double v = Double.valueOf(t); double p = 1.0 + 1.0/5.0*4.9*(v/9.8)*(v/9.8); double x = (double)((int)p); if(v==0){ System.out.pritnln(2); continue; } if(p==x) System.out.println((int)x); else System.out.println((int)x+1); } }catch(Exception e){ System.out.println("Error"); } } }
Main.java:14: error: cannot find symbol System.out.pritnln(2); ^ symbol: method pritnln(int) location: variable out of type PrintStream 1 error
s732982949
p00024
Java
import java.io.*; import java.util.*; class Main{ public static void main(String[] args){ BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); try{ String t; while((t = sc.readLine()) != null){ double v = Double.valueOf(t); double p = 1.0 + 1.0/5.0*4.9*(v/9.8)*(v/9.8); double x = (double)((int)p); if(v==0.0){ System.out.pritnln(2); continue; } if(p==x) System.out.println((int)x); else System.out.println((int)x+1); } }catch(Exception e){ System.out.println("Error"); } } }
Main.java:14: error: cannot find symbol System.out.pritnln(2); ^ symbol: method pritnln(int) location: variable out of type PrintStream 1 error
s612130352
p00024
Java
gimport java.util.*; import java.io.*; class Main { public static void main(String[] args) { final Scanner stdin = new Scanner(System.in); while ( stdin.hasNextDouble() ) { final double minV = stdin.nextDouble(); final double t = minV / 9.8; final double y = 4.9 * t * t; final int N = (int)Math.ceil( y / 5 + 1 ); System.out.println( N ); } } }
Main.java:1: error: class, interface, enum, or record expected gimport java.util.*; ^ Main.java:2: error: class, interface, enum, or record expected import java.io.*; ^ 2 errors
s941787161
p00024
C
int main(void){ double v; while( scanf("%lf",&v) != EOF){ printf("%d\n",v*v/98+1.999999); } return 0; }
main.c: In function 'main': main.c:4:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | scanf("%lf",&v) != EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:4:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | scanf("%lf",&v) != EOF){ | ^~~~~ main.c:4:1: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:4:20: error: 'EOF' undeclared (first use in this function) 4 | scanf("%lf",&v) != EOF){ | ^~~ main.c:4:20: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:4:20: note: each undeclared identifier is reported only once for each function it appears in main.c:5:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 5 | printf("%d\n",v*v/98+1.999999); | ^~~~~~ main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:5:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'printf'
s874415517
p00024
C
int main(void){ double v; int a; while( scanf("%lf",&v) ,a = (int)v, v != EOF){ printf("%d\n",v*v/98+1.999999); } return 0; }
main.c: In function 'main': main.c:5:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 5 | scanf("%lf",&v) ,a = (int)v, v != EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:5:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 5 | scanf("%lf",&v) ,a = (int)v, v != EOF){ | ^~~~~ main.c:5:1: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:5:35: error: 'EOF' undeclared (first use in this function) 5 | scanf("%lf",&v) ,a = (int)v, v != EOF){ | ^~~ main.c:5:35: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:5:35: note: each undeclared identifier is reported only once for each function it appears in main.c:6:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%d\n",v*v/98+1.999999); | ^~~~~~ main.c:6:1: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:6:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:6:1: note: include '<stdio.h>' or provide a declaration of 'printf'
s168758496
p00024
C
#include<stdio.h> int main(void){ double t, v, y; int N; while ( scanf("%d", &v) != EOF ){ t = v / 9.8; y = t * t; N = ( y + 5 ) / 5; printf("%d\n", N) } return 0; }
main.c: In function 'main': main.c:9:24: error: expected ';' before '}' token 9 | printf("%d\n", N) | ^ | ; 10 | } | ~
s682987066
p00024
C
#include<stdio.h> int main(void){ double t, v, y; int N, Y; while ( scanf("%lf", &v) != EOF ) { t = v / 9.8; y = 4.9 * t * t; y = Y N = ( Y + 5 ) / 5; printf("%d\n", N); } return 0; }
main.c: In function 'main': main.c:8:12: error: expected ';' before 'N' 8 | y = Y | ^ | ; 9 | N = ( Y + 5 ) / 5; | ~
s764124305
p00024
C
import java.util.*;class Main{public static void main(String[]z){for(Scanner s=new Scanner(System.in);s.hasNext();)System.out.println((int)Math.ceil(Math.pow(s.nextDouble(),2)/98+1));}}
main.c:1:1: error: unknown type name 'import' 1 | import java.util.*;class Main{public static void main(String[]z){for(Scanner s=new Scanner(System.in);s.hasNext();)System.out.println((int)Math.ceil(Math.pow(s.nextDouble(),2)/98+1));}} | ^~~~~~ main.c:1:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token 1 | import java.util.*;class Main{public static void main(String[]z){for(Scanner s=new Scanner(System.in);s.hasNext();)System.out.println((int)Math.ceil(Math.pow(s.nextDouble(),2)/98+1));}} | ^ main.c:1:20: error: unknown type name 'class' 1 | import java.util.*;class Main{public static void main(String[]z){for(Scanner s=new Scanner(System.in);s.hasNext();)System.out.println((int)Math.ceil(Math.pow(s.nextDouble(),2)/98+1));}} | ^~~~~ main.c:1:30: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 1 | import java.util.*;class Main{public static void main(String[]z){for(Scanner s=new Scanner(System.in);s.hasNext();)System.out.println((int)Math.ceil(Math.pow(s.nextDouble(),2)/98+1));}} | ^
s784602690
p00024
C
float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;}
main.c:1:9: error: return type defaults to 'int' [-Wimplicit-int] 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ^~~~ main.c: In function 'main': main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ^~~~~ main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:40: error: implicit declaration of function 'ceil' [-Wimplicit-function-declaration] 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ^~~~ main.c:1:1: note: include '<math.h>' or provide a declaration of 'ceil' +++ |+#include <math.h> 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} main.c:1:40: warning: incompatible implicit declaration of built-in function 'ceil' [-Wbuiltin-declaration-mismatch] 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ^~~~ main.c:1:40: note: include '<math.h>' or provide a declaration of 'ceil' main.c:1:55: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ^~~~~~ main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:55: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:78: error: expected ')' before ';' token 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ~ ^ | ) main.c:1:79: error: expected ';' before '}' token 1 | float v;main(){for(;~scanf("%f",&v);)v=ceil(v*v/98)+1,printf("%g\n",v>=10?0:v;} | ^ | ;
s623487264
p00024
C
#include <stdio.h> int main (int argc, const char * argv[]) { float value; double y,t; intn; while (scanf("%f", &value) != EOF) { t = 0.0; n = 0; t = value/9.8; y = 4.9 * t*t; n = (y + 5)/5; printf("%d\n", n+1); } return 0; }
main.c: In function 'main': main.c:6:9: error: 'intn' undeclared (first use in this function); did you mean 'int'? 6 | intn; | ^~~~ | int main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in main.c:10:17: error: 'n' undeclared (first use in this function) 10 | n = 0; | ^
s582120344
p00024
C
#include<stdio.h> int main(){ double v; while(scanf("%lf",&v)!=EOF){ v=v/9.8; v=v*v*4.9+5.0; if(v%5){ printf("%d\n",(int)(v/5+1.0)); }else{ printf("%d\n",(int)(v/5)); } } return 0; }
main.c: In function 'main': main.c:9:7: error: invalid operands to binary % (have 'double' and 'int') 9 | if(v%5){ | ^
s235457037
p00024
C
#include<stdio.h> int main(){ double v; while(scanf("%lf",&v)!=EOF){ v=v/9.8; v=v*v*4.9+5.0; if(v%5){ printf("%d\n",(int)(v/5+1.0)); }else{ printf("%d\n",(int)(v/5)); } } return 0; }
main.c: In function 'main': main.c:9:7: error: invalid operands to binary % (have 'double' and 'int') 9 | if(v%5){ | ^
s014468389
p00024
C
#include <stdio.h> int main() { int n=1,i=0, c=0; float sp[1000], sp2[1000]; while(scanf("%f",&sp[c])!=EOF){ c++; sp2[c] = sp[c]*sp[c]; } for(i=0;i<=c;i++) { n=1 while(1) { if (19.600000*(5*n-5)>=sp2[i]) break; n++; } printf("%d\n",n); } return 0; }
main.c: In function 'main': main.c:11:20: error: expected ';' before 'while' 11 | n=1 | ^ | ; 12 | while(1) { | ~~~~~
s577630827
p00024
C
#include<stdio.h> #include<math.h> /* int main(void){ double x,y,v; int n,t; while(scanf("%lf",&v)!=EOF){ t=(v/9.8); y=4.9*t*t; n=(y/5)+5; printf("%d\n",n); } return 0; } */ int main(void){ double x,y,v; int n,t; while(scanf("%lf",&v)!=EOF){ for(i=1;;i++){ t=sqrt((5*i-5)/4.9); if(9.8*t>=v){ printf("%d\n".i); break; } } } return 0; }
main.c: In function 'main': main.c:28:21: error: 'i' undeclared (first use in this function) 28 | for(i=1;;i++){ | ^ main.c:28:21: note: each undeclared identifier is reported only once for each function it appears in main.c:31:46: error: request for member 'i' in something not a structure or union 31 | printf("%d\n".i); | ^
s024495855
p00024
C
from __future__ import (division, absolute_import, print_function, unicode_literals) from sys import stdin from itertools import count for line in stdin: if not line.strip(): break H = 4.9 * (float(line) / 9.8) ** 2 for N in count(1): if H <= 5 * N - 5: print(N) break
main.c:1:1: error: unknown type name 'from' 1 | from __future__ import (division, absolute_import, print_function, | ^~~~ main.c:1:17: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'import' 1 | from __future__ import (division, absolute_import, print_function, | ^~~~~~
s228064406
p00024
C
int main(void) { float b; int i; while (~scanf("%f",&b)){ b*=b/19.6; i=0; while(++i-1.<in_data/5); printf("%d\n",i); } return (0); }
main.c: In function 'main': main.c:6:13: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while (~scanf("%f",&b)){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(void) main.c:6:13: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while (~scanf("%f",&b)){ | ^~~~~ main.c:6:13: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:9:22: error: 'in_data' undeclared (first use in this function) 9 | while(++i-1.<in_data/5); | ^~~~~~~ main.c:9:22: note: each undeclared identifier is reported only once for each function it appears in main.c:10:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 10 | printf("%d\n",i); | ^~~~~~ main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:10:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:10:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s520758431
p00024
C
#include<stdio.h> #include<math.h> int main(void){ double n; while(scanf("%lf",&n)!=EOF){ n=(n*n)/19.6; (n%5!=0)?printf("%d",n/5):printf("%d",n/5+1); } return 0; }
main.c: In function 'main': main.c:7:11: error: invalid operands to binary % (have 'double' and 'int') 7 | (n%5!=0)?printf("%d",n/5):printf("%d",n/5+1); | ^
s500318356
p00024
C
#include <stdio.h> int main(void) { int i,height[100000]; double value,min_t,just; for(i=0;i<sizeof(height);i++) { height[i] = (5 * i )- 5; } while(scanf_s("%lf",&value) != EOF) { min_t = value / 9.8; just = 4.9*min_t*min_t; for(i=0;i<sizeof(height);i++) { if(just < height[i]) { printf("%d\n",i); break; } } } }
main.c: In function 'main': main.c:13:15: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration] 13 | while(scanf_s("%lf",&value) != EOF) | ^~~~~~~ | scanf
s158523475
p00024
C++
#include <cstdio> using namespace std; int main() { // v = 9.8t y = 4.9t^2 double t,y,x; int n; while(scanf("%lf", &x) != EOF){ t = x / 9.8; y = 4.9 * t * t; n = y; n /= 5; printf("%d\n"n+2); } return(0); }
a.cc: In function 'int main()': a.cc:21:24: error: unable to find string literal operator 'operator""n' with 'const char [4]', 'long unsigned int' arguments 21 | printf("%d\n"n+2); | ^~~~~~~
s093999826
p00024
C++
#include <iostream> using namespace std; int main() { double v; while(cin>>v){ double t = v/9.8; double y = 4.9*t*t; for(int N=1;;N++){ if(5*N-5>=y) break; } cout<<N<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:23: error: 'N' was not declared in this scope 13 | cout<<N<<endl; | ^
s811680619
p00024
C++
#include <iostream> using namespace std; int main(){ double minv; while(cin >> minv){ double t = minv/9.8; double height = 4.9 * t * t; int floar = height/5 + 1; //切り上げ double remainder = height % 5; if(remainder>0) floar++; cout << floar << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:31: error: invalid operands of types 'double' and 'int' to binary 'operator%' 12 | double remainder = height % 5; | ~~~~~~ ^ ~ | | | | double int
s266065325
p00024
C++
#include<iostream> #include<string> using namespace std; int main(){ double n; while(scanf("%lf",&n)!=EOF){ for(int i=1;i<=10009;i++){ int y=i*5-5; double t=sqrt((double)y/4.9); if(t*9.8>=n){cout<<i<<endl;break;} } } return 0; }
a.cc: In function 'int main()': a.cc:9:18: error: 'sqrt' was not declared in this scope 9 | double t=sqrt((double)y/4.9); | ^~~~
s664446601
p00024
C++
#include<iostream> #include<cstdio> using namespace std; int main(){ double n; while(scanf("%lf",&n)!=EOF){ for(int i=1;i<=10009;i++){ int y=i*5-5; double t=sqrt((double)y/4.9); if(t*9.8>=n){cout<<i<<endl;break;} } } return 0; }
a.cc: In function 'int main()': a.cc:9:18: error: 'sqrt' was not declared in this scope 9 | double t=sqrt((double)y/4.9); | ^~~~
s639758711
p00024
C++
#include "stdafx.h" #include <iostream> #include <string> #include <stack> #include <math.h> #include <algorithm> #include <cstdlib> #include <ctime> #include <vector> using namespace std; int main() { double v; double h; int n = 1; while (cin >> v) { h = 4.9*(v / 9.8)*(v / 9.8); while (h > 5 * (n - 1)) { n++; } cout << n << endl; } return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s577910081
p00024
C++
#include "stdafx.h" #include <iostream> #include <string> #include <stack> #include <math.h> #include <algorithm> #include <cstdlib> #include <ctime> #include <vector> using namespace std; int main() { double v; double h; int n = 1; while (cin >> v) { h = 4.9*(v / 9.8)*(v / 9.8); while (h > 5 * (n - 1)) { n++; } cout << n << endl; } return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s328689468
p00024
C++
#include "stdafx.h" #include <iostream> #include <string> #include <stack> #include <math.h> #include <algorithm> #include <cstdlib> #include <ctime> #include <vector> using namespace std; int main() { double v; double h; int n; while (cin >> v) { n = 1; h = 4.9*(v / 9.8)*(v / 9.8); while (h > 5 * (n - 1)) { n++; } cout << n << endl; } return 0; }
a.cc:1:10: fatal error: stdafx.h: No such file or directory 1 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s406472209
p00024
C++
#include<stdio.h> #include<stdlib.h> #include<iostream> #include<string> #include<vector> #include<math.h> #include<queue> #include <algorithm> #include<functional> #include<cstdlib> #include<cmath> #define REP(i, n) for(int i = 0;i < n;i++) #define REPR(i, n) for(int i = n;i >= 0;i--) #define FOR(i, m, n) for(int i = m;i < n;i++) #define FORR(i, m, n) for(int i = m;i >= n;i--) #define CI cin >> #define CO cout << #define E << endl; using namespace std; typedef pair<int, int> P; typedef pair<long, long> LP; typedef pair<int, P> PP; typedef pair<long, LP> LPP; int dy[] = { 0, 0, 1, -1, 0 }; int dx[] = { 1, -1, 0, 0, 0 }; int A = 0, B = 0, K = 0, T = 0, W = 0, N = 0, H = 0; double V = 0; int n = 0; double L = 0; double S = 0; double ar = 0, br = 0, cr = 0; int answer = 0; string C; string sA, strB; vector<vector<char>> map; vector<double> num; vector<string> str; int sum = 0; vector<int> value; vector<int> weight; int dp[110][10010]; int data_[210][2] = { -2 }; void input(void) { return; } int main(void) { double t = 0; double y = 0; double N_ = 0; while (scanf_s("%lf", &V) != EOF) { t = V / 9.8; y = 4.9 * t * t; N_ = (y + 5) / 5; if (N_ == (double)(int)N_) { CO (int)N_ E } else { CO (int)N_ + 1 E } } return 0; }
a.cc: In function 'int main()': a.cc:68:16: error: 'scanf_s' was not declared in this scope; did you mean 'scanf'? 68 | while (scanf_s("%lf", &V) != EOF) { | ^~~~~~~ | scanf
s420658445
p00024
C++
#include <algorithm> #include <vector> #include <math.h> #include <stdio.h> #include <cctype> #include <iostream> #include <set> #include <string> #include <queue> #include <map> using namespace std; int size(string x){ string::size_type size=x.size(); return size; } #define fu(l,k) for(int i=l;i<k;i++) #define fd(l,k) for(int i=l;i>k;i--) #define fi first #define se second typedef vector<string> vs; typedef vector<int> vi; double pi(){ return M_PI; } typedef set<int> set_i; typedef set<string> set_s; int main(){ double n,x,t,h; while(cin>>x){ t=x/9.8; h=4.9*t*t; n=h/5; if(h%5==0) cout<<n-1<<endl; else cout<<n<<endl; } }
a.cc: In function 'int main()': a.cc:33:21: error: invalid operands of types 'double' and 'int' to binary 'operator%' 33 | if(h%5==0) cout<<n-1<<endl; | ~^~ | | | | | int | double
s062185725
p00024
C++
#include <algorithm> #include <vector> #include <math.h> #include <stdio.h> #include <cctype> #include <iostream> #include <set> #include <string> #include <queue> #include <map> using namespace std; int size(string x){ string::size_type size=x.size(); return size; } #define fu(l,k) for(int i=l;i<k;i++) #define fd(l,k) for(int i=l;i>k;i--) #define fi first #define se second typedef vector<string> vs; typedef vector<int> vi; double pi(){ return M_PI; } typedef set<int> set_i; typedef set<string> set_s; int main(){ double n,x,t,h; while(cin>>x){ t=x/9.8; h=4.9*x*x/(9.8*9.8); n=h/5; if(h%5!=0) cout<<(int)n+2<<endl; else cout<<(int)n+1<<endl; } }
a.cc: In function 'int main()': a.cc:33:21: error: invalid operands of types 'double' and 'int' to binary 'operator%' 33 | if(h%5!=0) cout<<(int)n+2<<endl; | ~^~ | | | | | int | double
s582689486
p00024
C++
#include<bits/stdc++.h> #include<vector> #include<list> #include<stack> #include<queue> #include<algorithm> using namespace std; int main(){ int mod=1000000007; int n; int ans; double v; while (scanf("%lf",&v)!=EOF) { for (int i=0;;i++) { double t=v/9.8; double y=t*t*4.9; n=(int)floor((y+5.0)/5.0); for (int j=1;;j++) { if (j*5-5>=y) { break; } tmp+=1; } printf("%d\n",j); } } return 0; }
a.cc: In function 'int main()': a.cc:23:17: error: 'tmp' was not declared in this scope; did you mean 'tm'? 23 | tmp+=1; | ^~~ | tm a.cc:25:27: error: 'j' was not declared in this scope 25 | printf("%d\n",j); | ^
s685809869
p00024
C++
while com != 'submit' or com != 'next' or com != 'done' : com = input()
a.cc:1:22: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes 1 | while com != 'submit' or com != 'next' or com != 'done' : | ^~~~~~~~ a.cc:1:41: warning: multi-character character constant [-Wmultichar] 1 | while com != 'submit' or com != 'next' or com != 'done' : | ^~~~~~ a.cc:1:58: warning: multi-character character constant [-Wmultichar] 1 | while com != 'submit' or com != 'next' or com != 'done' : | ^~~~~~ a.cc:1:9: error: expected unqualified-id before 'while' 1 | while com != 'submit' or com != 'next' or com != 'done' : | ^~~~~
s378872610
p00024
C++
print(".....END.....")
a.cc:1:6: error: expected constructor, destructor, or type conversion before '(' token 1 | print(".....END.....") | ^
s895015231
p00024
C++
#???script?????????????????????????????£???
a.cc:1:2: error: invalid preprocessing directive #? 1 | #???script?????????????????????????????£??? | ^ a.cc:1:40: error: extended character £ is not valid in an identifier 1 | #???script?????????????????????????????£??? | ^
s809043365
p00024
C++
aaaaaaaaaaa
a.cc:1:1: error: 'aaaaaaaaaaa' does not name a type 1 | aaaaaaaaaaa | ^~~~~~~~~~~
s882297358
p00024
C++
aaaaaaaa
a.cc:1:1: error: 'aaaaaaaa' does not name a type 1 | aaaaaaaa | ^~~~~~~~
s787860558
p00024
C++
resetClicked()
a.cc:1:15: error: expected constructor, destructor, or type conversion at end of input 1 | resetClicked() | ^
s818052647
p00024
C++
#include "bits/stdc++.h" using namespace std; int main void{ while(1){ double a; cin >> a; double b = a / (9.8); double c = b*b*(4.9); double i = 1; while(1){ if((5*i-5)>=i) break; i++; } cout << i << endl; } return 0; }
a.cc:4:10: error: expected initializer before 'void' 4 | int main void{ | ^~~~
s478502346
p00024
C++
#include "bits/stdc++.h" using namespace std; int main void{ double a; while(cin >> a){ double b = a / (9.8); double c = b*b*(4.9); double i = 1; while(1){ if((5*i-5)>=i) break; i++; } cout << i << endl; } return 0; }
a.cc:4:10: error: expected initializer before 'void' 4 | int main void{ | ^~~~
s835456742
p00024
C++
import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}}
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:1:37: error: expected ':' before 'static' 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^~~~~~~ | : a.cc:1:55: error: 'String' has not been declared 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^~~~~~ a.cc:1:63: error: expected ',' or '...' before 'g' 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^ a.cc:1:218: error: expected ';' after class definition 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^ | ; a.cc: In static member function 'static void Main::main(int*)': a.cc:1:82: error: 'Scanner' was not declared in this scope 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^~~~~~~ a.cc:1:115: error: 'S' was not declared in this scope 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^ a.cc:1:127: error: 'System' was not declared in this scope 1 | import java.util.*;class Main{public static void main(String[]g){float t,s,v;for(Scanner S=new Scanner(System.in);S.hasNext();System.out.printf("%d\n",(int)(4.9*t*t-5)/5))for(t=0,s=0,v=S.nextFloat();s<=v;t++)s+=9.8;}} | ^~~~~~
s929941094
p00024
C++
#include<iostream> int main() { for (double v_min; std::cin >> v_min;) { double y_min = v_min * v_min / 19.6; int y_ceil = static_cast<int>(ceil(y_min)); int y = y_ceil + (5 - y_ceil % 5) % 5; std::cout << (y + 5) / 5 << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:7:47: error: 'ceil' was not declared in this scope; did you mean 'y_ceil'? 7 | int y_ceil = static_cast<int>(ceil(y_min)); | ^~~~ | y_ceil
s907116029
p00024
C++
#include <bits/stdc++.h> using namespace std; int main(){ double v; while (cin >> v) { double t = v / 9.8; double y = 4.9 * t * t; while (5 * n - 5 < y) { n++; } cout << n << endl; } }
a.cc: In function 'int main()': a.cc:9:16: error: 'n' was not declared in this scope 9 | while (5 * n - 5 < y) { | ^ a.cc:12:14: error: 'n' was not declared in this scope 12 | cout << n << endl; | ^
s140729103
p00024
C++
main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+1.5));}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+1.5));} | ^~~~ a.cc: In function 'int main()': a.cc:1:22: error: 'scanf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+1.5));} | ^~~~~ a.cc:1:37: error: 'printf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+1.5));} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+1.5));}
s407927215
p00024
C++
main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));} | ^~~~ a.cc: In function 'int main()': a.cc:1:22: error: 'scanf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));} | ^~~~~ a.cc:1:37: error: 'printf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));}
s104960762
p00024
C++
main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));} | ^~~~ a.cc: In function 'int main()': a.cc:1:22: error: 'scanf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));} | ^~~~~ a.cc:1:37: error: 'printf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/98+2));}
s812220846
p00024
C++
main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/88+1));}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/88+1));} | ^~~~ a.cc: In function 'int main()': a.cc:1:22: error: 'scanf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/88+1));} | ^~~~~ a.cc:1:37: error: 'printf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/88+1));} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/88+1));}
s011364266
p00024
C++
main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/87+1));}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/87+1));} | ^~~~ a.cc: In function 'int main()': a.cc:1:22: error: 'scanf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/87+1));} | ^~~~~ a.cc:1:37: error: 'printf' was not declared in this scope 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/87+1));} | ^~~~~~ a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>' +++ |+#include <cstdio> 1 | main(){float v;for(;~scanf("%f",&v);printf("%.f\n",v*v/87+1));}
s354198348
p00024
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <stack> #include <queue> #include <cstring> #include <climits> #include <cmath> #include <cfloat> using namespace std; double vn, yn, out, tn; int main() { while( cin >> vn, !cin.eof()) { tn = vn/9.8; yn = 4.9*pow(tn, 2); for( int i = 1; i < INT_MAX; i++) { int f = 0, flr = (float)(i-1)*5; if( flr >= yn ) { cout << i << endl; f = 1; break; } if(f) break; } } return 0; }
a.cc:14:12: error: 'double yn' redeclared as different kind of entity 14 | double vn, yn, out, tn; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:258:1: note: previous declaration 'double yn(int, double)' 258 | __MATHCALL (yn,, (int, _Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:23:20: error: assignment of function 'double yn(int, double)' 23 | yn = 4.9*pow(tn, 2); | ~~~^~~~~~~~~~~~~~~~ a.cc:29:33: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 29 | if( flr >= yn ) | ~~~~^~~~~
s923624588
p00024
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <stack> #include <queue> #include <cstring> #include <climits> #include <cmath> #include <cfloat> using namespace std; double vn, yn, out, tn; int main() { while( cin >> vn, !cin.eof()) { tn = vn/9.8; yn = pow(tn, 2) * 4.9; for( int i = 1; i < INT_MAX; i++) { int f = 0; double flr = (double)(i-1)*5.0; if( flr >= yn ) { cout << i << endl; f = 1; break; } if(f) break; } } return 0; }
a.cc:14:12: error: 'double yn' redeclared as different kind of entity 14 | double vn, yn, out, tn; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:258:1: note: previous declaration 'double yn(int, double)' 258 | __MATHCALL (yn,, (int, _Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:23:20: error: assignment of function 'double yn(int, double)' 23 | yn = pow(tn, 2) * 4.9; | ~~~^~~~~~~~~~~~~~~~~~ a.cc:30:33: error: invalid operands of types 'double' and 'double(int, double) noexcept' to binary 'operator>=' 30 | if( flr >= yn ) | ~~~ ^~ ~~ | | | | double double(int, double) noexcept
s206521845
p00024
C++
#include <iostream> #include <algorithm> #include <string> #include <vector> #include <stack> #include <queue> #include <cstring> #include <climits> #include <cmath> #include <cfloat> using namespace std; double vn, yn, out, tn; int main() { while( cin >> vn, !cin.eof()) { tn = vn/9.8; yn = tn*tn*4.9; for( int i = 1; i < INT_MAX; i++) { int f = 0; double flr = (double)(i-1)*5.0; if( flr >= yn ) { cout << i << endl; f = 1; break; } if(f) break; } } return 0; }
a.cc:14:12: error: 'double yn' redeclared as different kind of entity 14 | double vn, yn, out, tn; | ^~ In file included from /usr/include/features.h:523, from /usr/include/x86_64-linux-gnu/c++/14/bits/os_defines.h:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/c++config.h:683, from /usr/include/c++/14/bits/requires_hosted.h:31, from /usr/include/c++/14/iostream:38, from a.cc:1: /usr/include/x86_64-linux-gnu/bits/mathcalls.h:258:1: note: previous declaration 'double yn(int, double)' 258 | __MATHCALL (yn,, (int, _Mdouble_)); | ^~~~~~~~~~ a.cc: In function 'int main()': a.cc:23:20: error: assignment of function 'double yn(int, double)' 23 | yn = tn*tn*4.9; | ~~~^~~~~~~~~~~ a.cc:30:33: error: invalid operands of types 'double' and 'double(int, double) noexcept' to binary 'operator>=' 30 | if( flr >= yn ) | ~~~ ^~ ~~ | | | | double double(int, double) noexcept
s708530129
p00024
C++
#include<iostream> using namespace std; int main(void){ const double g = 9.8; const double height = 5.0; double v, y; int N; while(cin >> v){ y = (v * v) / (2 * g); N = y / height + 1; if(y % height != 0) N++; cout << N << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:10: error: invalid operands of types 'double' and 'const double' to binary 'operator%' 12 | if(y % height != 0) | ~ ^ ~~~~~~ | | | | | const double | double
s245281190
p00024
C++
#include <stdio.h> int main() {double h;while (scanf("%lf",&h)!=EOF) printf("%d\n",(int)(ceil((((h*h*4.9/9.8)/9.8+5.0)/5.0)+1e-9))); return 0;}
a.cc: In function 'int main()': a.cc:2:71: error: 'ceil' was not declared in this scope 2 | int main() {double h;while (scanf("%lf",&h)!=EOF) printf("%d\n",(int)(ceil((((h*h*4.9/9.8)/9.8+5.0)/5.0)+1e-9))); return 0;} | ^~~~
s098333221
p00024
C++
bool solve(){ double in; while(cin>>in){ int y = 4.9 * (in/9.8) * (in/9.8); int ans = 0; for(int i=1;i<10000;i++){ int h = 5 * (i - 1); if(h > y){ ans = i; break; } } cout<< ans<< endl; } return true; }
a.cc: In function 'bool solve()': a.cc:3:15: error: 'cin' was not declared in this scope; did you mean 'in'? 3 | while(cin>>in){ | ^~~ | in a.cc:13:17: error: 'cout' was not declared in this scope 13 | cout<< ans<< endl; | ^~~~ a.cc:13:30: error: 'endl' was not declared in this scope 13 | cout<< ans<< endl; | ^~~~
s191366509
p00024
C++
#include<iostream> using namespace std; int main(){ double mv; while (cin >> mv) cout << ceil((mv*mv / (9.8f * 2)) / 5 + 1) << endl; }
a.cc: In function 'int main()': a.cc:7:25: error: 'ceil' was not declared in this scope 7 | cout << ceil((mv*mv / (9.8f * 2)) / 5 + 1) << endl; | ^~~~
s580369559
p00024
C++
//include---------------------------------------------------------------------------------------------------------------------- #include <bits/stdc++.h> //using namespace-------------------------------------------------------------------------------------------------------------- using namespace std; //define----------------------------------------------------------------------------------------------------------------------- #define rep(i, n) for(int i = 0; i < n; i++) #define FOR(i, s, n) for(int i = s; i < n; i++) #define per(i, n) for(int i = n; i >= 0; i--) #define ROF(i, s, n) for(int i = s; i >= n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << endl #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define FOREACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i) #define SZ(a) int((a).size()) #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define INF 1 << 25 #define CLR(a) memset((a), 0 ,sizeof(a)) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; #define sq(n) (n) * (n) //typedef---------------------------------------------------------------------------------------------------------------------- typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; typedef unsigned int uint; typedef unsigned long long ull; //const------------------------------------------------------------------------------------------------------------------------ const double EPS = 1e-10; const double PI = acos( -1.0 ); //global----------------------------------------------------------------------------------------------------------------------- double a; double test; //function--------------------------------------------------------------------------------------------------------------------- void main() { while ( scanf( "%lf", &a ) != EOF ) { for ( int i = 1;; i++ ) { test = ( i * 5 - 5 ) / 4.9; test = sqrt( test ); if ( test * 9.8 >= a ) { printf( "%d\n", i ); break; } } } }
a.cc:47:1: error: '::main' must return 'int' 47 | void main() { | ^~~~
s929573804
p00024
C++
//include---------------------------------------------------------------------------------------------------------------------- #include <bits/stdc++.h> //using namespace-------------------------------------------------------------------------------------------------------------- using namespace std; //define----------------------------------------------------------------------------------------------------------------------- #define rep(i, n) for(int i = 0; i < n; i++) #define FOR(i, s, n) for(int i = s; i < n; i++) #define per(i, n) for(int i = n; i >= 0; i--) #define ROF(i, s, n) for(int i = s; i >= n; i--) #define FORIT(i, A) for (auto i : A) #define PRINT(x) cout << (x) << endl #define ALL(a) (a).begin(),(a).end() #define RALL(a) (a).rbegin(), (a).rend() #define PB push_back #define MP make_pair #define FOREACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i) #define SZ(a) int((a).size()) #define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i) #define EXIST(s,e) ((s).find(e)!=(s).end()) #define SORT(c) sort((c).begin(),(c).end()) #define INF 1 << 25 #define CLR(a) memset((a), 0 ,sizeof(a)) #define dump(x) cerr << #x << " = " << (x) << endl; #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; #define sq(n) (n) * (n) //typedef---------------------------------------------------------------------------------------------------------------------- typedef vector<int> VI; typedef vector<VI> VVI; typedef vector<string> VS; typedef pair<int, int> PII; typedef long long LL; typedef unsigned int uint; typedef unsigned long long ull; //const------------------------------------------------------------------------------------------------------------------------ const double EPS = 1e-10; const double PI = acos( -1.0 ); //global----------------------------------------------------------------------------------------------------------------------- double a; double test; //function--------------------------------------------------------------------------------------------------------------------- void main() { while ( scanf( "%lf", &a ) != EOF ) { for ( int i = 2;; i++ ) { test = ( i * 5 - 5 ); test /= 4.9; test = sqrt( test ); if ( test * 9.8 >= a ) { printf( "%d\n", i ); break; } } } }
a.cc:47:1: error: '::main' must return 'int' 47 | void main() { | ^~~~
s292475222
p00024
C++
#include <iostream> using namespace std; int main() { double s; while (cin >> s){ for (int i = 1;; i++){ double h = 5 * i - 5; double v = sqrt(2 * 9.8 * h); if (v >= s){ cout << i << endl; break; } } } return 0; }
a.cc: In function 'int main()': a.cc:11:36: error: 'sqrt' was not declared in this scope 11 | double v = sqrt(2 * 9.8 * h); | ^~~~
s131525367
p00024
C++
// -*- coding: utf-8 -*- // Last-Updated : <2014/06/19 00:36:03 by samui> #include <algorithm> #include <iostream> #include <cstdio> #include <string> #include <vector> #include <climits> #define MP(a, b) make_pair(a, b) #define X first #define Y second #define rep(i,n) for(int (i) = 0; (i) < (int)(n); ++(i)) #define rer(i,l,n) for(int (i) = l; (i) <= (int)(n); ++(i)) #define reu(i,l,n) for(int (i) = l; (i) < (int)(n); ++(i)) template<typename T,typename U> inline void amin(T &x,U y){ if(y<x) x = y;} template<typename T,typename U> inline void amax(T &x,U y){ if(x<y) x = y;} template<typename TYPE,std::size_t SIZE> std::size_t len(const TYPE (&array)[SIZE]){return SIZE;} int main(int argc, char *argv[]) { float a; while(std::cin>>a){ abc(a); } return 0; } int abc(float x) { float t = x/9.8; float y = t*t*4.9;; float ans = int((y+5)/5); float a = (y+5)/5-ans; if(a>0) ans++; std::cout<<ans<<std::endl; return 0; }
a.cc: In function 'int main(int, char**)': a.cc:25:5: error: 'abc' was not declared in this scope; did you mean 'abs'? 25 | abc(a); | ^~~ | abs
s213530077
p00025
Java
import java.util.Scanner; import java.util.TreeSet; public class test{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String st; TreeSet<String> set; while((st = sc.nextLine()) != null){ int hit = 0, blow = 0; set = new TreeSet<String>(); String[] a = st.split(" "); String[] b = sc.nextLine().split(" "); for(int i = 0; i < 4; i++) set.add(a[i]); for(int i = 0; i < 4; i++) if(a[i].equals(b[i])){ hit++; set.remove(a[i]); } for(int i = 0; i < 4; i++) if(set.contains(b[i])) blow++; System.out.println(hit+" "+blow); } } }
Main.java:3: error: class test is public, should be declared in a file named test.java public class test{ ^ 1 error
s951595197
p00025
Java
import java.util.ArrayList; public class A { public static void main (String[] args) { int hit =0; int blow =0; int n = args.length/8; int index =0; for(int i = 0; i < n; i++) { ArrayList<String> a = new ArrayList<String>(); for (int p=0;p<4;p++) {a.add(args[index]);index++;} ArrayList<String> b = new ArrayList<String>(); for (int q=0;q<4;q++) {b.add(args[index]);index++;} int k=0; while (k<a.size()) { if (a.get(k).equals(b.get(k))) { hit++; a.remove(k);b.remove(k); k--; } k++; } if (a.size()!=0) { for (int x=0;x<a.size();x++) { for (int y=0;y<b.size();y++) { if (x==y) continue; if(a.get(x).equals(b.get(y))) blow++; } } } System.out.println(hit+" "+blow); } } }
Main.java:4: error: class A is public, should be declared in a file named A.java public class A ^ 1 error
s883380412
p00025
Java
public static void main (String[] args) { int hit =0; int blow =0; int n = args.length/8; int index =0; for(int i = 0; i < n; i++) { ArrayList<String> a = new ArrayList<String>(); for (int p=0;p<4;p++) {a.add(args[index]);index++;} ArrayList<String> b = new ArrayList<String>(); for (int q=0;q<4;q++) {b.add(args[index]);index++;} int k=0; while (k<a.size()) { if (a.get(k).equals(b.get(k))) { hit++; a.remove(k);b.remove(k); k--; } k++; } if (a.size()!=0) { for (int x=0;x<a.size();x++) { for (int y=0;y<b.size();y++) { if (x==y) continue; if(a.get(x).equals(b.get(y))) blow++; } } } System.out.println(hit+" "+blow); } }
Main.java:1: error: unnamed classes are a preview feature and are disabled by default. public static void main (String[] args) ^ (use --enable-preview to enable unnamed classes) 1 error
s192600415
p00025
Java
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class LeetCode { public static void main(String[] args) { // Set up Scanner in = new Scanner(System.in); // Multiple games while (in.hasNextInt()) { // Read in data to A and B int[] A = new int[4]; int[] B = new int[4]; for (int i = 0; i < 4; i++) { A[i] = in.nextInt(); } for (int i = 0; i < 4; i++) { B[i] = in.nextInt(); } // Populate D int[] D = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; for (int i = 0; i < 4; i++) { if (A[i] != B[i]) { D[A[i]]++; } } // Count results int num_hits = 0; int num_blows = 0; for (int i = 0; i < 4; i++) { if (A[i] == B[i]) { num_hits++; } else if (D[B[i]] == 1) { num_blows++; } } // Print results System.out.println(num_hits + " " + num_blows); } // Done in.close(); } }
Main.java:7: error: class LeetCode is public, should be declared in a file named LeetCode.java public class LeetCode { ^ 1 error
s773399631
p00025
Java
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); while(s.hasNext()){ int[] a = new int[8]; int hit = 0; int blow = 0; for(int i=0 ; i<4 ; i++) a[i] = s.nextInt(); for(int i=0 ; i<4 ; i++){ b[i] = s.nextInt(); if(a[i] == b[i]) hit += 1; } for(int i=0 ; i<4 ; i++){ for(int j=0 ; j<4 ; j++){ if(a[i]==a[j]) blow += 1; } } System.out.println(hit+" "+blow); } } }
Main.java:14: error: cannot find symbol b[i] = s.nextInt(); ^ symbol: variable b location: class Main Main.java:15: error: cannot find symbol if(a[i] == b[i]) ^ symbol: variable b location: class Main 2 errors
s638401558
p00025
Java
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Program{ static int N, D, money; static int[] prices; private static int solve(){ int answer = 0; if (prices[0] * 2 > money) return 0; if (prices[prices.Length - 1] + prices[prices.Length - 2] <= money) return prices[prices.Length - 1] + prices[prices.Length - 2]; for (int i = 0; i < N - 1; i++) { int index = Arrays.binarySearch(prices, i + 1, prices.Length - i - 1, money - prices[i]); if (index > i) return prices[i] + prices[index]; index = ~index - 1; if (index == i) continue; answer = Math.max(prices[i] + prices[index], answer); } return answer; } public static void main(){ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] strs = br.readLine().split(","); N = Integer.parseInt(strs[0]); D = Integer.parseInt(strs[1]); prices = new int[N]; for (int i = 0; i < N; i++) prices[i] = Integer.parseInt(be.readLine()); Arrays.Sort(prices); for (int i = 0; i < D; i++) { money = Integer.parseInt(be.readLine()); System.out.println(solve()); } } }
Main.java:5: error: class Program is public, should be declared in a file named Program.java public class Program{ ^ Main.java:11: error: cannot find symbol if (prices[prices.Length - 1] + prices[prices.Length - 2] <= money) return prices[prices.Length - 1] + prices[prices.Length - 2]; ^ symbol: variable Length location: variable prices of type int[] Main.java:11: error: cannot find symbol if (prices[prices.Length - 1] + prices[prices.Length - 2] <= money) return prices[prices.Length - 1] + prices[prices.Length - 2]; ^ symbol: variable Length location: variable prices of type int[] Main.java:11: error: cannot find symbol if (prices[prices.Length - 1] + prices[prices.Length - 2] <= money) return prices[prices.Length - 1] + prices[prices.Length - 2]; ^ symbol: variable Length location: variable prices of type int[] Main.java:11: error: cannot find symbol if (prices[prices.Length - 1] + prices[prices.Length - 2] <= money) return prices[prices.Length - 1] + prices[prices.Length - 2]; ^ symbol: variable Length location: variable prices of type int[] Main.java:14: error: cannot find symbol int index = Arrays.binarySearch(prices, i + 1, prices.Length - i - 1, money - prices[i]); ^ symbol: variable Length location: variable prices of type int[] Main.java:28: error: cannot find symbol prices[i] = Integer.parseInt(be.readLine()); ^ symbol: variable be location: class Program Main.java:29: error: cannot find symbol Arrays.Sort(prices); ^ symbol: method Sort(int[]) location: class Arrays Main.java:32: error: cannot find symbol money = Integer.parseInt(be.readLine()); ^ symbol: variable be location: class Program 9 errors
s370775640
p00025
C
#include <stdio.h> #include <conio.h> int main(){ int a[4]; int b[4]; int hit,blow; int i,j; while(1){ hit=0; blow=0; if(_kbhit()==0){ break; } scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]); scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]); for(i=0;i<4;i++){ for(j=0;j<4;j++){ if(a[i]==b[j]){ blow++; } } if(a[i]==b[i]){ hit++; } } blow-=hit; printf("%d %d\n",hit,blow); } return 0; }
main.c:2:10: fatal error: conio.h: No such file or directory 2 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s259527582
p00025
C
#include<stdio.h> #include<conio.h> int main(void){ int a[4],b[4] ,i,j; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF) { scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]); int hit=0,blow=0; for(i=0;i<4;i++){ if(a[i]==b[i]){ hit++; } } for(i=0;i<4;i++){ for(j=0;j<4;j++){ if(a[i]==b[j]){ blow++; } } } printf("%d %d\n", hit, blow); } return 0; }
main.c:2:10: fatal error: conio.h: No such file or directory 2 | #include<conio.h> | ^~~~~~~~~ compilation terminated.
s939022075
p00025
C
#include<stdio.h> int main(void){ int a[5],b[5],i,j,hit=0,blow=0; while() for(i=0;i<4;i++)scanf("%d",&a[i]); for(i=0;i<4;i++)scanf("%d",&b[i]); for(i=0;i<4;i++){ if(a[i]==b[i])hit++; for(j=0;j<4;j++){ if(a[i]==b[j] &&a[i]!=b[i])blow++; } } printf("%d%d\n",hit,blow); return 0; }
main.c: In function 'main': main.c:7:15: error: expected expression before ')' token 7 | while() | ^
s166103659
p00025
C
#include <stdio.h> int main(void) { int i, j; int hit = 0, blow = 0; int a[4], b[4]; int count = 0; while (scanf("%d %d %d %d", &a[0], &a[1], &a[2], &a[3]) != EOF){ scanf("%d %d %d %d", &b[0], &b[1], &b[2], &b[3]); count++; for (i = 0; i < 4; i++){ if (a[i] == b[i]){ hit++; } for (j = 0; j < 4; j++){ else if (i != j && a[i] == b[j]){ blow++; } } } printf("%d %d\n", hit, blow); hit = 0;blow = 0; } // your code goes here return 0; }
main.c: In function 'main': main.c:18:33: error: 'else' without a previous 'if' 18 | else if (i != j && a[i] == b[j]){ | ^~~~
s880747681
p00025
C
#include<stdio.h> int main(void){ int d1[4],d2[4]; short flag[4]; int i,j,k,l; int h,b; h = 0; b = 0; scanf(" %d %d %d %d",d1[0],d1[1],d1[2],d1[3]); scanf(" %d %d %d %d",d2[0],d2[1],d2[2],d2[3]); for(i = 0;i < 4;i++){ if(d1[i] == d2[i]){ flag[i] == 1; } } for(i = 0;i < 4;i++){ if(flag[i]==1){ continue; } for(j = 0;j < 4;j++){ if(flag[j]==1){ continue; }else if(d1[i] == d2[f]){ b++; } } } for(i = 0;i < 4;i++){ if(flag[i]==1){ h++; } } printf("%d %d",h,b); return(0); }
main.c: In function 'main': main.c:30:46: error: 'f' undeclared (first use in this function) 30 | }else if(d1[i] == d2[f]){ | ^ main.c:30:46: note: each undeclared identifier is reported only once for each function it appears in
s813550014
p00025
C
#include<iostream> #include<stdio.h> #include<algorithm> using namespace std; int main(){ pair<int,int> p1,p2,p3,p4; int a[4]; int b[4]; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]) != EOF){ int hit = 0; int blow = 0; //scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]); for(int i=0;i<4;i++){ scanf("%d",&b[i]); if(a[i] == b[i]){ hit++; } for(int j=0;j<4;j++){ if(b[i] == a[j] and a[i] != b[i]){ blow++; } } } cout << hit << " " << blow << endl; } return 0; }
main.c:2:9: fatal error: iostream: No such file or directory 2 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s180916115
p00025
C
#include <iostream> #include <cstdio> using namespace std; int main(){ int a[4], b[4]; while (scanf("%d %d %d %d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &b[0], &b[1], &b[2], &b[3])){ int hit = 0; int blow = 0; for (int i = 0; i < 4; i++){ for (int j = 0; j < 4; j++){ if (a[i] == b[j]){ if (i == j) hit++; else blow++; } } } printf("%d %d\n", hit, blow); } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s864490629
p00025
C
#include<stdio.h> int main(void){ int a[100], b[100], i, n, h, b; while(scanf("%d %d %d %d %d %d %d %d", &a[0], &a[1], &a[2], &a[3], &b[0] &b[1], &b[1], &b[2], &b[3]) != 0){ h = 0; b = 0; for(i = 0; i < 4; i++){ if(a[i] == b[i]){ h++; } } for(i = 0; i < 4; i++){ for(l = 0; l < 4; l++){ if(a[i] = b[l]){ b++; } } } printf("%d %d\n", h, b); } return 0; }
main.c: In function 'main': main.c:3:33: error: conflicting types for 'b'; have 'int' 3 | int a[100], b[100], i, n, h, b; | ^ main.c:3:16: note: previous declaration of 'b' with type 'int[100]' 3 | int a[100], b[100], i, n, h, b; | ^ main.c:13:14: error: 'l' undeclared (first use in this function) 13 | for(l = 0; l < 4; l++){ | ^ main.c:13:14: note: each undeclared identifier is reported only once for each function it appears in
s254938008
p00025
C
#nclude <stdio.h> main(){ int a[4],b[4],h=0,v=0,i; while(scanf("%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]) !=EOF){ for(i=0;i<4;i++){ if(a[i]==b[i]) h++; } for(i=0;i<4;i++){ if(a[i]==b[0]||a[i]==b[1]||a[i]==b[2]||a[i]==b[3]) v++; } printf("%d %d\n",h,v); } return 0; }
main.c:1:2: error: invalid preprocessing directive #nclude; did you mean #include? 1 | #nclude <stdio.h> | ^~~~~~ | include main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:4:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 4 | while(scanf("%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]) !=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | #nclude <stdio.h> main.c:4:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 4 | while(scanf("%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]) !=EOF){ | ^~~~~ main.c:4:9: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:4:85: error: 'EOF' undeclared (first use in this function) 4 | while(scanf("%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]) !=EOF){ | ^~~ main.c:4:85: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:4:85: note: each undeclared identifier is reported only once for each function it appears in main.c:11:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 11 | printf("%d %d\n",h,v); | ^~~~~~ main.c:11:5: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:11:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:11:5: note: include '<stdio.h>' or provide a declaration of 'printf'
s690064938
p00025
C
#include <stdio.h> main(){ while(scanf("%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]) !=EOF){ int a[4],b[4],h=0,v=0,i,c[4]; c[0]=11; c[1]=11; c[2]=11; c[3]=11; for(i=0;i<4;i++){ if(a[i]==b[i]){ h++; c[i]=a[i]; } } for(i=0;i<4;i++){ if((a[i]==b[0]||a[i]==b[1]||a[i]==b[2]||a[i]==b[3])&&a[i]!=c[i]) v++; } printf("%d %d\n",h,v); } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:3:35: error: 'a' undeclared (first use in this function) 3 | while(scanf("%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]) !=EOF){ | ^ main.c:3:35: note: each undeclared identifier is reported only once for each function it appears in main.c:3:59: error: 'b' undeclared (first use in this function) 3 | while(scanf("%d%d%d%d%d%d%d%d",&a[0],&a[1],&a[2],&a[3],&b[0],&b[1],&b[2],&b[3]) !=EOF){ | ^
s686059962
p00025
C
h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];}
main.c:1:1: warning: data definition has no type or storage class 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'h' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^ main.c:1:5: error: type defaults to 'int' in declaration of 'v' [-Wimplicit-int] 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^ main.c:1:9: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int] 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^ main.c:1:11: error: return type defaults to 'int' [-Wimplicit-int] 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^~~~ main.c: In function 'main': main.c:1:11: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:25: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} main.c:1:25: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^~~~~ main.c:1:25: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:50: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^~~~~~ main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:50: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:50: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:101: error: lvalue required as left operand of assignment 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^~ main.c: At top level: main.c:1:5: warning: array 'v' assumed to have one element 1 | h,b,v[],n;main(i){for(;~scanf("%d",v+n%8);++n%8||printf("%d %d\n",h,b))for(h=b=0,i=16;i--;)(i%5?b:h)+=v[i%4]==v[4+i/4];} | ^
s629512892
p00025
C
#include<stdio.h> int main(){ int im[4],bl[4],i,hit,blow,j; while(scanf("%d %d %d %d",im,im+1,im+2,im+3)!=EOF){ scanf("%d %d %d %d",bl,bl+1,bl+2,bl+3); for(hit=0,blow=0,i=0;i<4;i++){ if(im[i]==bl[i]) hit++; for(j=0;j<4;j++) if(i!=j&&im[i]==bl[j]) blow++; printf("%d %d\n",hit,blow); } return 0; }
main.c: In function 'main': main.c:16:1: error: expected declaration or statement at end of input 16 | } | ^
s597687917
p00025
C
#include<stdio.h> int main() { int i,j,a[4],b[4],hit=0,blow=0; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF | scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3])!=EOF) { for(i=0;i<4;i++) { if(a[i]==b[i]) hit++; } for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(a[i]==b[j]) blow++; } } blow = blow -hit; printf("%d %d\n",hit,blow); blow = hit = 0; } }
main.c:1:21: warning: extra tokens at end of #include directive 1 | #include<stdio.h> int main() { int i,j,a[4],b[4],hit=0,blow=0; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF | scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3])!=EOF) { for(i=0;i<4;i++) { if(a[i]==b[i]) hit++; } for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(a[i]==b[j]) blow++; } } blow = blow -hit; printf("%d %d\n",hit,blow); blow = hit = 0; } } | ^~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s840382341
p00025
C
#include <cstdio> #include <cstring> #include <algorithm> #include <iostream> #include <cmath> using namespace std; int main() { //freopen("1.in","r",stdin); int a[4],b[4],H,B; while(~scanf("%d",a)) { H=B=0; scanf("%d %d %d",a+1,a+2,a+3); scanf("%d %d %d %d",b,b+1,b+2,b+3); for(int i=0;i<4;i++) { for(int j=0;j<4;j++) { if(b[i]==a[j]) { if(i==j) {H++;break;} else {B++;break;} } } } printf("%d %d\n",H,B); } return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s693724185
p00025
C
#include<stdio.h> int main() { int a[4], b[4], g, h, i, n, m, hit, blow; hit = 0; blow = 0; for(g = 0; g < 4; g += 1) { scanf("%d", &a[g]); }; for(h = 0; h < 4; h += 1) { scanf("%d", &b[gh); }; for(n = 0; n < 4; n += 1) { for(m = 0; m < 4; m += 1) { if(n == m && a[n] == b[m]){ hit += 1; } else if( n != m && a[n] == b[m]) { blow += 1; }; }; }; printf("%d %d\n", hit, blow); return 0; }
main.c: In function 'main': main.c:13:20: error: 'gh' undeclared (first use in this function); did you mean 'h'? 13 | scanf("%d", &b[gh); | ^~ | h main.c:13:20: note: each undeclared identifier is reported only once for each function it appears in main.c:13:22: error: expected ']' before ')' token 13 | scanf("%d", &b[gh); | ^ | ]
s902381347
p00025
C
#include<stdio.h> int main() { int a[4], b[4], g, h, i, n, m, hit, blow; hit = 0; blow = 0; while(scanf("%d", &a[0]) != EOF) { for(g = 1; g < 4; g += 1) { scanf("%d", &a[g]); }; for(h = 0; h < 4; h += 1) { scanf("%d", &b[h]); }; for(n = 0; n < 4; n += 1) { for(m = 0; m < 4; m += 1) { if(a[n] == b[m)]{ if(n == m) { hit += 1; } else { blow += 1; }; }; }; }; printf("%d %d\n", hit, blow); }; return 0; }
main.c: In function 'main': main.c:18:23: error: expected ']' before ')' token 18 | if(a[n] == b[m)]{ | ^ | ] main.c:18:24: error: expected statement before ']' token 18 | if(a[n] == b[m)]{ | ^
s858650362
p00025
C
#include<stdio.h> int main() { int a[4], b[4], g, h, i, n, m, hit, blow; hit = 0; blow = 0; while(scanf("%d", &a[0]) != EOF) { for(g = 1; g < 4; g += 1) { scanf("%d", &a[g]); }; for(h = 0; h < 4; h += 1) { scanf("%d", &b[h]); }; for(n = 0; n < 4; n += 1) { for(m = 0; m < 4; m += 1) { if(a[n] == b[m]{ if(n == m) { hit += 1; } else { blow += 1; }; }; }; }; printf("%d %d\n", hit, blow); }; return 0; }
main.c: In function 'main': main.c:18:24: error: expected ')' before '{' token 18 | if(a[n] == b[m]{ | ~ ^ | ) main.c:25:7: error: expected expression before '}' token 25 | }; | ^
s421407112
p00025
C
#include <stdio.h> void input_int(int a[], int b[]); int main(void) { int a[4], b[4]; int hit, blow; int i, j; while (1){ if (a[0] == EOF){ break; } hit = blow = 0; input_int(a, b); for (j = ; j < 4; j++){ if (b[i] == a[j] && i == j){ hit++; } else if (b[i] == a[j]){ blow++; } } } printf("%d %d\n", hit, blow); } return (0); } void input_int(int a[], int b[]) { int i; for (i = 1; i <= 4; i++){ scanf("%d", &a[i]); } for (i = 0; i < 4; i++){ scanf("%d", &b[i]); } }
main.c: In function 'main': main.c:19:34: error: expected expression before ';' token 19 | for (j = ; j < 4; j++){ | ^ main.c: At top level: main.c:31:9: error: expected identifier or '(' before 'return' 31 | return (0); | ^~~~~~ main.c:32:1: error: expected identifier or '(' before '}' token 32 | } | ^
s285998124
p00025
C
#include <stdio.h> int main(void){ int a[4],b[4]; int i; int h,b; while( scanf("%d",&a[0]) != EOF){ h=0; b=0; for(i=1; i<4; i++){ scanf("%d",&a[i]); } for(i=0; i<4; i++){ scanf("%d",&b[i]); } for(i=0;i<4;i++){ if(a[i] == b[i]) h++; if(a[i] == b[(i+1)%4]||a[i] == b[(i+2)%4]||a[i] == b[(i+3)%4]) b++; } printf("%d %d\n",h,b); } return 0; }
main.c: In function 'main': main.c:6:9: error: conflicting types for 'b'; have 'int' 6 | int h,b; | ^ main.c:4:12: note: previous declaration of 'b' with type 'int[4]' 4 | int a[4],b[4]; | ^
s925273896
p00025
C
#include <stdio.h> int main(void){ int a[4]; int b[4]; int i; int h,b; while( scanf("%d",&a[0]) != EOF){ h=0; b=0; for(i=1; i<4; i++){ scanf("%d",&a[i]); } for(i=0; i<4; i++){ scanf("%d",&b[i]); } for(i=0;i<4;i++){ if(a[i] == b[i]) h++; if(a[i] == b[(i+1)%4]||a[i] == b[(i+2)%4]||a[i] == b[(i+3)%4]) b++; } printf("%d %d\n",h,b); } return 0; }
main.c: In function 'main': main.c:7:9: error: conflicting types for 'b'; have 'int' 7 | int h,b; | ^ main.c:5:7: note: previous declaration of 'b' with type 'int[4]' 5 | int b[4]; | ^
s174721767
p00025
C
#include <stdio.h> int main(void){ int a[4]; int b[4]; int i,j,k,l; int h,b; while( scanf("%d",&a[0]) != EOF){ h=0; b=0; for(i=1; i<4; i++){ scanf("%d",&a[i]); } for(i=0; i<4; i++){ scanf("%d",&b[i]); } for(i=0;i<4;i++){ if(a[i] == b[i]) h++; j=(i+1)%4; k=(i+2)%4; l=(i+3)%4; if(a[i] == b[j]||a[i] == b[k]||a[i] == b[(l)%4]) b++; } printf("%d %d\n",h,b); } return 0; }
main.c: In function 'main': main.c:7:9: error: conflicting types for 'b'; have 'int' 7 | int h,b; | ^ main.c:5:7: note: previous declaration of 'b' with type 'int[4]' 5 | int b[4]; | ^
s177206022
p00025
C
#include <cstdio> int main(){ int a[4], b[4]; while(~scanf("%d %d %d %d\n%d %d %d %d\n", &a[0], &a[1], &a[2], &a[3], &b[0], &b[1], &b[2], &b[3])){ int hit = 0, blow = 0; for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) if(a[i] == b[j]) if(i == j) hit++; else blow++; printf("%d %d\n", hit, blow); } return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s212422863
p00025
C
#include <stdio.h> int main(){ int a[4], b[4]; while(~scanf("%d %d %d %d\n%d %d %d %d\n", &a[0], &a[1], &a[2], &a[3], &b[0], &b[1], &b[2], &b[3])){ int hit = 0, blow = 0; for(int i = 0; i < 4; i++){ for(int j = 0; j < 4; j++){ if(a[i] == b[j]) if(i == j){ hit++ }else{ blow++; } } } printf("%d %d\n", hit, blow); } return 0; }
main.c: In function 'main': main.c:11:30: error: expected ';' before '}' token 11 | hit++ | ^ | ; 12 | }else{ | ~
s436250011
p00025
C
#include <stdio.h> int main(){ int a[4], b[4], i, j; while(~scanf("%d %d %d %d\n%d %d %d %d\n", &a[0], &a[1], &a[2], &a[3], &b[0], &b[1], &b[2], &b[3])){ int hit = 0, blow = 0; for(i = 0; i < 4; i++){ for(j = 0; j < 4; j++){ if(a[i] == b[j]) if(i == j){ hit++ }else{ blow++; } } } printf("%d %d\n", hit, blow); } return 0; }
main.c: In function 'main': main.c:11:30: error: expected ';' before '}' token 11 | hit++ | ^ | ; 12 | }else{ | ~
s953427960
p00025
C
#include <stdio.h> int main(void) { int a[4],b[4],i,j; int hit,blow; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF) { scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]); hit=0; blow=0; for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(i==j) { if(a[i]==b[j]) { hit++; } } else { if(a[i]==b[j]) { blow++; } } } } printf("%d %d\n"hit,blow); } }
main.c: In function 'main': main.c:35:33: error: expected ')' before 'hit' 35 | printf("%d %d\n"hit,blow); | ~ ^~~ | )
s437450699
p00025
C
#include <stdio.h> int main(void) { int a[4],b[4],i,j; int hit,blow; while(scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3])!=EOF) { scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]); hit=0; blow=0; for(i=0;i<4;i++) { for(j=0;j<4;j++) { if(i==j) { if(a[i]==b[j]) { hit++; } } else { if(a[i]==b[j]) { blow++; } } } } printf("%d %d\n"hit,blow); } return 0; }
main.c: In function 'main': main.c:35:33: error: expected ')' before 'hit' 35 | printf("%d %d\n"hit,blow); | ~ ^~~ | )
s354986026
p00025
C
int main(){ int array[4][2] = {0}; int hit = 0; int blow = 0; int i, j; while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ scanf("%d %d %d %d",&array[0][1],&array[1][1],&array[2][1],&array[3][1]); hit = 0; blow = 0; for (i = 0; i < 4; i++){ if (array[i][0] == array[i][1]) { hit++; } } for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { if (array[i][0] == array[j][1]) { if (array[i][0] != array[i][1]) { blow++; } } } } printf("%d %d\n",hit,blow); } return 0; }
main.c: In function 'main': main.c:6:12: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){ main.c:6:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ | ^~~~~ main.c:6:12: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:86: error: 'EOF' undeclared (first use in this function) 6 | while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ | ^~~ main.c:6:86: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:86: note: each undeclared identifier is reported only once for each function it appears in main.c:24:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 24 | printf("%d %d\n",hit,blow); | ^~~~~~ main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:24:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s424737346
p00025
C
int main(){ int array[4][2] = {0}; int hit = 0; int blow = 0; int i, j; while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ scanf("%d %d %d %d",&array[0][1],&array[1][1],&array[2][1],&array[3][1]); hit = 0; blow = 0; for (i = 0; i < 4; i++){ if (array[i][0] == array[i][1]) { hit++; } } for (i = 0; i < 4; i++) { for (j = 0; j < 4; j++) { if (array[i][0] == array[j][1]) { if (array[i][0] != array[i][1]) { blow++; } } } } printf("%d %d\n",hit,blow); } return 0; }
main.c: In function 'main': main.c:6:12: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 6 | while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | int main(){ main.c:6:12: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 6 | while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ | ^~~~~ main.c:6:12: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:6:86: error: 'EOF' undeclared (first use in this function) 6 | while (scanf("%d %d %d %d",&array[0][0],&array[1][0],&array[2][0],&array[3][0])!=EOF){ | ^~~ main.c:6:86: note: 'EOF' is defined in header '<stdio.h>'; this is probably fixable by adding '#include <stdio.h>' main.c:6:86: note: each undeclared identifier is reported only once for each function it appears in main.c:24:9: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 24 | printf("%d %d\n",hit,blow); | ^~~~~~ main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:24:9: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:24:9: note: include '<stdio.h>' or provide a declaration of 'printf'
s169302857
p00025
C++
#include <iostream> #include <array> #include <algorithm> int main(){ int a1, a2, a3, a4, b1, b2, b3, b4; while(std::cin >> a1 >> a2 >> a3 >> a4){ std::cin >> b1 >>b2 >> b3 >>b4; std::array<int> A_num = {a1, a2, a3, a4}; std::array<int> B_num = {b1, b2, b3, b4}; int hit = 0; int blow = 0; for(int i = 0; i < 4; ++i){ if(A_num[i] == B_num[i]) hit++; count += std::count(A_num.begin(), A_num.end(), B_num[i]); } std::cout << hit << blow << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:31: error: wrong number of template arguments (1, should be 2) 13 | std::array<int> A_num = {a1, a2, a3, a4}; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51, 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/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:13:33: error: scalar object 'A_num' requires one element in initializer 13 | std::array<int> A_num = {a1, a2, a3, a4}; | ^~~~~ a.cc:14:31: error: wrong number of template arguments (1, should be 2) 14 | std::array<int> B_num = {b1, b2, b3, b4}; | ^ /usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:14:33: error: scalar object 'B_num' requires one element in initializer 14 | std::array<int> B_num = {b1, b2, b3, b4}; | ^~~~~ a.cc:24:25: error: 'count' was not declared in this scope; did you mean 'std::count'? 24 | count += std::count(A_num.begin(), A_num.end(), B_num[i]); | ^~~~~ | std::count In file included from /usr/include/c++/14/algorithm:86, from a.cc:3: /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~
s426087219
p00025
C++
#include <iostream> #include <array> #include <algorithm> int main(){ int a1, a2, a3, a4, b1, b2, b3, b4; while(std::cin >> a1 >> a2 >> a3 >> a4){ std::cin >> b1 >>b2 >> b3 >>b4; std::array<int> A = {a1, a2, a3, a4}; std::array<int> B = {b1, b2, b3, b4}; int hit = 0; int blow = 0; for(int i = 0; i < 4; ++i){ if(A[i] == B[i]) hit++; count += std::count(A.begin(), A.end(), B[i]); } std::cout << hit << blow << std::endl; } return 0; }
a.cc: In function 'int main()': a.cc:13:31: error: wrong number of template arguments (1, should be 2) 13 | std::array<int> A = {a1, a2, a3, a4}; | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:64, from /usr/include/c++/14/string:51, 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/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:13:33: error: scalar object 'A' requires one element in initializer 13 | std::array<int> A = {a1, a2, a3, a4}; | ^ a.cc:14:31: error: wrong number of template arguments (1, should be 2) 14 | std::array<int> B = {b1, b2, b3, b4}; | ^ /usr/include/c++/14/bits/stl_pair.h:99:12: note: provided for 'template<class _Tp, long unsigned int _Nm> struct std::array' 99 | struct array; | ^~~~~ a.cc:14:33: error: scalar object 'B' requires one element in initializer 14 | std::array<int> B = {b1, b2, b3, b4}; | ^ a.cc:24:25: error: 'count' was not declared in this scope; did you mean 'std::count'? 24 | count += std::count(A.begin(), A.end(), B[i]); | ^~~~~ | std::count In file included from /usr/include/c++/14/algorithm:86, from a.cc:3: /usr/include/c++/14/pstl/glue_algorithm_defs.h:101:1: note: 'std::count' declared here 101 | count(_ExecutionPolicy&& __exec, _ForwardIterator __first, _ForwardIterator __last, const _Tp& __value); | ^~~~~