submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s401618690
p00273
C
#include<stdio.h> int main(void){ int n,x,y,b,p,i,q,w,e,r; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); q=x*b; w=y*p; e=q+w; r=e*8/10 if(x>=5 && y>=2)printf("%d\n",r); else printf("%d\n",e); } return 0; }
main.c: In function 'main': main.c:10:19: error: expected ';' before 'if' 10 | r=e*8/10 | ^ | ; 11 | if(x>=5 && y>=2)printf("%d\n",r); | ~~ main.c:12:11: error: 'else' without a previous 'if' 12 | else printf("%d\n",e); | ^~~~
s550151043
p00273
C
include<stdio.h> int main(void){ int n,x,y,b,p,i,b1=999999,p1=999999; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); if(x==0){ b1=5*b+y*p; if(x*b+y*p>b1)printf("%d\n",b1); } if(y==0)p1=x*b+2*p; if(x*b+y*p>p1)printf("%d\n",p1); if(x>=5 && y>=2)printf("%d\n",0.8*(b*x+p*y)); else printf("%d\n",x*b+y*p); } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s291525196
p00273
C
#include<stdio.h> int main(void) { float f[366],g,n,x,y,b,p,i; scanf("%f",&n); for(i=0;i<n;i++){ scanf("%f %f %f %f",&x,&y,&b,&p); if(x>=5&&y>=2){ f[i]=(x*b+y*p)*0.8; g=x*b+y*p; if(f[i]>g) f[i]=g; else printf("%f\n",f); } else{ f[i]=x*b+y*p; } } for(i=0;i!=n;i++) printf("%d\n",f[i]); return 0; } //memo:aa
main.c: In function 'main': main.c:9:10: error: array subscript is not an integer 9 | f[i]=(x*b+y*p)*0.8; | ^ main.c:11:13: error: array subscript is not an integer 11 | if(f[i]>g) | ^ main.c:12:10: error: array subscript is not an integer 12 | f[i]=g; | ^ main.c:17:10: error: array subscript is not an integer 17 | f[i]=x*b+y*p; | ^ main.c:21:24: error: array subscript is not an integer 21 | printf("%d\n",f[i]); | ^
s525441531
p00273
C
#include<stdio.h> int main(void) { float f[366],g,n,x,y,b,p,i; scanf("%f",&n); for(i=0;i<n;i++){ scanf("%f %f %f %f",&x,&y,&b,&p); if(x>=5&&y>=2){ f[i]=(x*b+y*p)*0.8; g=x*b+y*p; if(f[i]>g) f[i]=g; else printf("%f\n",f); } else{ f[i]=x*b+y*p; } } for(i=0;i!=n;i++) printf("%f\n",f[i]); return 0; } //memo:aa
main.c: In function 'main': main.c:9:10: error: array subscript is not an integer 9 | f[i]=(x*b+y*p)*0.8; | ^ main.c:11:13: error: array subscript is not an integer 11 | if(f[i]>g) | ^ main.c:12:10: error: array subscript is not an integer 12 | f[i]=g; | ^ main.c:17:10: error: array subscript is not an integer 17 | f[i]=x*b+y*p; | ^ main.c:21:24: error: array subscript is not an integer 21 | printf("%f\n",f[i]); | ^
s055447535
p00273
C
} if(b>=5&&sw==0){ m=x*b+y*2; printf("%d ",m); m=m*0.8; sw=1; printf("%d ",m); if(m<d) d=m; } if(p>=2&&sw==0){ m=x*5+y*p; m=m*0.8; sw=1; if(m<d) d=m; } if(sw==0){ m=x*5+y*2; m=m*0.8; if(m<d) d=m; } printf("%d\n",d); } return 0; }
main.c:1:17: error: expected identifier or '(' before '}' token 1 | } | ^ main.c:2:17: error: expected identifier or '(' before 'if' 2 | if(b>=5&&sw==0){ | ^~ main.c:11:17: error: expected identifier or '(' before 'if' 11 | if(p>=2&&sw==0){ | ^~ main.c:18:17: error: expected identifier or '(' before 'if' 18 | if(sw==0){ | ^~ main.c:24:24: error: expected declaration specifiers or '...' before string constant 24 | printf("%d\n",d); | ^~~~~~ main.c:24:31: error: unknown type name 'd' 24 | printf("%d\n",d); | ^ main.c:25:9: error: expected identifier or '(' before '}' token 25 | } | ^ main.c:26:9: error: expected identifier or '(' before 'return' 26 | return 0; | ^~~~~~ main.c:27:1: error: expected identifier or '(' before '}' token 27 | } | ^
s326958508
p00273
C
#include<stdio.h> int main(void) { float f[366],g,n,x,y,b,p,i; scanf("%f",&n); for(i=0;i<n;i++){ scanf("%f %f %f %f",&x,&y,&b,&p); if(x>=5&&y>=2){ f[i]=(x*b+y*p)*0.8; g=x*b+y*p; if(f[i]>g) f[i]=g; } else{ f[i]=x*b+y*p; } } for(i=0;i!=n;i++) printf("%f\n",f[i]); return 0; } //memo:aa
main.c: In function 'main': main.c:9:10: error: array subscript is not an integer 9 | f[i]=(x*b+y*p)*0.8; | ^ main.c:11:13: error: array subscript is not an integer 11 | if(f[i]>g) | ^ main.c:12:10: error: array subscript is not an integer 12 | f[i]=g; | ^ main.c:15:10: error: array subscript is not an integer 15 | f[i]=x*b+y*p; | ^ main.c:19:24: error: array subscript is not an integer 19 | printf("%f\n",f[i]); | ^
s176416570
p00273
C
#include<stdio.h> int main() { int n,x,y,b,p,m,d[365],sw,i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); sw=0; d[i]=x*b+y*p; if(b>=5&&p>=2){ d[i]*=0.8; sw=1; } if(b>=5&&sw==0){ m=x*b+y*2; m=m*0.8; sw=1; if(m<d[i]) d[i]=m; } if(p>=2&&sw==0){ m=x*5+y*p; m=m*0.8; sw=1; if(m<d[i]) d[i]=m; } if(sw==0){ m=x*5+y*2; m=m*0.8; if(m<d[i]) d[i]=m; } } for(i=0;i<n;i++){ printf("%d\n",d[i]); return 0; }
main.c: In function 'main': main.c:38:1: error: expected declaration or statement at end of input 38 | } | ^
s562933863
p00273
C
#include<stdio.h> int main() { int n,x,y,b,p,m,d[365],sw,i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); sw=0; d[i]=x*b+y*p; if(b>=5&&p>=2){ d[i]=d[i]*0.8; sw=1; } if(b>=5&&sw==0){ m=x*b+y*2; m=m*0.8; sw=1; if(m<d[i]) d[i]=m; } if(p>=2&&sw==0){ m=x*5+y*p; m=m*0.8; sw=1; if(m<d[i]) d[i]=m; } if(sw==0){ m=x*5+y*2; m=m*0.8; if(m<d[i]) d[i]=m; } } for(i=0;i<n;i++){ printf("%d\n",d[i]); return 0; }
main.c: In function 'main': main.c:38:1: error: expected declaration or statement at end of input 38 | } | ^
s327397805
p00273
C
#include<stdio.h> int main() { int n,x,y,b,p,m,d[365],sw,i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); sw=0; d[i]=x*b+y*p; if(b>=5&&p>=2){ d[i]=d[i]*0.8; sw=1; } if(b>=5&&sw==0){ m=x*b+y*2; m=m*0.8; sw=1; if(m<d[i]) d[i]=m; } if(p>=2&&sw==0){ m=x*5+y*p; m=m*0.8; sw=1; if(m<d[i]) d[i]=m; } if(sw==0){ m=x*5+y*2; m=m*0.8; if(m<d[i]) d[i]=m; } } for(i=0;i<n;i++){ printf("%d\n",d[i]); return 0; }
main.c: In function 'main': main.c:38:1: error: expected declaration or statement at end of input 38 | } | ^
s731098201
p00273
C
#include <stdio.h> int main(void) { int i,n,x,y,b,p; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d%d%d%d",&x,&y,&b,&p); if(b>=5&&p>=2){ printf("%d\n",(x*b)*0.8+(y*p)*0.8); }else{ prijntf("%d\n",(x*b)+(y*p)); } } return 0; }
main.c: In function 'main': main.c:12:25: error: implicit declaration of function 'prijntf'; did you mean 'printf'? [-Wimplicit-function-declaration] 12 | prijntf("%d\n",(x*b)+(y*p)); | ^~~~~~~ | printf
s541903100
p00273
C
#include<stdio.h> int main (void){ double n,y,x,b,p,i=0,a[n],c= 0,d= 0; scanf("%d",&n); for(i = 0;i <= n-1;i++) { scanf("%d",&x); scanf("%d",&y); scanf("%d",&b); scanf("%d",&p); c = x * b; d = y * p; if(b == 0) { b = 5;} if(p == 0){ p = 2;} if (c + d>=(x*b+y*2)*0.8){ if (c + d>=(x*b+y*2)*0.8){ a[i]=(x*b+y*2)*0.8;}} else if (c + d>=(x*5+y*p)*0.8){ if(c + d>=(x*5+y*p)*0.8){ a[i]=(x*5+y*p)*0.8;} } else { a[i] = c + d;} } for(i=0;i<=n-1;i++){ printf("%d\n",a[i#include<stdio.h> int main (void){ int n,y,x,b,p,i,j,a[n],c,d,e,m; scanf("%d",&n); for(i = 0;i <= n-1;i++) { scanf("%d",&x); scanf("%d",&y); scanf("%d",&b); scanf("%d",&p); c = x * b; d = y * p; if(b == 0) { b = 5;} if(p == 0){ p = 2;} if (c + d>=(x*b+y*2)*0.8){ if (c + d>=(x*b+y*2)*0.8){ a[i]=(x*b+y*2)*0.8;}} else if (c + d>=(x*5+y*p)*0.8){ if(c + d>=(x*5+y*p)*0.8){ a[i]=(x*5+y*p)*0.8;} } else { a[i] = c + d;} } for(i=1;i<=n;i++){ printf("%d\n",a[i]);} return 0; }]);} return 0; }
main.c: In function 'main': main.c:3:22: error: size of array 'a' has non-integer type 3 | double n,y,x,b,p,i=0,a[n],c= 0,d= 0; | ^ main.c:18:18: error: array subscript is not an integer 18 | a[i]=(x*b+y*2)*0.8;}} | ^ main.c:21:18: error: array subscript is not an integer 21 | a[i]=(x*5+y*p)*0.8;} | ^ main.c:24:2: error: array subscript is not an integer 24 | a[i] = c + d;} | ^ main.c:28:18: error: stray '#' in program 28 | printf("%d\n",a[i#include<stdio.h> | ^ main.c:28:16: error: array subscript is not an integer 28 | printf("%d\n",a[i#include<stdio.h> | ^ main.c:28:18: error: expected ']' before 'include' 28 | printf("%d\n",a[i#include<stdio.h> | ^~~~~~~~ | ]
s023465020
p00273
C++
#include <cstdio> #include <algorithm> using namespace std; int main() { int n; scanf( "%d\n", &n ); while( n > 0 ) { double x, y, b, p, ret; scanf( "%lf %lf %lf %lf\n", &x, &y, &b, &p ); ret = x * b + y * p; if( 5 <= b && 2 <= p ) { printf( "%.0lf\n", 80 * ret / 100 ); } else if( 5 <= b && p < 2) { double comp1 = (b * x + 2.0 * y) * 80 / 100; printf( "%.0lf\n", min( comp1, ret ) ); } else if( 2 <= p && b < 5) { double comp2 = (5.0 * x + p * y) * 80 / 100; printf( "%.0lf\n", min( comp2, ret ) ); } else { double comp3 = (5.0 * x + 2.0 * y) * 80 / 100; printf( "%.0lf\n", min( comp3, ret ) ); } n--; } return 0; } printf( "%.0lf\n", ret ); } n--; } return 0; }
a.cc:38:19: error: expected constructor, destructor, or type conversion before '(' token 38 | printf( "%.0lf\n", ret ); | ^ a.cc:39:9: error: expected declaration before '}' token 39 | } | ^ a.cc:40:9: error: 'n' does not name a type 40 | n--; | ^ a.cc:41:5: error: expected declaration before '}' token 41 | } | ^ a.cc:42:5: error: expected unqualified-id before 'return' 42 | return 0; | ^~~~~~ a.cc:43:1: error: expected declaration before '}' token 43 | } | ^
s418927651
p00273
C++
5 500 500 1 1 500 500 5 2 1000 100 0 6 1000 100 6 0 100 1000 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 5 | ^
s523487170
p00273
C++
import java.util.Scanner; public class Main{ public void solve(){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); for(int i=0;i<n;i++){ int x = sc.nextInt(); int y = sc.nextInt(); int b = sc.nextInt(); int p = sc.nextInt(); int kin = x*b + y*p; if(b>=5 && p>=2){ kin = (x*b + y*p)*4/5; }else{ if(b<5){ b=5; } if(p<2){ p=2; } int wari = (x*b + y*p)*4/5; if(kin>wari){ kin = wari; } } System.out.println(kin); } } public static void main(String[]args){ Main obj = new Main(); obj.solve(); } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main{ | ^~~~~~
s110158730
p00273
C++
#include<stdio.h> int main(void) { int i,n; int x,y,b,p; int xb,yp,xbyp,xbyp2,xbyp3,xbyp4; int b2,p2,xb2,yp2; scanf("%d",&n); for(i=1;i<=n;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); if(b>=5 && p>=2){ xbyp2=(xb+yp)*8/10; } xb=x*b; yp=y*p; xbyp=xb+yp; } if(b<5){ b=5; } if(p<2){ p=2; } xb2=x*b; yp2=y*p; xbyp3=(xb2+yp2)*8/10; if(xbyp3<xbyp){ printf("%d\n",xbyp3); } else if(xbyp<xbyp3){ printf("%d\n",xbyp); } else if(xbyp2<xbyp){ printf("%d\n",xbyp2); } } return 0; }
a.cc:48:17: error: expected unqualified-id before 'return' 48 | return 0; | ^~~~~~ a.cc:49:1: error: expected declaration before '}' token 49 | } | ^
s165074206
p00273
C++
#include<stdio.h> int main(){ int i,a,b,c,d,n,e; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&a,&b,&c,&d); e=a*c+b*d; if(d<2&&c<5){ if((a*5+b*2)*0.8<e) e=(a*5+b*2)*0.8; } else if(c<5){ if((a*5+b*d)*0.8<e) e=(a*5+b*d)*0.8; } else if(d<2){ if((a*c+b*2)*0.8<e) e=(a*c+b*2)*0.8; } else e=(a*c+b*d)*0.8; } printf("%d\n",e); } return 0; }
a.cc:22:9: error: expected unqualified-id before 'return' 22 | return 0; | ^~~~~~ a.cc:23:1: error: expected declaration before '}' token 23 | } | ^
s616775804
p00273
C++
#include<stdio.h> int main(void){ int n,x,y,b,p,i; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%d %d %d %d",&x,&y,&b,&p); if(b>=5 && p>=2)printf("%d\n",x*0.8+y*0.8) else printf("%d\n",x+y); } return 0; }
a.cc: In function 'int main()': a.cc:7:53: error: expected ';' before 'else' 7 | if(b>=5 && p>=2)printf("%d\n",x*0.8+y*0.8) | ^ | ; 8 | else printf("%d\n",x+y); | ~~~~
s935760963
p00273
C++
#include<stdio.h> int main(void) { int f,N,i,x[365],y[365],b[365],p[365]; scanf("%d",&N); for(i=0;i<=N;i++){ scanf("%d %d %d %d",&x[i],&y[i],&b[i],&p[i]); if((x>=5)&&(y>=2)) f=(x*b+y*p)*0.8; else f=x*b+y*p; } printf("%d\n",f); return 0; }
a.cc: In function 'int main()': a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if((x>=5)&&(y>=2)) | ~^~~ a.cc:8:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if((x>=5)&&(y>=2)) | ~^~~ a.cc:9:13: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 9 | f=(x*b+y*p)*0.8; | ~^~ | | | | | int [365] | int [365] a.cc:9:17: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 9 | f=(x*b+y*p)*0.8; | ~^~ | | | | | int [365] | int [365] a.cc:11:12: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 11 | f=x*b+y*p; | ~^~ | | | | | int [365] | int [365] a.cc:11:16: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 11 | f=x*b+y*p; | ~^~ | | | | | int [365] | int [365]
s883962593
p00273
C++
#include<stdio.h> int main(void) { int f,N,i,x[365],y[365],b[365],p[365]; scanf("%d",&N); for(i=0;i<=N;i++){ scanf("%d %d %d %d",&x[i],&y[i],&b[i],&p[i]); if((x>=5)&&(y>=2)){ f=(x*b+y*p)*0.8;} else{ f=x*b+y*p;} printf("%d\n",f); } return 0; }
a.cc: In function 'int main()': a.cc:8:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if((x>=5)&&(y>=2)){ | ~^~~ a.cc:8:22: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 8 | if((x>=5)&&(y>=2)){ | ~^~~ a.cc:9:13: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 9 | f=(x*b+y*p)*0.8;} | ~^~ | | | | | int [365] | int [365] a.cc:9:17: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 9 | f=(x*b+y*p)*0.8;} | ~^~ | | | | | int [365] | int [365] a.cc:11:12: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 11 | f=x*b+y*p;} | ~^~ | | | | | int [365] | int [365] a.cc:11:16: error: invalid operands of types 'int [365]' and 'int [365]' to binary 'operator*' 11 | f=x*b+y*p;} | ~^~ | | | | | int [365] | int [365]
s493893704
p00273
C++
#include<iostream> using namespace std; int main(){ int i,j,N,x,y,b,p,an,ano,ans[365]; cin >> N; for(i=0;i<N;i++){ cin >> x >> y >> b >> p; an = x*b + y*p; if(x>=5 && y>= 2){ an = an * 0.8; } else if(x>=5){ ano = (x*b + y*2) * 0.8; if(ano < an) an = ano; } else if(y>=2){ ano = (x*5 + y*p) * 0.8; if(ano < an) an = ano; } for(i=0;i<N;i++){ cout << ans[i] << endl; } return 0; }
a.cc: In function 'int main()': a.cc:26:2: error: expected '}' at end of input 26 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s583083607
p00273
C++
#include<stdio.h> int main(void) { float f[366],g,n,x,y,b,p,i; scanf("%f",&n); for(i=0;i<n;i++){ scanf("%f %f %f %f",&x,&y,&b,&p); if(x>=5&&y>=2){ f[i]=(x*b+y*p)*0.8; g=x*b+y*p; if(f[i]>g) f[i]=g; else printf("%f\n",f); } else{ f[i]=x*b+y*p; } } for(i=0;i!=n;i++) printf("%d\n",f[i]); return 0; } //memo:aa
a.cc: In function 'int main()': a.cc:9:10: error: invalid types 'float [366][float]' for array subscript 9 | f[i]=(x*b+y*p)*0.8; | ^ a.cc:11:13: error: invalid types 'float [366][float]' for array subscript 11 | if(f[i]>g) | ^ a.cc:12:10: error: invalid types 'float [366][float]' for array subscript 12 | f[i]=g; | ^ a.cc:17:10: error: invalid types 'float [366][float]' for array subscript 17 | f[i]=x*b+y*p; | ^ a.cc:21:24: error: invalid types 'float [366][float]' for array subscript 21 | printf("%d\n",f[i]); | ^
s143637322
p00273
C++
#include<iostream> using namespace std; int main(){ // int UBW; int N,pro, ans[365],x[365], y[365], b[365], p[365]; cin >> N; for (int i = 0; i < N; i++){ cin >> x[i] >> y[i] >> b[i] >> p[i]; ans[i] = (x[i] * b[i] + y[i] * p[i]); } for (int i = 0; i < N; i++){ if (b[i] > 4 && p[i] > 1){ pro = (x[i] * b[i] + y[i] * p[i]) * 0.8; if (ans[i] > pro) ans[i] = pro; } else if (b[i] > 4){ pro = (x[i] * b[i] + y[i] * 2) * 0.8; if (ans[i] > pro) ans[i] = pro; } else if (p[i] > 1){ pro = (x[i] * 5 + y[i] * p[i]) * 0.8; if (ans[i] > pro) ans[i] = pro; } else{ pro = (x[i] * 5 + y[i] * 2) * 0.8; if (ans[i] > pro) ans[i] = pro; } } for (int i = 0; i < N; i++) cout << ans[i] << endl; cin >> UBW; return 0; }
a.cc: In function 'int main()': a.cc:31:16: error: 'UBW' was not declared in this scope 31 | cin >> UBW; | ^~~
s083003317
p00273
C++
#include<iostream> using namespace std; int main(void){ int n,x,y,b,p; cin >> n; for(int i=0;i<n;i++){ cin >> x >> y >> b >> p; if(b >= 5 && p >= 2)cout << (x * b + y * p)/10*8 << endl; else if(b >= 5){ if(x * b + y * p > (x * b + y * (p + (2 - p)))/10*8)cout << (x * b + y * (p+(2-p)))/10*8 << endl; else cout << x * b + y * p << endl; }else if(p >= 2){ if(x * b + y * p > (x * (b + (5 - b)) + y * p)/10*8)cout << (x * (b + (5 - b)) + y * p)/10*8 << endl; else cout << x * b + y * p << endl; }else{ if(x * b + y * p > (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8)cout << (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8) << endl; else cout << x * b + y * p << endl; } return 0; }
a.cc: In function 'int main()': a.cc:19:141: error: expected ';' before ')' token 19 | if(x * b + y * p > (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8)cout << (x * (b + (5 - b)) + y * (p + (2 - p)))/10*8) << endl; | ^ | ; a.cc:24:2: error: expected '}' at end of input 24 | } | ^ a.cc:4:15: note: to match this '{' 4 | int main(void){ | ^
s709953091
p00273
C++
#include<iostream> using namespace std; int main () { int N; cin >> N; for (int i = 0; i < N; i++){ int x, y, b, p; cin >> x >> y >> b >> p; int futsu = x * b + y * p; int oome = (x * 5 + y * 2 + x * max(b - 5, 0) + y * max(p - 2, 0) *8/10; if (b >= 5 && p >= 2) { cout << futsu * 8 / 10 << endl; }else if (oome < futsu){ cout << oome << endl; }else { cout << futsu << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:13:88: error: expected ')' before ';' token 13 | int oome = (x * 5 + y * 2 + x * max(b - 5, 0) + y * max(p - 2, 0) *8/10; | ~ ^ | )
s695477303
p00273
C++
#include<stdio.h> int main(){ int a1,a2,b1,b2,a,b,c,i,day; scanf("%d",&day); for(i=1;i<=day;i++){ scanf("%d %d %d %d",&a1,&b1,&a2,&b2); a=a1*a2; b=b1*b2; c=a+b; if(a2>=5&&b2>=2){ d=c*0.8; } printf("%d\n",c); } return 0; }
a.cc: In function 'int main()': a.cc:11:7: error: 'd' was not declared in this scope 11 | d=c*0.8; | ^
s898558833
p00273
C++
#include<stdio.h> int main(){ int A,B,C,D,E,F,G,H,I,J,a1,a2,b1,b2,a,b,c,i,day<=365; scanf("%d",&day); for(i=1;i<=day;i++){ scanf("%d %d %d %d",&a1,&b1,&a2,&b2); a=a1*a2; b=b1*b2; c=a+b; if(a2>=5&&b2>=2){ c=c*0.8; } A=a1*a2; B=b1*2; D=A+B; D=D*0.8; F=a1*5; G=b1*b2; E=F+G; E=E*0.8; H=a1*5; I=b1*2; J=H+I; J=J*0.8; if(c>=E&&a2<=4){ c=E; }else if(c>=D&&b2<=1){ c=D; }else if(c>=J&&a2<=4&&b2<=1){ c=J; } printf("%d\n",c); } return 0; }
a.cc: In function 'int main()': a.cc:3:50: error: expected initializer before '<=' token 3 | int A,B,C,D,E,F,G,H,I,J,a1,a2,b1,b2,a,b,c,i,day<=365; | ^~ a.cc:4:15: error: 'day' was not declared in this scope 4 | scanf("%d",&day); | ^~~
s324533147
p00273
C++
#include <iostream> #include <stdio.h> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ int x, y, b, p; scanf("%d %d %d %d", &x, &y, &b, &p); if(b >= 5 && p >= 2){ cout << 0.8 * (x * b + y * p) << endl; }else if(b < 5){ (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl; : (cout << x * b + y * p << endl;)); }else if(p < 2){ (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl; : (cout << x * b + y * p << endl;)); }else{ (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl; : (cout << x * b + y * p << endl;)); } } return 0; }
a.cc: In function 'int main()': a.cc:13:105: error: expected ')' before ';' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl; : (cout << x * b + y * p << endl;)); | ~ ^ | ) a.cc:13:105: error: expected ':' before ';' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl; : (cout << x * b + y * p << endl;)); | ^ | : a.cc:13:105: error: expected primary-expression before ';' token a.cc:13:107: error: expected primary-expression before ':' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl; : (cout << x * b + y * p << endl;)); | ^ a.cc:13:140: error: expected primary-expression before ')' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl; : (cout << x * b + y * p << endl;)); | ^ a.cc:15:105: error: expected ')' before ';' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ~ ^ | ) a.cc:15:105: error: expected ':' before ';' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ^ | : a.cc:15:105: error: expected primary-expression before ';' token a.cc:15:107: error: expected primary-expression before ':' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ^ a.cc:15:140: error: expected primary-expression before ')' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ^ a.cc:17:105: error: expected ')' before ';' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ~ ^ | ) a.cc:17:105: error: expected ':' before ';' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ^ | : a.cc:17:105: error: expected primary-expression before ';' token a.cc:17:107: error: expected primary-expression before ':' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ^ a.cc:17:140: error: expected primary-expression before ')' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl; : (cout << x * b + y * p << endl;)); | ^
s786685876
p00273
C++
#include <iostream> #include <stdio.h> using namespace std; int main(){ int n; cin >> n; for(int i = 0; i < n; i++){ int x, y, b, p; scanf("%d %d %d %d", &x, &y, &b, &p); if(b >= 5 && p >= 2){ cout << 0.8 * (x * b + y * p) << endl; }else if(b < 5){ (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;); }else if(p < 2){ (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;); }else{ (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;); } } return 0; }
a.cc: In function 'int main()': a.cc:13:105: error: expected ')' before ';' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;); | ~ ^ | ) a.cc:13:105: error: expected ':' before ';' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;); | ^ | : a.cc:13:105: error: expected primary-expression before ';' token a.cc:13:106: error: expected primary-expression before ')' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;); | ^ a.cc:13:141: error: expected primary-expression before ')' token 13 | (0.8 * (x * 5 + y * p) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * p) << endl;) : (cout << x * b + y * p << endl;); | ^ a.cc:15:105: error: expected ')' before ';' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ~ ^ | ) a.cc:15:105: error: expected ':' before ';' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ^ | : a.cc:15:105: error: expected primary-expression before ';' token a.cc:15:106: error: expected primary-expression before ')' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ^ a.cc:15:141: error: expected primary-expression before ')' token 15 | (0.8 * (x * b + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * b + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ^ a.cc:17:105: error: expected ')' before ';' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ~ ^ | ) a.cc:17:105: error: expected ':' before ';' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ^ | : a.cc:17:105: error: expected primary-expression before ';' token a.cc:17:106: error: expected primary-expression before ')' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ^ a.cc:17:141: error: expected primary-expression before ')' token 17 | (0.8 * (x * 5 + y * 2) > x * b + y * p) ? (cout << 0.8 * (x * 5 + y * 2) << endl;) : (cout << x * b + y * p << endl;); | ^
s910238274
p00273
C++
#include <bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; for(int i=0;i<n;i++){ double x,y,b,p,suma=0,sumb=0; cin>>x>>y>>b>>p; suma=x*b+y*p; if(b>=5&&p>=2) suma=sum*4/5; if(b<5) b=5; if(p<2) p=2; sumb=(x*b+y*p)*4/5; cout<<min(suma,sumb)<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:10:37: error: 'sum' was not declared in this scope; did you mean 'sumb'? 10 | if(b>=5&&p>=2) suma=sum*4/5; | ^~~ | sumb
s379711873
p00273
C++
//AOJ0298.cpp #include <iostream> using namespace std; int main(){ int N; cin >> N; int h[101], m[101]; for(int i=0; i<N; i++){ cin >> h[i] >> m[i]; } h[N] = 24; m[N] = 0; int M; cin >> M; int k[101], g[101]; for(int j=0; j<M; j++){ cin >> k[j] >> g[j]; } k[M] = 24; g[M] = 0; for(int i=0; j=0; i<N || j<M;){ if(h[i]==k[j] && m[i]==g[j]){ cout << h[i] << ':' << m[i]/10 << m[i]%10; i++; j++; } else if(h[i]<k[j] || (h[i]==k[j] && m[i]<g[j])){ cout << h[i] << ':' << m[i]/10 << m[i]%10; i++; } else{ cout << k[j] << ':' << g[j]/10 << g[j]%10; j++; } if(i==N && j==M){ cout <<endl; } else{ cout << ' '; } } return 0; }
a.cc: In function 'int main()': a.cc:25:16: error: 'j' was not declared in this scope 25 | for(int i=0; j=0; i<N || j<M;){ | ^ a.cc:25:31: error: expected ')' before ';' token 25 | for(int i=0; j=0; i<N || j<M;){ | ~ ^ | ) a.cc:25:32: error: expected primary-expression before ')' token 25 | for(int i=0; j=0; i<N || j<M;){ | ^
s059653117
p00273
C++
#include<iostream> using namespace std; int main(){ int N; int x[N],y[N],b[N],p[N]; for(int i=0;i<N;i++){ cin>>x[i]>>y[i]>>b[i]>>p[i]; } int all[N]; for(int i=0;i<N;i++){ int goke,kgoke; if(b[i]>=5&&p[i]>=2){ goke=(x[i]*b[i]+y[i]*p[i])*0.8; }else{ goke=x[i]*b[i]+y[i]*p[i]; if(b[i]<5&&p[i]<2){ kgoke=(x[i]*5+y[i]*2)*0.8; } if(b[i]<5&&p[i]>=2){ kgoke=(x[i]*5+y[i]*p[i])*0.8; } if(b[i]>=5&&p[i]<2){ kgoke(x[i]*b[i]+y[i]*2)*0.8; } if(goke>kgoke){ all[i]=kgoke; }else{ all[i]=goke; } } } for(int i=0:i<N;i++;){ cout<<N[i]<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:24:38: error: 'kgoke' cannot be used as a function 24 | kgoke(x[i]*b[i]+y[i]*2)*0.8; | ~~~~~^~~~~~~~~~~~~~~~~~ a.cc:33:18: error: initializer in range-based 'for' loop 33 | for(int i=0:i<N;i++;){ | ^ a.cc:33:24: error: expected ')' before ';' token 33 | for(int i=0:i<N;i++;){ | ~ ^ | ) a.cc:33:25: error: 'i' was not declared in this scope 33 | for(int i=0:i<N;i++;){ | ^ a.cc:33:29: error: expected primary-expression before ')' token 33 | for(int i=0:i<N;i++;){ | ^
s531389047
p00273
C++
#include<iostream> using namespace std; int main(){ int N; cin>>N; for(int i=0;i<N;i++){ int x,y,b,p; cin>>x>>y>>b>>p; int f1=x*b+y*p; if(b<5){ b=5; } if(p<2){ p=2; } int f2=(x*b+y*p)*4/5; if(f1<f2){ cout<<f1<<endl; ??? else{ cout<<f2<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:25:17: error: expected primary-expression before '?' token 25 | ??? | ^ a.cc:25:18: error: expected primary-expression before '?' token 25 | ??? | ^ a.cc:25:19: error: expected primary-expression before '?' token 25 | ??? | ^ a.cc:26:17: error: expected primary-expression before 'else' 26 | else{ | ^~~~ a.cc:25:20: error: expected ':' before 'else' 25 | ??? | ^ | : 26 | else{ | ~~~~ a.cc:26:17: error: expected primary-expression before 'else' 26 | else{ | ^~~~ a.cc:25:20: error: expected ':' before 'else' 25 | ??? | ^ | : 26 | else{ | ~~~~ a.cc:26:17: error: expected primary-expression before 'else' 26 | else{ | ^~~~ a.cc:25:20: error: expected ':' before 'else' 25 | ??? | ^ | : 26 | else{ | ~~~~ a.cc:26:17: error: expected primary-expression before 'else' 26 | else{ | ^~~~ a.cc:31:2: error: expected '}' at end of input 31 | } | ^ a.cc:8:29: note: to match this '{' 8 | for(int i=0;i<N;i++){ | ^ a.cc:31:2: error: expected '}' at end of input 31 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s049461262
p00273
C++
#include<iostream> using namespace std; int main(){ int N; cin>>N; for(int i=0;i<N;i++){ int x,y,b,p; cin>>x>>y>>b>>p; int f1=x*b+y*p; if(b<5){ b=5; } if(p<2){ p=2; int f2=(x*b+y*p)*4/5; if(f1<f2){ cout<<f1<<endl; } else{ cout<<f2<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:30:2: error: expected '}' at end of input 30 | } | ^ a.cc:4:11: note: to match this '{' 4 | int main(){ | ^
s076570736
p00273
C++
//AOJ0278 #include <iostream> using namespace std; int main(){ int N; cin >> N; for(int i=0; i<N; i++){ int x, y, b, p; cin >> x >> y >> b >> p; int f1 = x*b + y*p; if(b<5){ b = 5; } if(p<2){ p = 2; } int f2 = (x*b + y*p)*4/5 if(f1<f2){ cout << f1 << endl; } else{ cout << f2 << endl; } } return 0; }
a.cc: In function 'int main()': a.cc:24:5: error: expected ',' or ';' before 'if' 24 | if(f1<f2){ | ^~ a.cc:27:5: error: 'else' without a previous 'if' 27 | else{ | ^~~~
s644380888
p00273
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while (n-- > 0) { int a=sc.nextInt(),b=sc.nextInt(),c=sc.nextInt(),d=sc.nextInt(); if(c>=5&&d>=2) { System.out.println((a*c+b*d)*8/10); }else { System.out.println(Math.min(a*c+b*d,(a*(c<5?5:c)+b*(d<2?2:d))*8/10 )); } } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s377325429
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; cin >> a; for (int i =0;i<a;i++){ cin << b<<c<<d<<e; f = b*d+c*e; if(d>=5 && e >=2) { cout <<f*0.8<<endl; } else if { cout <<f<<endl; } } }
a.cc: In function 'int main()': a.cc:9:14: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 9 | cin << b<<c<<d<<e; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:9:14: note: candidate: 'operator<<(int, int)' (built-in) 9 | cin << b<<c<<d<<e; | ~~~~^~~~ a.cc:9:14: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:9:10: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 9 | cin << b<<c<<d<<e; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: temp
s535851909
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; cin >> a; for (int i =0;i<a;i++){ cin << b<<c<<d<<e; f = b*d+c*e; if(d>=5 && e >=2) { cout <<(int)f*0.8<<endl; } else if { cout <<f<<endl; } } }
a.cc: In function 'int main()': a.cc:9:14: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 9 | cin << b<<c<<d<<e; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:9:14: note: candidate: 'operator<<(int, int)' (built-in) 9 | cin << b<<c<<d<<e; | ~~~~^~~~ a.cc:9:14: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:9:10: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 9 | cin << b<<c<<d<<e; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:671:5: note: temp
s020850730
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; cin >> a; for (int i =0;i<a;i++){ cin << b<<c<<d<<e<<endl; f = b*d+c*e; if(d>=5 && e >=2) { cout <<(int)f*0.8<<endl; } else if { cout <<f<<endl; } } }
a.cc: In function 'int main()': a.cc:9:14: error: no match for 'operator<<' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'int') 9 | cin << b<<c<<d<<e<<endl; | ~~~ ^~ ~ | | | | | int | std::istream {aka std::basic_istream<char>} a.cc:9:14: note: candidate: 'operator<<(int, int)' (built-in) 9 | cin << b<<c<<d<<e<<endl; | ~~~~^~~~ a.cc:9:14: note: no known conversion for argument 1 from 'std::istream' {aka 'std::basic_istream<char>'} to 'int' In file included from /usr/include/c++/14/regex:68, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:181, from a.cc:1: /usr/include/c++/14/bits/regex.h:1715:5: note: candidate: 'template<class _Ch_type, class _Ch_traits, class _Bi_iter> std::basic_ostream<_CharT, _Traits>& std::__cxx11::operator<<(std::basic_ostream<_CharT, _Traits>&, const sub_match<_Bi_iter>&)' 1715 | operator<<(basic_ostream<_Ch_type, _Ch_traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/regex.h:1715:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:41: /usr/include/c++/14/cstddef:125:5: note: candidate: 'template<class _IntegerType> constexpr std::__byte_op_t<_IntegerType> std::operator<<(byte, _IntegerType)' 125 | operator<<(byte __b, _IntegerType __shift) noexcept | ^~~~~~~~ /usr/include/c++/14/cstddef:125:5: note: template argument deduction/substitution failed: a.cc:9:10: note: cannot convert 'std::cin' (type 'std::istream' {aka 'std::basic_istream<char>'}) to type 'std::byte' 9 | cin << b<<c<<d<<e<<endl; | ^~~ In file included from /usr/include/c++/14/bits/basic_string.h:47, from /usr/include/c++/14/string:54, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52: /usr/include/c++/14/string_view:763:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, basic_string_view<_CharT, _Traits>)' 763 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/string_view:763:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/bits/basic_string.h:4077:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 4077 | operator<<(basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/basic_string.h:4077:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/bitset:1687:5: note: candidate: 'template<class _CharT, class _Traits, long unsigned int _Nb> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const bitset<_Nb>&)' 1687 | operator<<(std::basic_ostream<_CharT, _Traits>& __os, | ^~~~~~~~ /usr/include/c++/14/bitset:1687:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ In file included from /usr/include/c++/14/bits/ios_base.h:46, from /usr/include/c++/14/streambuf:43, from /usr/include/c++/14/bits/streambuf_iterator.h:35, from /usr/include/c++/14/iterator:66, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:54: /usr/include/c++/14/system_error:339:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const error_code&)' 339 | operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e) | ^~~~~~~~ /usr/include/c++/14/system_error:339:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ In file included from /usr/include/c++/14/memory:80, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:56: /usr/include/c++/14/bits/shared_ptr.h:70:5: note: candidate: 'template<class _Ch, class _Tr, class _Tp, __gnu_cxx::_Lock_policy _Lp> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const __shared_ptr<_Tp, _Lp>&)' 70 | operator<<(std::basic_ostream<_Ch, _Tr>& __os, | ^~~~~~~~ /usr/include/c++/14/bits/shared_ptr.h:70:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ In file included from /usr/include/c++/14/istream:41, from /usr/include/c++/14/sstream:40, from /usr/include/c++/14/complex:45, from /usr/include/c++/14/ccomplex:39, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127: /usr/include/c++/14/ostream:563:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, _CharT)' 563 | operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c) | ^~~~~~~~ /usr/include/c++/14/ostream:563:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/ostream:573:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, char)' 573 | operator<<(basic_ostream<_CharT, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:573:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/ostream:579:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, char)' 579 | operator<<(basic_ostream<char, _Traits>& __out, char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:579:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/ostream:590:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, signed char)' 590 | operator<<(basic_ostream<char, _Traits>& __out, signed char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:590:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/ostream:595:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, unsigned char)' 595 | operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c) | ^~~~~~~~ /usr/include/c++/14/ostream:595:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<char, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/ostream:654:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const _CharT*)' 654 | operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s) | ^~~~~~~~ /usr/include/c++/14/ostream:654:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ In file included from /usr/include/c++/14/ostream:1022: /usr/include/c++/14/bits/ostream.tcc:307:5: note: candidate: 'template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(basic_ostream<_CharT, _Traits>&, const char*)' 307 | operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s) | ^~~~~~~~ /usr/include/c++/14/bits/ostream.tcc:307:5: note: template argument deduction/substitution failed: a.cc:9:17: note: 'std::istream' {aka 'std::basic_istream<char>'} is not derived from 'std::basic_ostream<_CharT, _Traits>' 9 | cin << b<<c<<d<<e<<endl; | ^ /usr/include/c++/14/ostream:671:5: note: candidate: 'template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(basic_ostream<char, _Traits>&, const char*)' 671 | operator<<(basic_ostream<char, _Trait
s397300269
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; cin >> a; for (int i =0;i<a;i++){ cin>>b>>c>>d>>e; f = b*d+c*e; if(d>=5 && e >=2) { cout <<(int)f*0.8<<endl; } else if { cout <<f<<endl; } } }
a.cc: In function 'int main()': a.cc:13:20: error: expected '(' before '{' token 13 | } else if { | ^ | (
s421988118
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; cin >> a; for (int i =0;i<a;i++){ cin>>b>>c>>d>>e; f = b*d+c*e; if(d>=5 && e >=2){ cout <<(int)f*0.8<<endl; } else if{ cout <<f<<endl; } } }
a.cc: In function 'int main()': a.cc:13:19: error: expected '(' before '{' token 13 | } else if{ | ^ | (
s573652173
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; cin >> a; for (int i =0;i<a;i++){ cin>>b>>c>>d>>e; f = b*d+c*e; if(d>=5 && e >=2) cout << (int)f*0.8<<endl; } else cout <<f<<endl; } }
a.cc: In function 'int main()': a.cc:12:12: error: 'else' without a previous 'if' 12 | } else cout <<f<<endl; | ^~~~ a.cc: At global scope: a.cc:16:1: error: expected declaration before '}' token 16 | } | ^
s752515626
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f; cin >> a; for (int i =0;i<a;i++){ cin>>b>>c>>d>>e; f = b*d+c*e; if(d>=5 && e >=2){ cout <<(int)f*0.8<<endl; } else if{ cout <<f<<endl; } } }
a.cc: In function 'int main()': a.cc:13:19: error: expected '(' before '{' token 13 | } else if{ | ^ | (
s659446546
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f,g; cin >> a; for (int i =0;i<a;i++){ cin>>b>>c>>d>>e; f = b*d+c*e; if (d>=5 && e >=2) { g = (int)f*0.8; cout << g << endl; } else if { cout << f << endl; } } }
a.cc: In function 'int main()': a.cc:14:20: error: expected '(' before '{' token 14 | } else if { | ^ | (
s662855740
p00273
C++
#include<bits/stdc++.h> using namespace std; int main(){ int a,b,c,d,e,f,g; cin >> a; for (int i =0;i<a;i++){ cin>>b>>c>>d>>e; f = b*d+c*e; if (d>=5 && e >=2) { g = (int)f*0.8; cout << g << endl; } else if (){ cout << f << endl; } } }
a.cc: In function 'int main()': a.cc:14:21: error: expected primary-expression before ')' token 14 | } else if (){ | ^
s741298992
p00273
C++
#include <iostream> #include <cmath> using namespace std; int main() { int N; int x, y, b, p; cin >> N; for(int i=0; i<N; i++) { cin >> x >> y >> b >> p; if(b >= 5 && p>=2) { int a = x*5*0.8 + y*2*0.8; cout << a << endl; } else { if(x*max(5,b)*0.8 + y*m#include <iostream> #include <cmath> using namespace std; int main() { int N; int x, y, b, p; cin >> N; for(int i=0; i<N; i++) { cin >> x >> y >> b >> p; if(b >= 5 && p>=2) { int a = x*5*0.8 + y*2*0.8; cout << a << endl; } else { if(x*max(5,b)*0.8 + y*max(2,p)*0.8 < x*b + y*p) cout << x*max(5,b)*0.8 + y*max(2,p)*0.8 << endl; else cout << x*b + y*p << endl; } } return 0; } ax(2,p)*0.8 < x*b + y*p) cout << x*max(5,b)*0.8 + y*max(2,p)*0.8 << endl; else cout << x*b + y*p << endl; } } return 0; }
a.cc:18:30: error: stray '#' in program 18 | if(x*max(5,b)*0.8 + y*m#include <iostream> | ^ a.cc: In function 'int main()': a.cc:18:29: error: 'm' was not declared in this scope 18 | if(x*max(5,b)*0.8 + y*m#include <iostream> | ^ a.cc:22:5: error: condition declares a function 22 | int main() { | ^~~~
s590637065
p00273
C++
#include<stdio.h> #include<algorithm> using namespace std; int main(){ int a; scanf("%d",&a); for(int i=0;i<a;i++){ int p,q,r,s; scanf("%d%d%d%d",&p,&q,&r,&s); if(r>=5&&s>=2)printf("%d\n",4*(p*r+q*s)/5); else printf("%d\n",p*r+q*s)); } }
a.cc: In function 'int main()': a.cc:11:44: error: expected ';' before ')' token 11 | else printf("%d\n",p*r+q*s)); | ^ | ;
s611518460
p00273
C++
include <iostream> using namespace std; int main() { int N = 0; //入力 int x, y, b, p; //入力 int max = 0; //使うぶんをそのまま買った場合の代金 int wari = 0; //割引後の代金 int i = 0; //カウンタ cin >> N; while (1) { cin >> x; cin >> y; cin >> b; cin >> p; max = ((x * b) + (y * p)); //購入する券数を割引適用の最低基準まで持ち上げる if (b < 5){ b = 5; } if (p < 2){ p = 2; } //割引後の代金(または割引を適用する場合の最低額) wari = ((x * b) + (y * p)) * 0.8; //比較 if (max < wari) { cout << max << "\n"; } else { cout << wari << "\n"; } i++; //カウントアップ if(i == N) { return 0; } } }
a.cc:1:1: error: 'include' does not name a type 1 | include <iostream> | ^~~~~~~ a.cc: In function 'int main()': a.cc:12:9: error: 'cin' was not declared in this scope 12 | cin >> N; | ^~~ a.cc:37:25: error: 'cout' was not declared in this scope 37 | cout << max << "\n"; | ^~~~ a.cc:39:25: error: 'cout' was not declared in this scope 39 | cout << wari << "\n"; | ^~~~
s280032954
p00274
Java
import java.io.*; import java.math.*; import java.util.*; public class Main0279{ public static void main(String[] args) throws IOException{ Scanner r = new Scanner(System.in); int N; int total; int zero; int flag; while(r.hasNext()){ N = r.nextInt(); if(N == 0)break; int[] gatya = new int[N]; total = 0; zero = 0; flag = 0; for(int i=0;i<N;i++){ gatya[i] = r.nextInt(); if(gatya[i] == 0) zero++; if(gatya[i] >= 2) flag=1; } if(flag == 0) System.out.println("NA"); else System.out.println(N-zero+1); } } }
Main.java:5: error: class Main0279 is public, should be declared in a file named Main0279.java public class Main0279{ ^ 1 error
s697870846
p00274
Java
import java.util.Scanner; class Main1{ public void solve(){ Scanner sc = new Scanner(System.in); int syurui, stok; int hairetu[]; int j = 0; syurui = sc.nextInt(); hairetu = new int[syurui]; for(int i = 0; i < syurui; i++){ stok = sc.nextInt(); hairetu[j] = stok; j += 1; } if(stok == 0){ System.out.print("N#A"); }else if(syurui == 1){ System.out.print(2); }else{ System.out.print(syurui+1); } } public static void main(String[] args){ Main obj = new Main1(); obj.solve(); }
Main.java:32: error: reached end of file while parsing } ^ 1 error
s426938647
p00274
Java
import java.util.Scanner; public class Main{ public void solve(){ Scanner sc =new Scanner(System.in); int N,su; int one = 0; int some = 1; N = sc.nextInt(); while(N != 0){ for(int i=0;i<N;i++){ su = sc.nextInt(); if(su <= 1){ one++; }else{ some++; } } if(some >= 2){ System.out.println(one+some); }else{ System.out.println("NA"); } int one = 0; int some = 1; N = sc.nextInt(); } } public static void main(String[]args){ Main obj = new Main(); obj.solve(); } }
Main.java:25: error: variable one is already defined in method solve() int one = 0; ^ Main.java:26: error: variable some is already defined in method solve() int some = 1; ^ 2 errors
s975422719
p00274
Java
import java.util.Scanner; public class Main4{ public void solve(){ Scanner sc =new Scanner(System.in); while(true){ int x =sc.nextInt(); if(x==0) break;//ループを抜ける int a = 0; boolean flag=false;//真偽の変数 for(int s=0;s<x;s++){ int r = sc.nextInt(); if(r>0) a++; if(r>1) flag = true; } if(!flag) System.out.println("NA"); else System.out.println(a+1); } } public static void main(String[] args){ Main4 obj = new Main4(); obj.solve(); } }
Main.java:2: error: class Main4 is public, should be declared in a file named Main4.java public class Main4{ ^ 1 error
s484032285
p00274
Java
import java.util.Scanner; public class ACMtest1 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); while(true){ int n=sc.nextInt(); if(n==0)break; int count = 0,sum =0; for(int i=0;i<n;i++){ int data = sc.nextInt(); if(data==0)count++; sum +=data; } if(sum<=2)System.out.println("NA"); else System.out.println((n+1-count)); } sc.close(); } }
Main.java:3: error: class ACMtest1 is public, should be declared in a file named ACMtest1.java public class ACMtest1 { ^ 1 error
s342050459
p00274
Java
import java.util.*; public class pck4 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int n; int[] k = new int[10000] while(true) { n = scan.nextInt(); if(n == 0) break; for(int i = 0;i < n;i++) { k[i] = scan.nextInt(); if(n == 1) { if(k[i] > 1) { System.out.println(2); } } else if(n >= 2) { System.out.println(n + 1); } } } } }
Main.java:6: error: ';' expected int[] k = new int[10000] ^ 1 error
s622128083
p00274
Java
import java.util.*; public class pck4 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int n; int k = new int[10000] while(true) { n = scan.nextInt(); if(n == 0) break; for(int i = 0;i < n;i++) { k[i] = scan.nextInt(); if(n == 1) { if(k[i] > 1) { System.out.println(2); } } else if(n >= 2) { System.out.println(n + 1); } } } } }
Main.java:6: error: ';' expected int k = new int[10000] ^ 1 error
s968891479
p00274
Java
import java.util.*; public class pck4 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int n; int [] k = new int[10000] while(true) { n = scan.nextInt(); if(n == 0) break; for(int i = 0;i < n;i++) { k[i] = scan.nextInt(); if(n == 1) { if(k[i] > 1) { System.out.println(2); } } else if(n >= 2) { System.out.println(n + 1); } } } } }
Main.java:6: error: ';' expected int [] k = new int[10000] ^ 1 error
s293960897
p00274
Java
import java.util.*; public class pck4 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int n; int [] k = new int[10000]; while(true) { n = scan.nextInt(); if(n == 0) break; for(int i = 0;i < n;i++) { k[i] = scan.nextInt(); if(n == 1) { if(k[i] > 1) { System.out.println(2); } } else if(n >= 2) { System.out.println(n + 1); } } } } }
Main.java:2: error: class pck4 is public, should be declared in a file named pck4.java public class pck4 { ^ 1 error
s124606809
p00274
Java
import java.util.*; public class pck4 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int n; int [] k = new int[10000]; while(true) { n = scan.nextInt(); if(n == 0) break; for(int i = 0;i < n;i++) { k[i] = scan.nextInt(); if(n == 1) { if(k[i] > 1) { System.out.println(2); } } else if(n >= 2) { System.out.println(n + 1); } } } } }
Main.java:2: error: class pck4 is public, should be declared in a file named pck4.java public class pck4 { ^ 1 error
s787829830
p00274
Java
import java.util.*; public class Pck4 { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int n; int [] k = new int[10000]; while(true) { n = scan.nextInt(); if(n == 0) break; for(int i = 0;i < n;i++) { k[i] = scan.nextInt(); if(n == 1) { if(k[i] > 1) { System.out.println(2); } } else if(n >= 2) { System.out.println(n + 1); } } } } }
Main.java:2: error: class Pck4 is public, should be declared in a file named Pck4.java public class Pck4 { ^ 1 error
s603429071
p00274
Java
import java.util.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); int[] k = new int[10000]; while(ture) { String ok = false; if(n == 0) break; int cnt = 0; for(int i = 0; i < n; i++) { k[i] = scan.nextInt(); if(k[i] >= 1) cnt++; if(k[i] >= 2) ok = true; } if(!ok) System.out.println("NA"); else System.out.println(cnt +1); } } }
Main.java:7: error: cannot find symbol while(ture) { ^ symbol: variable ture location: class Main Main.java:8: error: incompatible types: boolean cannot be converted to String String ok = false; ^ Main.java:14: error: incompatible types: boolean cannot be converted to String if(k[i] >= 2) ok = true; ^ Main.java:16: error: bad operand type String for unary operator '!' if(!ok) System.out.println("NA"); ^ 4 errors
s834500628
p00274
C
#include <stdio.h> int main(void) { int n; int ans; int k; int i; bool f; while (scanf("%d", &n), n){ ans = n + 1; f = false; for (i = 0; i < n; i++){ scanf("%d", &k); if (k == 0){ ans--;; } if (k > 1){ f = true; } } if (f == true){ printf("%d\n", ans); } else { printf("NA\n"); } } return (0); }
main.c: In function 'main': main.c:9:9: error: unknown type name 'bool' 9 | bool f; | ^~~~ 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 | main.c:13:21: error: 'false' undeclared (first use in this function) 13 | f = false; | ^~~~~ main.c:13:21: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:13:21: note: each undeclared identifier is reported only once for each function it appears in main.c:20:37: error: 'true' undeclared (first use in this function) 20 | f = true; | ^~~~ main.c:20:37: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
s341480996
p00274
C
#include <stdio.h> int main(void){ while(1){ int n, i, ans=0; int count=0;//1個以下しかない商品の種類の数 int a[10000]; scanf(" %d", &n); if(n==0) break; for(i=0; i<n; i++) { scanf(" %d", &a[i]); if(a[i] <=1) count++; } if(count == n) { printf("NA\n"); continue; } for(i=0; i<n; i++) { //1個以下のものを全て出し尽くす if(a[i] <=1) { ans += a[i]; a[i] = 0; } } ans += n-count+1; printf("%d\n", ans);0 } return 0; }
main.c: In function 'main': main.c:30:38: error: expected ';' before '}' token 30 | printf("%d\n", ans);0 | ^ | ; 31 | } | ~
s348287846
p00274
C
#include<stdio.h> int main(void) { int N,i,c; int *k,*kk; while(1){ scanf("%d",&N); if(N==0) break; k = new int [N]; kk = new int [N]; for(i=0;i<N;i++) kk[i] = 0; for(i=0;i<N;i++) scanf("%d",&k[i]); i=0,c=0; while(1){ if(k[i%N] > 0){ k[i%N]--; kk[i%N]++; c++; } if(kk[i%N] == 2){ printf("%d\n",c); break; } if(i > N * N){ printf("NA\n"); break; } i++; } } return 0; }
main.c: In function 'main': main.c:9:21: error: 'new' undeclared (first use in this function) 9 | k = new int [N]; | ^~~ main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in main.c:9:24: error: expected ';' before 'int' 9 | k = new int [N]; | ^~~~ | ; main.c:10:25: error: expected ';' before 'int' 10 | kk = new int [N]; | ^~~~ | ;
s428937100
p00274
C
#include<stdio.h> #include<string.h> int main(void){ int n,k,i,count=0,a[1000][3],j=0; while(scanf("%d",&n),n!=0){ for(i=1;i<=n;i++){ scanf("%d",&k); if(k>=2){ count=1; a[j]=i+n; break; } } if(count==0)strcpy(a[j],"NA"); j++; } for(i=0;i<j;i++)printf("%d\n",a[j]); return 0; }
main.c: In function 'main': main.c:10:25: error: assignment to expression with array type 10 | a[j]=i+n; | ^ main.c:14:31: error: passing argument 1 of 'strcpy' from incompatible pointer type [-Wincompatible-pointer-types] 14 | if(count==0)strcpy(a[j],"NA"); | ~^~~ | | | int * In file included from main.c:2: /usr/include/string.h:141:39: note: expected 'char * restrict' but argument is of type 'int *' 141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src) | ~~~~~~~~~~~~~~~~~^~~~~~
s112081869
p00274
C
#include<stdio.h> int main(void) { int N,k,m,j,t,i; scanf("%d",&N); while(N!=0){ m=0; j=0; for(i=0;i<N;i++){ scanf("%d",&k); if(k<2){ m=m+1; if(k==0){ j=j+1; } } } if(m==N){ printf("NA\n"); } else{ printf(n-j+1); } scanf("%d\n",&N); } return 0; }
main.c: In function 'main': main.c:22:32: error: 'n' undeclared (first use in this function) 22 | printf(n-j+1); | ^ main.c:22:32: note: each undeclared identifier is reported only once for each function it appears in
s200076718
p00274
C
#include<stdio.h> int main(void) { int N,k,m,j,i,; scanf("%d",&N); while(N!=0){ m=0; j=0; for(i=0;i<N;i++){ scanf("%d",&k); if(k<2){ m=m+1; if(k==0){ j=j+1; } } } if(m==N){ printf("NA\n"); } else{ printf("%d",N-j+1); } scanf("%d",&N); } return 0; }
main.c: In function 'main': main.c:4:23: error: expected identifier or '(' before ';' token 4 | int N,k,m,j,i,; | ^
s197864394
p00274
C
#include<stdio.h> int main(void) { int N,k,m,j,i; scanf("%d",&N); while(N!=0){ m=0; j=0; for(i=0;i<N;i++){ scanf("%d",&k); if(k<2){ m=m+1; if(k==0){ j=j+1; } } } if(m==N){ printf("NA\n"); } else{ printf("%d\n"N-j+1); } scanf("%d",&N); } return 0; }
main.c: In function 'main': main.c:22:38: error: expected ')' before 'N' 22 | printf("%d\n"N-j+1); | ~ ^ | )
s899586310
p00274
C
f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);}
main.c:1:1: warning: data definition has no type or storage class 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'f' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'n' defaults to 'int' [-Wimplicit-int] main.c:1:3: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:3: error: type of 'r' defaults to 'int' [-Wimplicit-int] main.c:1:3: error: type of 'x' defaults to 'int' [-Wimplicit-int] main.c:1:22: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf' +++ |+#include <stdio.h> 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} main.c:1:22: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch] 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} | ^~~~~ main.c:1:22: note: include '<stdio.h>' or provide a declaration of 'scanf' main.c:1:39: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} | ^~~~~~ main.c:1:39: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:39: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] main.c:1:39: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:66: error: expected ')' before 'for' 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} | ~ ^~~ | ) main.c:1:129: error: expected expression before '}' token 1 | f;main(n,i,r,x){for(;scanf("%d",&n),n;printf(f?"%d\n":"NA\n",r+1)for(f=r=i=0;i<n;i++)if(scanf("%d",&x),x)if(r++,x>1)f=1;exit(0);} | ^
s424349491
p00274
C++
#include <iostream> #include <cstdlib> using namespace std; int main(int argc, char** argv) { int N; int a; int i; while (1) { N = 0; a = 0; cin >> N; if (N == 0) { return 0; } int *k = new int [N]; for (i = 0; i < N; i++) { cin >> k[i]; } for (i = 0; i < N; i++) { if(k[i]>1) { a++; } } if (a > 1) { cout << "3" << endl; } else if (a == 1) { cout << "2" << endl; } else { cout << "NA" << endl; } delete[] *k; } }
a.cc: In function 'int main(int, char**)': a.cc:40:18: error: type 'int' argument given to 'delete', expected pointer 40 | delete[] *k; | ^~
s304537489
p00274
C++
#include <iostream> #include <cstdlib> using namespace std; int main(int argc, char** argv) { int N; int a, b, c; int i; while (1) { N = 0; a = 0; b = 0; c = 0; cin >> N; if (N == 0) { return 0; } int *k = new int [N]; for (i = 0; i < N; i++) { cin >> k[i]; } for (i = 0; i < N; i++) { if(k[i] > 1) { a++; } if(k[i] == 0) { b++; } if(k[i] == 0) { c++; } if (a > 0 && b > 0) { cout << "3" << endl; } else if (a == 1) { cout << "2" << endl; } else { cout << "NA" << endl; } delete[] k; } }
a.cc: In function 'int main(int, char**)': a.cc:48:2: error: expected '}' at end of input 48 | } | ^ a.cc:5:33: note: to match this '{' 5 | int main(int argc, char** argv) { | ^
s053544318
p00274
C++
#include <cstdio> #include <vector> using namespace std; int N; int main(){ while(1){ start: scanf("%d",&N); if(N == 0)break; vector<int> data; bool flag = false; for(int i=0;i<N;i++){ int tmp; scanf("%d",&tmp); if(tmp > 1) flag = true; data.push_back(tmp); } if(N == 1){ printf("2\n"); goto start; } if(!flag){ printf("NA\n"); goto start; } sort(data.begin(),data.end()); int ans = 0; for(int i=1;i<N;i++)ans += data[i]; printf("%d\n",ans); } return 0; }
a.cc: In function 'int main()': a.cc:32:9: error: 'sort' was not declared in this scope; did you mean 'short'? 32 | sort(data.begin(),data.end()); | ^~~~ | short
s434699129
p00274
C++
#include <cstdio> #include <vector> int N; int main(){ while(1){ start: scanf("%d",&N); if(N == 0)break; std::vector<int> data; bool flag = false; for(int i=0;i<N;i++){ int tmp; scanf("%d",&tmp); if(tmp > 1) flag = true; data.push_back(tmp); } if(N == 1){ printf("2\n"); goto start; } if(!flag){ printf("NA\n"); goto start; } std::sort(data.begin(),data.end()); int ans = 0; for(int i=1;i<N;i++)ans += data[i]; printf("%d\n",ans); } return 0; }
a.cc: In function 'int main()': a.cc:30:14: error: 'sort' is not a member of 'std' 30 | std::sort(data.begin(),data.end()); | ^~~~
s601719970
p00274
C++
#include<stdio.h> int main(void) { int i,x,w,n,flg while(1) { scanf("%d",&n); if(n==0) break; w=n; for(i=0;i<n;i++){ scanf("%d",&x); if(x==0){ w=w-1; } if(x>=2){ flg=1; } } if(flg==1){ printf("%d\n",x+1) } else{ printf("NA\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:5:9: error: expected initializer before 'while' 5 | while(1) { | ^~~~~
s742180531
p00274
C++
#include<stdio.h> int main(void) { int i,x,w,n,flg; while(1) { flg=0; scanf("%d",&n); if(n==0) break; w=n; for(i=0;i<n;i++){ scanf("%d",&x); if(x==0){ w=w-1; } if(x>=2){ flg=1; } } if(flg==1){ printf("%d\n",x+1) } else{ printf("NA\n"); } } return 0; }
a.cc: In function 'int main()': a.cc:20:35: error: expected ';' before '}' token 20 | printf("%d\n",x+1) | ^ | ; 21 | } | ~
s709701790
p00274
C++
#include<iostream> #include<algorithm> using namespace std; int main(){ int n=0; int i=0; int j=0; int x=0; int g=0; int s[10005]; bool a=false; memset(s,0,sizeof(s)); cin>>n; while(n!=0){ for(i=0;i<n;i++){ cin>>x; if(x>=2){ a=true; } if(x!=0){ g++; } } if(a==false){ s[j]=1; }else{ s[j]=g+1; } a=false; g=0; cin>>n; j++; } i=0; while(s[i]!=0){ if(s[i]==1){ cout<<"NA"<<endl; }else{ cout<<s[i]<<endl; } i++; } }
a.cc: In function 'int main()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(s,0,sizeof(s)); | ^~~~~~ 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;
s187284113
p00274
C++
#include<iostream> #include<algorithm> #include<utility> using namespace std; int main(){ int n=0; int i=0; int j=0; int x=0; int g=0; int s[10005]; bool a=false; memset(s,0,sizeof(s)); cin>>n; while(n!=0){ for(i=0;i<n;i++){ cin>>x; if(x>=2){ a=true; } if(x!=0){ g++; } } if(a==false){ s[j]=1; }else{ s[j]=g+1; } a=false; g=0; cin>>n; j++; } i=0; while(s[i]!=0){ if(s[i]==1){ cout<<"NA"<<endl; }else{ cout<<s[i]<<endl; } i++; } }
a.cc: In function 'int main()': a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(s,0,sizeof(s)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<utility> +++ |+#include <cstring> 4 | using namespace std;
s431859772
p00274
C++
#include<stdio.h> int main(void) { int N,k[10000+1],i,bakatoy; scanf("%d",&N); for(i=1;i<=N;i++){ scanf("%d",&k[i]); bakatoy+=k[i]; } printf("%d",bakatoy-2); return 0;
a.cc: In function 'int main()': a.cc:11:18: error: expected '}' at end of input 11 | return 0; | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s452285566
p00274
C++
#include<stdio.h> int main(void) { int N,k[10000+1],i,bakatoy; scanf("%d",&N); for(i=1;i<=N;i++){ scanf("%d",&k[i]); bakatoy+=k[i]; } printf("%d",bakatoy-2); return 0;
a.cc: In function 'int main()': a.cc:11:18: error: expected '}' at end of input 11 | return 0; | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s202605812
p00274
C++
/*#include<stdio.h> int main(){ int i,j,N,x,y,b,p,an,ano,ans[365]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d%d%d%d",&x,&y,&b,&p); an = x*b; an+= y*p; if(b>4 && p>1){ ano =x*b+y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(4<b ){ ano = x*b + y*2 ; ano*=0.8; if(ano < an){ an = ano; } } else if(1<b){ ano = x*5 + y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(5>b&&2>p){ ano = x*5 + y*2; ano*=0.8; if(ano<an){ an = ano; } } ans[i]=an; } for(i=0;i<N;i++){ printf("%d\n",ans[i]); } return 0; } */ #include<iostream> using namespace std; int main(){ int N,i,j,k[10000],c=0; cin >> N; while(N!=0){ for(i=0;i<N;i++){ cin >>k[i] } for(i=0;i<N;i++){ if(k[i]>=2){ c++; } } if(c==0){ printf("NA\n"); } else{ printf("%d\n",N+1); } c=0; cin >> N; } return 0 }
a.cc: In function 'int main()': a.cc:52:27: error: expected ';' before '}' token 52 | cin >>k[i] | ^ | ; 53 | } | ~ a.cc:68:17: error: expected ';' before '}' token 68 | return 0 | ^ | ; 69 | } | ~
s674938226
p00274
C++
/*#include<stdio.h> int main(){ int i,j,N,x,y,b,p,an,ano,ans[365]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d%d%d%d",&x,&y,&b,&p); an = x*b; an+= y*p; if(b>4 && p>1){ ano =x*b+y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(4<b ){ ano = x*b + y*2 ; ano*=0.8; if(ano < an){ an = ano; } } else if(1<b){ ano = x*5 + y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(5>b&&2>p){ ano = x*5 + y*2; ano*=0.8; if(ano<an){ an = ano; } } ans[i]=an; } for(i=0;i<N;i++){ printf("%d\n",ans[i]); } return 0; } */ #include<iostream> using namespace std; int main(){ int N,i,j,k[10000],c[100000]={0}; cin >> N; while(N!=0){ for(i=0;i<N;i++){ cin >>k[i] } for(i=0;i<N;i++){ if(k[i]>=2){ c[j]++; } } if(c[j]==0) cout << NA << endl; else cout << N+1 << endl; cin >> N; } return 0 }
a.cc: In function 'int main()': a.cc:52:35: error: expected ';' before '}' token 52 | cin >>k[i] | ^ | ; 53 | } | ~ a.cc:60:33: error: 'NA' was not declared in this scope; did you mean 'N'? 60 | cout << NA << endl; | ^~ | N a.cc:65:17: error: expected ';' before '}' token 65 | return 0 | ^ | ; 66 | } | ~
s951571138
p00274
C++
/*#include<stdio.h> int main(){ int i,j,N,x,y,b,p,an,ano,ans[365]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d%d%d%d",&x,&y,&b,&p); an = x*b; an+= y*p; if(b>4 && p>1){ ano =x*b+y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(4<b ){ ano = x*b + y*2 ; ano*=0.8; if(ano < an){ an = ano; } } else if(1<b){ ano = x*5 + y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(5>b&&2>p){ ano = x*5 + y*2; ano*=0.8; if(ano<an){ an = ano; } } ans[i]=an; } for(i=0;i<N;i++){ printf("%d\n",ans[i]); } return 0; } */ #include<iostream> using namespace std; int main(){ int N,i,j,k[10000],c[100000]={0}; cin >> N; while(N!=0){ for(i=0;i<N;i++){ cin >>k[i] } for(i=0;i<N;i++){ if(k[i]>=2){ c[j]++; } } if(c[j]==0) cout << NA << endl; else cout << N+1 << endl; cin >> N; } return 0 }
a.cc: In function 'int main()': a.cc:52:35: error: expected ';' before '}' token 52 | cin >>k[i] | ^ | ; 53 | } | ~ a.cc:60:33: error: 'NA' was not declared in this scope; did you mean 'N'? 60 | cout << NA << endl; | ^~ | N a.cc:65:17: error: expected ';' before '}' token 65 | return 0 | ^ | ; 66 | } | ~
s709429796
p00274
C++
/*#include<stdio.h> int main(){ int i,j,N,x,y,b,p,an,ano,ans[365]; scanf("%d",&N); for(i=0;i<N;i++){ scanf("%d%d%d%d",&x,&y,&b,&p); an = x*b; an+= y*p; if(b>4 && p>1){ ano =x*b+y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(4<b ){ ano = x*b + y*2 ; ano*=0.8; if(ano < an){ an = ano; } } else if(1<b){ ano = x*5 + y*p; ano*=0.8; if(ano < an){ an = ano; } } else if(5>b&&2>p){ ano = x*5 + y*2; ano*=0.8; if(ano<an){ an = ano; } } ans[i]=an; } for(i=0;i<N;i++){ printf("%d\n",ans[i]); } return 0; } */ #include<iostream> using namespace std; int main(){ int N,i,j,k[10000],c[100000]={0}; cin >> N; while(N!=0){ for(i=0;i<N;i++){ cin >>k[i] } for(i=0;i<N;i++){ if(k[i]>=2){ c[j]++; } } if(c[j]==0) cout << NA << endl; else cout << N+1 << endl; cin >> N; } return 0 }
a.cc: In function 'int main()': a.cc:52:35: error: expected ';' before '}' token 52 | cin >>k[i] | ^ | ; 53 | } | ~ a.cc:60:33: error: 'NA' was not declared in this scope; did you mean 'N'? 60 | cout << NA << endl; | ^~ | N a.cc:65:17: error: expected ';' before '}' token 65 | return 0 | ^ | ; 66 | } | ~
s740925225
p00274
C++
#include<iostream> using namespace std; int main(){ int N[10000],i,j=0,k[10000],c[10000]={0}; cin >> N[j]; while(N[j]!=0){ for(i=0;i<N;i++){ cin >>k[i] } for(i=0;i<N;i++){ if(k[i]>=2){ c[j]++; } } j++; cin >> N[j]; } for(i=0;i<j;j+P+){ if(c[j]==0) cout << NA << endl; else cout << N[j]+1 << endl; } return 0 }
a.cc: In function 'int main()': a.cc:7:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 7 | for(i=0;i<N;i++){ | ~^~ a.cc:8:35: error: expected ';' before '}' token 8 | cin >>k[i] | ^ | ; 9 | } | ~ a.cc:10:26: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | for(i=0;i<N;i++){ | ~^~ a.cc:18:23: error: 'P' was not declared in this scope 18 | for(i=0;i<j;j+P+){ | ^ a.cc:18:25: error: expected primary-expression before ')' token 18 | for(i=0;i<j;j+P+){ | ^ a.cc:20:33: error: 'NA' was not declared in this scope; did you mean 'N'? 20 | cout << NA << endl; | ^~ | N a.cc:24:17: error: expected ';' before '}' token 24 | return 0 | ^ | ; 25 | } | ~
s350787963
p00274
C++
#include <iostream> using namespace std; int main() { int N; string str; int result = 0; while (cin >> N) { for (int i = 0; i < (int)str.size(); ++i) { char ch = str[i]; if (ch != "") { int k = atoi(ch); if (k >= 2) { result++; } } } } if (result == 0) { cout << "NA" <<endl; } else { cout << result; } return 0; }
a.cc: In function 'int main()': a.cc:12:14: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 12 | if (ch != "") { | ~~~^~~~~ a.cc:13:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 13 | int k = atoi(ch); | ^~ | | | char In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/stdlib.h:105:30: note: initializing argument 1 of 'int atoi(const char*)' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~
s324596676
p00274
C++
#include <iostream> using namespace std; int main() { int N; string str; int result = 0; while (cin >> N) { for (int i = 0; i < (int)str.size(); ++i) { char ch = str[i]; if (ch != ' ') { int k = atoi(ch); if (k >= 2) { result++; } } } } if (result == 0) { cout << "NA" <<endl; } else { cout << result; } return 0; }
a.cc: In function 'int main()': a.cc:13:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 13 | int k = atoi(ch); | ^~ | | | char In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/stdlib.h:105:30: note: initializing argument 1 of 'int atoi(const char*)' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~
s869975335
p00274
C++
#include <iostream> #include <stdlib.h> using namespace std; int main() { int N; string str; int result = 0; while (cin >> N) { for (int i = 0; i < (int)str.size(); ++i) { char ch = str[i]; if (ch != ' ') { int k = atoi(ch); if (k >= 2) { result++; } } } } if (result == 0) { cout << "NA" <<endl; } else { cout << result; } return 0; }
a.cc: In function 'int main()': a.cc:14:22: error: invalid conversion from 'char' to 'const char*' [-fpermissive] 14 | int k = atoi(ch); | ^~ | | | char In file included from /usr/include/c++/14/cstdlib:79, from /usr/include/c++/14/ext/string_conversions.h:43, from /usr/include/c++/14/bits/basic_string.h:4154, from /usr/include/c++/14/string:54, 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/stdlib.h:105:30: note: initializing argument 1 of 'int atoi(const char*)' 105 | extern int atoi (const char *__nptr) | ~~~~~~~~~~~~^~~~~~
s765716823
p00274
C++
#include<iostream> using namespace std; int main(){ while(true){ { int N; cin>>N; if(N==0)break; int count=0; bool na=true; for(int i=0;i<N;i++){ int k; cin>>k; if(k>1)na=false; if(k>0)count++; } if(na==true) cout<<"NA"<<endl; else cout<<count+1<<endl; } return 0; }
a.cc: In function 'int main()': a.cc:23:10: error: expected '}' at end of input 23 | } | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s087209043
p00274
C++
#include<iostream> using namespace std; int main(){ int n; int k[10000]; int i=0; int j=0; int min=0; int not=0; int result[10000]; for(j=0;true;j++){ min=0; not=0; cin>>n; if(n==0){ break; } for(i=0;i<n;i++){ cin>>k[i]; if(k[i]!=0){ min+=1; } if((k[i]==1)||(k[i]==0)){ not+=1; } if(not==n){ result[j]=-1; }else{ result[j]=min+1; } } } for(i=0;i<j;i++){ if(result[i]==-1){ cout<<"NA"; }else{ cout<<result[i]; } if(i+1!=j){ cout<<endl; } } }
a.cc: In function 'int main()': a.cc:12:13: error: expected unqualified-id before 'not' token 12 | int not=0; | ^~~ a.cc:18:20: error: expected primary-expression before '=' token 18 | not=0; | ^ a.cc:33:36: error: expected primary-expression before '+=' token 33 | not+=1; | ^~ a.cc:36:31: error: expected primary-expression before '==' token 36 | if(not==n){ | ^~
s065795087
p00274
C++
#include <iostream> int temp[10000]; int main(){ for(true){ int n; cin >> n; if(n == 0) return 0; for(int i = 0; i < n; i++){ cin >> temp[i]; } int cont = 0; for(int i = 0; i < 2; i++){ if(temp[i] > 0){ temp[i]--; cont++; if(i == 1){ cout << endl; break; } } } cout << "NA" << endl; } }
a.cc: In function 'int main()': a.cc:5:17: error: expected ';' before ')' token 5 | for(true){ | ^ | ; a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^ a.cc:23:10: error: expected ';' before '}' token 23 | } | ^ | ; 24 | } | ~ a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^ a.cc:23:10: error: expected ')' before '}' token 23 | } | ^ | ) 24 | } | ~ a.cc:5:12: note: to match this '(' 5 | for(true){ | ^ a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^
s504474982
p00274
C++
#include <iostream> using namespace std; int temp[10000]; int main(){ for(true){ int n; cin >> n; if(n == 0) return 0; for(int i = 0; i < n; i++){ cin >> temp[i]; } int cont = 0; for(int i = 0; i < 2; i++){ if(temp[i] > 0){ temp[i]--; cont++; if(i == 1){ cout << endl; break; } } } cout << "NA" << endl; } }
a.cc: In function 'int main()': a.cc:5:17: error: expected ';' before ')' token 5 | for(true){ | ^ | ; a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^ a.cc:23:10: error: expected ';' before '}' token 23 | } | ^ | ; 24 | } | ~ a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^ a.cc:23:10: error: expected ')' before '}' token 23 | } | ^ | ) 24 | } | ~ a.cc:5:12: note: to match this '(' 5 | for(true){ | ^ a.cc:24:1: error: expected primary-expression before '}' token 24 | } | ^
s004632858
p00274
C++
#include <iostream> using namespace std; int temp[10000]; int main(){ for(true){ int n; cin >> n; if(n == 0) return 0; for(int i = 0; i < n; i++){ cin >> temp[i]; } int cont = 0; for(int i = 0; i < 2; i++){ if(temp[i] > 0){ temp[i]--; cont++; if(i == 1){ cout << endl; break; } } } cout << "NA" << endl; } return 0; }
a.cc: In function 'int main()': a.cc:5:17: error: expected ';' before ')' token 5 | for(true){ | ^ | ; a.cc:24:9: error: expected primary-expression before 'return' 24 | return 0; | ^~~~~~ a.cc:23:10: error: expected ';' before 'return' 23 | } | ^ | ; 24 | return 0; | ~~~~~~ a.cc:24:9: error: expected primary-expression before 'return' 24 | return 0; | ^~~~~~ a.cc:23:10: error: expected ')' before 'return' 23 | } | ^ | ) 24 | return 0; | ~~~~~~ a.cc:5:12: note: to match this '(' 5 | for(true){ | ^
s321033993
p00274
C++
#include<bits/stdc++.h> ?? using namespace std; ?? ?? int main() { ?? ????int n; ????while( cin >> n, n ) { ????????int cnt = 0,v; bool flag = false; ????????for(int i=0;i<n;++i) { ????????????cin >> v; ????????????if( v >= 2 ) flag = true; if( v >= 1 ) ++cnt; ????????} ????????if( !flag ) puts("NA"); ????????else cout << cnt + 1 << endl; ????} ????return 0; }
a.cc:2:1: error: expected unqualified-id before '?' token 2 | ?? | ^ a.cc:4:1: error: expected unqualified-id before '?' token 4 | ?? | ^
s824546201
p00274
C++
#include<bits/stdc++.h> using namespace std; int main() { ????int n; ????while( cin >> n, n ) { ????????int cnt = 0,v; bool flag = false; ????????for(int i=0;i<n;++i) { ????????????cin >> v; ????????????if( v >= 2 ) flag = true; if( v >= 1 ) ++cnt; ????????} ????????if( !flag ) puts("NA"); ????????else cout << cnt + 1 << endl; ????} ????return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: expected primary-expression before '?' token 4 | ????int n; | ^ a.cc:4:2: error: expected primary-expression before '?' token 4 | ????int n; | ^ a.cc:4:3: error: expected primary-expression before '?' token 4 | ????int n; | ^ a.cc:4:4: error: expected primary-expression before '?' token 4 | ????int n; | ^ a.cc:4:5: error: expected primary-expression before 'int' 4 | ????int n; | ^~~ a.cc:4:5: error: expected ':' before 'int' 4 | ????int n; | ^~~ | : a.cc:4:5: error: expected primary-expression before 'int' 4 | ????int n; | ^~~ a.cc:4:5: error: expected ':' before 'int' 4 | ????int n; | ^~~ | : a.cc:4:5: error: expected primary-expression before 'int' 4 | ????int n; | ^~~ a.cc:4:5: error: expected ':' before 'int' 4 | ????int n; | ^~~ | : a.cc:4:5: error: expected primary-expression before 'int' 4 | ????int n; | ^~~ a.cc:4:5: error: expected ':' before 'int' 4 | ????int n; | ^~~ | : a.cc:4:5: error: expected primary-expression before 'int' 4 | ????int n; | ^~~ a.cc:5:1: error: expected primary-expression before '?' token 5 | ????while( cin >> n, n ) { | ^ a.cc:5:2: error: expected primary-expression before '?' token 5 | ????while( cin >> n, n ) { | ^ a.cc:5:3: error: expected primary-expression before '?' token 5 | ????while( cin >> n, n ) { | ^ a.cc:5:4: error: expected primary-expression before '?' token 5 | ????while( cin >> n, n ) { | ^ a.cc:5:5: error: expected primary-expression before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ a.cc:5:5: error: expected ':' before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ | : a.cc:5:5: error: expected primary-expression before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ a.cc:5:5: error: expected ':' before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ | : a.cc:5:5: error: expected primary-expression before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ a.cc:5:5: error: expected ':' before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ | : a.cc:5:5: error: expected primary-expression before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ a.cc:5:5: error: expected ':' before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ | : a.cc:5:5: error: expected primary-expression before 'while' 5 | ????while( cin >> n, n ) { | ^~~~~ a.cc:16:1: error: expected primary-expression before '?' token 16 | ????return 0; | ^ a.cc:16:2: error: expected primary-expression before '?' token 16 | ????return 0; | ^ a.cc:16:3: error: expected primary-expression before '?' token 16 | ????return 0; | ^ a.cc:16:4: error: expected primary-expression before '?' token 16 | ????return 0; | ^ a.cc:16:5: error: expected primary-expression before 'return' 16 | ????return 0; | ^~~~~~ a.cc:16:5: error: expected ':' before 'return' 16 | ????return 0; | ^~~~~~ | : a.cc:16:5: error: expected primary-expression before 'return' 16 | ????return 0; | ^~~~~~ a.cc:16:5: error: expected ':' before 'return' 16 | ????return 0; | ^~~~~~ | : a.cc:16:5: error: expected primary-expression before 'return' 16 | ????return 0; | ^~~~~~ a.cc:16:5: error: expected ':' before 'return' 16 | ????return 0; | ^~~~~~ | : a.cc:16:5: error: expected primary-expression before 'return' 16 | ????return 0; | ^~~~~~ a.cc:16:5: error: expected ':' before 'return' 16 | ????return 0; | ^~~~~~ | : a.cc:16:5: error: expected primary-expression before 'return' 16 | ????return 0; | ^~~~~~
s527129660
p00274
C++
#include<bits/stdc++.h> using namespace std; int main() { ??int n; ??while( cin >> n, n ) { ??????int cnt = 0,v; bool flag = false; ??????for(int i=0;i<n;++i) { ??????????cin >> v; ??????????if( v >= 2 ) flag = true; if( v >= 1 ) ++cnt; ??????} ??????if( !flag ) puts("NA"); ??????else cout << cnt + 1 << endl; ??} ??return 0; }
a.cc: In function 'int main()': a.cc:4:1: error: expected primary-expression before '?' token 4 | ??int n; | ^ a.cc:4:2: error: expected primary-expression before '?' token 4 | ??int n; | ^ a.cc:4:3: error: expected primary-expression before 'int' 4 | ??int n; | ^~~ a.cc:4:3: error: expected ':' before 'int' 4 | ??int n; | ^~~ | : a.cc:4:3: error: expected primary-expression before 'int' 4 | ??int n; | ^~~ a.cc:4:3: error: expected ':' before 'int' 4 | ??int n; | ^~~ | : a.cc:4:3: error: expected primary-expression before 'int' 4 | ??int n; | ^~~ a.cc:5:1: error: expected primary-expression before '?' token 5 | ??while( cin >> n, n ) { | ^ a.cc:5:2: error: expected primary-expression before '?' token 5 | ??while( cin >> n, n ) { | ^ a.cc:5:3: error: expected primary-expression before 'while' 5 | ??while( cin >> n, n ) { | ^~~~~ a.cc:5:3: error: expected ':' before 'while' 5 | ??while( cin >> n, n ) { | ^~~~~ | : a.cc:5:3: error: expected primary-expression before 'while' 5 | ??while( cin >> n, n ) { | ^~~~~ a.cc:5:3: error: expected ':' before 'while' 5 | ??while( cin >> n, n ) { | ^~~~~ | : a.cc:5:3: error: expected primary-expression before 'while' 5 | ??while( cin >> n, n ) { | ^~~~~ a.cc:16:1: error: expected primary-expression before '?' token 16 | ??return 0; | ^ a.cc:16:2: error: expected primary-expression before '?' token 16 | ??return 0; | ^ a.cc:16:3: error: expected primary-expression before 'return' 16 | ??return 0; | ^~~~~~ a.cc:16:3: error: expected ':' before 'return' 16 | ??return 0; | ^~~~~~ | : a.cc:16:3: error: expected primary-expression before 'return' 16 | ??return 0; | ^~~~~~ a.cc:16:3: error: expected ':' before 'return' 16 | ??return 0; | ^~~~~~ | : a.cc:16:3: error: expected primary-expression before 'return' 16 | ??return 0; | ^~~~~~
s574675908
p00274
C++
#include<bits/stdc++.h> using namespace std; int main() {???? int n;???? while( cin >> n, n ) { ????????int cnt = 0,v; ????????for(int i=0;i<n;++i) { ????????????cin >> v; ????????????if( v >= 2 ) ++cnt; ????????} ????????if( cnt == 0 ) puts("NA"); ????????else cout << cnt + 1 << endl; ????} ????return 0; }
a.cc: In function 'int main()': a.cc:3:13: error: expected primary-expression before '?' token 3 | int main() {???? | ^ a.cc:3:14: error: expected primary-expression before '?' token 3 | int main() {???? | ^ a.cc:3:15: error: expected primary-expression before '?' token 3 | int main() {???? | ^ a.cc:3:16: error: expected primary-expression before '?' token 3 | int main() {???? | ^ a.cc:4:1: error: expected primary-expression before 'int' 4 | int n;???? | ^~~ a.cc:3:17: error: expected ':' before 'int' 3 | int main() {???? | ^ | : 4 | int n;???? | ~~~ a.cc:4:1: error: expected primary-expression before 'int' 4 | int n;???? | ^~~ a.cc:3:17: error: expected ':' before 'int' 3 | int main() {???? | ^ | : 4 | int n;???? | ~~~ a.cc:4:1: error: expected primary-expression before 'int' 4 | int n;???? | ^~~ a.cc:3:17: error: expected ':' before 'int' 3 | int main() {???? | ^ | : 4 | int n;???? | ~~~ a.cc:4:1: error: expected primary-expression before 'int' 4 | int n;???? | ^~~ a.cc:3:17: error: expected ':' before 'int' 3 | int main() {???? | ^ | : 4 | int n;???? | ~~~ a.cc:4:1: error: expected primary-expression before 'int' 4 | int n;???? | ^~~ a.cc:4:7: error: expected primary-expression before '?' token 4 | int n;???? | ^ a.cc:4:8: error: expected primary-expression before '?' token 4 | int n;???? | ^ a.cc:4:9: error: expected primary-expression before '?' token 4 | int n;???? | ^ a.cc:4:10: error: expected primary-expression before '?' token 4 | int n;???? | ^ a.cc:5:1: error: expected primary-expression before 'while' 5 | while( cin >> n, n ) { | ^~~~~ a.cc:4:11: error: expected ':' before 'while' 4 | int n;???? | ^ | : 5 | while( cin >> n, n ) { | ~~~~~ a.cc:5:1: error: expected primary-expression before 'while' 5 | while( cin >> n, n ) { | ^~~~~ a.cc:4:11: error: expected ':' before 'while' 4 | int n;???? | ^ | : 5 | while( cin >> n, n ) { | ~~~~~ a.cc:5:1: error: expected primary-expression before 'while' 5 | while( cin >> n, n ) { | ^~~~~ a.cc:4:11: error: expected ':' before 'while' 4 | int n;???? | ^ | : 5 | while( cin >> n, n ) { | ~~~~~ a.cc:5:1: error: expected primary-expression before 'while' 5 | while( cin >> n, n ) { | ^~~~~ a.cc:4:11: error: expected ':' before 'while' 4 | int n;???? | ^ | : 5 | while( cin >> n, n ) { | ~~~~~ a.cc:5:1: error: expected primary-expression before 'while' 5 | while( cin >> n, n ) { | ^~~~~ a.cc:14:1: error: expected primary-expression before '?' token 14 | ????return 0; | ^ a.cc:14:2: error: expected primary-expression before '?' token 14 | ????return 0; | ^ a.cc:14:3: error: expected primary-expression before '?' token 14 | ????return 0; | ^ a.cc:14:4: error: expected primary-expression before '?' token 14 | ????return 0; | ^ a.cc:14:5: error: expected primary-expression before 'return' 14 | ????return 0; | ^~~~~~ a.cc:14:5: error: expected ':' before 'return' 14 | ????return 0; | ^~~~~~ | : a.cc:14:5: error: expected primary-expression before 'return' 14 | ????return 0; | ^~~~~~ a.cc:14:5: error: expected ':' before 'return' 14 | ????return 0; | ^~~~~~ | : a.cc:14:5: error: expected primary-expression before 'return' 14 | ????return 0; | ^~~~~~ a.cc:14:5: error: expected ':' before 'return' 14 | ????return 0; | ^~~~~~ | : a.cc:14:5: error: expected primary-expression before 'return' 14 | ????return 0; | ^~~~~~ a.cc:14:5: error: expected ':' before 'return' 14 | ????return 0; | ^~~~~~ | : a.cc:14:5: error: expected primary-expression before 'return' 14 | ????return 0; | ^~~~~~
s630269974
p00274
C++
#include<bits/stdc++.h> using namespace std; int main() { int n; while(cin>>n,n){ int cnt=0,v; bool f = false; for(int i=0;i<n;++i) { cin >> v; if( v >= 2) f = true; if( v ) ++cnt; } if(!flag)puts("NA"); else cout << cnt + 1 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:15:5: error: 'flag' was not declared in this scope 15 | if(!flag)puts("NA"); | ^~~~
s784608809
p00274
C++
#include<iostream> using namespace std; int main(){ while(1){ int N; cin>>N; if(N==0) break; int cnt0=0; int cnt1=0; for(int i=0;i<N;i++){ int k; cin>>k; if(k==0) cnt0++; else if(k==1) cnt1++; } if(b<5){ b=5; } if(p<2){ p=2; } if(cnt0+cnt1==N){ cout<<"NA"<<endl; } else{ cout<<N-cnt0+1<<endl; } } return 0; }
a.cc: In function 'int main()': a.cc:25:20: error: 'b' was not declared in this scope 25 | if(b<5){ | ^ a.cc:28:20: error: 'p' was not declared in this scope 28 | if(p<2){ | ^
s676221733
p00274
C++
#include<iostream> using namespace std; #include<algorithm> int main() { int n; while (cin >> n && n != 0) { bool na = false; int m; for (int i = 0; i < n; ++i) { int k; cin >> k; if (k < 1) { na = true; } if (k > 0) { ++m; } } if() cout << m + 1 << endl; } return 0; }
a.cc: In function 'int main()': a.cc:16:20: error: expected primary-expression before ')' token 16 | if() | ^
s522401482
p00274
C++
#include<iostream> using namespace std; int main(){ int n,i,j; int a[1000]; while(1){ cin>>n; int c=0; int s=0; if(n==0)break; for(i=0;i<n;i++){ cin>>a[i]; if(a[i]<=1){ c++; if(a[i]==0){ s++; } } } if(n==1&&a[0]>=2){ cout<<2<<endl; } else{ if(c==n||n==1&&a[0]<=1||){ cout<<"NA"<<endl; } else{ cout<<n-s+1<<endl; } } } return 0; }
a.cc: In function 'int main()': a.cc:24:49: error: expected primary-expression before ')' token 24 | if(c==n||n==1&&a[0]<=1||){ | ^
s426381325
p00274
C++
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); for (;;) { int n = sc.nextInt(); if(n==0) { break; } boolean f=false; int c=0; for(int i=0;i<n;i++) { int m=sc.nextInt(); if(m>=2) { f=true; } if(m==0) { c++; } } System.out.println(f&&n>0?n+1-c:"NA"); } } }
a.cc:1:1: error: 'import' does not name a type 1 | import java.util.Scanner; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Main { | ^~~~~~
s697816669
p00274
C++
#include<bits/stdc++.h> using namespace std; int main() { int a[10001], b, c, d, n, i; a[0] = 0; cin >> n; while(n != 0) { cin >> n; for(i = 1; i <= n; i++) { cin >> a[i]; if (a[0] < a[i]) { temp = a[0]; a[0] = a[i]; a[i] = temp; } } if (n != 1 && a[0] >= 2) { cout << 3 << endl; }else if (n == 1) { cout << 2 << endl; }else if (a[0] == 1) { cout << "NA"; } } }
a.cc: In function 'int main()': a.cc:13:33: error: 'temp' was not declared in this scope; did you mean 'tm'? 13 | temp = a[0]; | ^~~~ | tm