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("...
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*...
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; } //m...
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; ...
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; } //m...
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; ...
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 | ...
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; ...
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;...
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+...
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+...
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;}...
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 su...
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...
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--; ...
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 = s...
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<...
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...
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)) | ...
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)){ | ...
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(...
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; } //m...
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 'flo...
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]...
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; e...
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; | ...
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; }...
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=b...
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...
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;)); | ~ ...
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...
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;); | ~ ...
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(i...
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;){ | ~ ^ | ...
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){ ...
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++;){ ...
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 befo...
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 << end...
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) { Syste...
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_istr...
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_istr...
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::basi...
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...
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.c...
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 ...
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 <<...
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]; ...
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(); ...
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(); i...
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; } ...
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; } ...
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) { Sy...
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) { Syst...
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) { S...
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) { ...
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) { ...
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) { ...
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...
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...
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 { print...
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...
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個...
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...
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 |...
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; } ...
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],"N...
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...
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...
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 ...
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 = tru...
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; da...
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; ...
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...
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==fal...
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> ...
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; } }...
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 ...
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; } }...
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 declar...
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; } }...
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 declar...
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; } }...
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 declar...
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 <<...
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] | ...
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 (resul...
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); | ...
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 (resu...
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...
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++; } } ...
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...
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...
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 befo...
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 ...
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 | } | ...
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; ...
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 | } | ...
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; ...
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' ...
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"); ???????...
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 <...
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: er...
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; ?...
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: exp...
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 ...
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...
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||){ ...
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 ...
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; }...
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