submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s834934826
p00000
C
#include<stdio.h> int main(){ int = a, b; for ( a = 1; a<=9 ; a++){ for( b = 1; b<=9 ; b++){ printf("%dx%d=%d\n", a, b, a*b); } }
main.c: In function 'main': main.c:3:7: error: expected identifier or '(' before '=' token 3 | int = a, b; | ^ main.c:4:9: error: 'a' undeclared (first use in this function) 4 | for ( a = 1; a<=9 ; a++){ | ^ main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in main.c:5:10: error: 'b' undeclared (first use in this function) 5 | for( b = 1; b<=9 ; b++){ | ^ main.c:8:3: error: expected declaration or statement at end of input 8 | } | ^
s033830241
p00000
C
#include<stdio.h> int main(){ int = a, b; for ( a = 1; a<=9 ; a++){ for( b = 1; b<=9 ; b++){ printf("%d x%d=%d\n", a, b, a*b); } }
main.c: In function 'main': main.c:3:7: error: expected identifier or '(' before '=' token 3 | int = a, b; | ^ main.c:4:9: error: 'a' undeclared (first use in this function) 4 | for ( a = 1; a<=9 ; a++){ | ^ main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in main.c:5:10: error: 'b' undeclared (first use in this function) 5 | for( b = 1; b<=9 ; b++){ | ^ main.c:8:3: error: expected declaration or statement at end of input 8 | } | ^
s566250183
p00000
C
#include<stdio.h> int main(){ int = a, b; for ( a = 1; a<10 ; a++){ for( b = 1; b<10 ; b++){ printf("%d x%d=%d\n", a, b, a*b); } } return 0; }
main.c: In function 'main': main.c:3:7: error: expected identifier or '(' before '=' token 3 | int = a, b; | ^ main.c:4:9: error: 'a' undeclared (first use in this function) 4 | for ( a = 1; a<10 ; a++){ | ^ main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in main.c:5:10: error: 'b' undeclared (first use in this function) 5 | for( b = 1; b<10 ; b++){ | ^
s208212470
p00000
C
#include<stdio.h> int main(){ int = a, b; a =1, b =1; for ( a = 1; a<10 ; a++){ for( b = 1; b<10 ; b++){ printf("%d x%d=%d\n", a, b, a*b); } } return 0; }
main.c: In function 'main': main.c:3:7: error: expected identifier or '(' before '=' token 3 | int = a, b; | ^ main.c:4:4: error: 'a' undeclared (first use in this function) 4 | a =1, b =1; | ^ main.c:4:4: note: each undeclared identifier is reported only once for each function it appears in main.c:4:10: error: 'b' undeclared (first use in this function) 4 | a =1, b =1; | ^
s448844766
p00000
C
int main(){ int = a, b; for ( a = 1; a<=9 ; a++){ for( b = 1; b<=9 ; b++){ printf("%dx%d=%d\n", a, b, a*b); } } return 0; }
main.c: In function 'main': main.c:3:7: error: expected identifier or '(' before '=' token 3 | int = a, b; | ^ main.c:4:9: error: 'a' undeclared (first use in this function) 4 | for ( a = 1; a<=9 ; a++){ | ^ main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in main.c:5:10: error: 'b' undeclared (first use in this function) 5 | for( b = 1; b<=9 ; b++){ | ^ main.c:6:7: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 6 | printf("%dx%d=%d\n", a, b, a*b); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main.c:6:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 6 | printf("%dx%d=%d\n", a, b, a*b); | ^~~~~~ main.c:6:7: note: include '<stdio.h>' or provide a declaration of 'printf'
s253163163
p00000
C
main(){retrun 0;}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){retrun 0;} | ^~~~ main.c: In function 'main': main.c:1:8: error: 'retrun' undeclared (first use in this function) 1 | main(){retrun 0;} | ^~~~~~ main.c:1:8: note: each undeclared identifier is reported only once for each function it appears in main.c:1:14: error: expected ';' before numeric constant 1 | main(){retrun 0;} | ^~ | ;
s007351954
p00000
C
#include<stdio.h> int main(){ int i,j,multiplication; i=1; j=1; multiplication=0; while(i<=9){ multiplication=i*j; printf("%d x %d = %d\n",i,j,multiplication); j+=1; if(j == 10) { i+=1; j=1; } } return0; }
main.c: In function 'main': main.c:16:3: error: 'return0' undeclared (first use in this function) 16 | return0; | ^~~~~~~ main.c:16:3: note: each undeclared identifier is reported only once for each function it appears in
s411972807
p00000
C
#iunclude<stdio.h> int main(void){ int i,n; for(i=1;i<=9;i++){ for(n=1;n<=9;n++){ printf("%dx%d=%d\n",i,n,i*n); } } return 0; }> http://www.nicovideo.jp/watch/sm14518246
main.c:1:2: error: invalid preprocessing directive #iunclude; did you mean #include? 1 | #iunclude<stdio.h> | ^~~~~~~~ | include main.c: In function 'main': main.c:7:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 7 | printf("%dx%d=%d\n",i,n,i*n); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | #iunclude<stdio.h> main.c:7:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 7 | printf("%dx%d=%d\n",i,n,i*n); | ^~~~~~ main.c:7:25: note: include '<stdio.h>' or provide a declaration of 'printf' main.c: At top level: main.c:11:2: error: expected identifier or '(' before '>' token 11 | }> http://www.nicovideo.jp/watch/sm14518246 | ^
s301549410
p00000
C
#iunclude<stdio.h> int main(void){ int i,n; for(i=1;i<=9;i++){ for(n=1;n<=9;n++){ printf("%dx%d=%d\n",i,n,i*n); } } return 0; }
main.c:1:2: error: invalid preprocessing directive #iunclude; did you mean #include? 1 | #iunclude<stdio.h> | ^~~~~~~~ | include main.c: In function 'main': main.c:7:25: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 7 | printf("%dx%d=%d\n",i,n,i*n); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | #iunclude<stdio.h> main.c:7:25: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 7 | printf("%dx%d=%d\n",i,n,i*n); | ^~~~~~ main.c:7:25: note: include '<stdio.h>' or provide a declaration of 'printf'
s556522890
p00000
C
i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;}
main.c:1:1: warning: data definition has no type or storage class 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:36: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} main.c:1:36: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} | ^~~~~~ main.c:1:36: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:67: error: 'exit' undeclared (first use in this function) 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} | ^~~~ main.c:1:1: note: 'exit' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>' +++ |+#include <stdlib.h> 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} main.c:1:67: note: each undeclared identifier is reported only once for each function it appears in 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} | ^~~~ main.c:1:71: error: expected ';' before numeric constant 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);exit 0;} | ^~ | ;
s330905172
p00000
C
#include<stdio.h> int main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}returnツ 0;}
main.c: In function 'main': main.c:2:94: error: stray '\343' in program 2 | int main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}return<U+30C4><U+3000>0;} | ^~~~~~~~ main.c:2:86: error: 'return\U000030c4' undeclared (first use in this function) 2 | int main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}returnツ 0;} | ^~~~~~~~ main.c:2:86: note: each undeclared identifier is reported only once for each function it appears in main.c:2:94: error: expected ';' before numeric constant 2 | int main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}returnツ 0;} | ^ ~ | ;
s255477013
p00000
C
#include<stdio.h>main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}return 0;}
main.c:1:18: warning: extra tokens at end of #include directive 1 | #include<stdio.h>main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}return 0;} | ^~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s894416406
p00000
C
#include<stdio.h> main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;puts("%dx%d=%d",x,y,x*y);}return 0;}
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;puts("%dx%d=%d",x,y,x*y);}return 0;} | ^~~~ main.c: In function 'main': main.c:2:52: error: too many arguments to function 'puts' 2 | main(){int i,x,y;for(i=0;i<81;i++){x=i/9+1;y=i%9+1;puts("%dx%d=%d",x,y,x*y);}return 0;} | ^~~~ In file included from main.c:1: /usr/include/stdio.h:714:12: note: declared here 714 | extern int puts (const char *__s); | ^~~~
s668501407
p00000
C
#include<stdio.h> main(){for(int i=0;i<81;i++){int x=i/9+1,y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}return 0;}
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){for(int i=0;i<81;i++){int x=i/9+1,y=i%9+1;printf("%dx%d=%d\n",x,y,x*y);}return 0;} | ^~~~
s368816238
p00000
C
void Q(int a){int i=a%9+1,j=a/9+1;a<81?printf("%dx%d=%d\n",j,i,i*j,Q(a+1)):0;}main(){Q(0);}
main.c: In function 'Q': main.c:1:40: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | void Q(int a){int i=a%9+1,j=a/9+1;a<81?printf("%dx%d=%d\n",j,i,i*j,Q(a+1)):0;}main(){Q(0);} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | void Q(int a){int i=a%9+1,j=a/9+1;a<81?printf("%dx%d=%d\n",j,i,i*j,Q(a+1)):0;}main(){Q(0);} main.c:1:40: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | void Q(int a){int i=a%9+1,j=a/9+1;a<81?printf("%dx%d=%d\n",j,i,i*j,Q(a+1)):0;}main(){Q(0);} | ^~~~~~ main.c:1:40: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:68: error: invalid use of void expression 1 | void Q(int a){int i=a%9+1,j=a/9+1;a<81?printf("%dx%d=%d\n",j,i,i*j,Q(a+1)):0;}main(){Q(0);} | ^~~~~~ main.c: At top level: main.c:1:79: error: return type defaults to 'int' [-Wimplicit-int] 1 | void Q(int a){int i=a%9+1,j=a/9+1;a<81?printf("%dx%d=%d\n",j,i,i*j,Q(a+1)):0;}main(){Q(0);} | ^~~~
s820200788
p00000
C
#include <iostream> #include <string.h> #include <algorithm> #include <string> #include <stdio.h> using namespace std; int F[107][107][9]; int G[107][107]; int n,k,a[107]; int main() { int nowCase = 0; while (cin >> n >> k) { if (!n && !k) break; for (int i = 1;i <= n;++i) { cin >> a[i]; a[i] -= 25; } memset(F,0,sizeof(F)); for (int i = 0;i <= n;++i) for (int j = 0;j <= k;++j) for (int r = 0;r <= 8;++r) { F[i][j][r] = 0x7f7f7f7f; G[i][j] = 0x7f7f7f7f; } F[0][0][8] = 0; int state = 0; for (int i = 1;i <= n;++i) { for (int j = 0;j <= min(i,k);++j) for (int r = 0;r < 8;++r) { if (r == a[i]) { F[i][j][r] = min(F[i-1][j][r],G[i-1][j]+1); } else { int value = 1; if (state & (1 << a[i])) value = 0; F[i][j][r] = F[i-1][j-1][r] + value; } G[i][j] = min(G[i][j],F[i][j][r]); } state = state | (1 << a[i]); } int ans = 0x7f7f7f7f; for (int i = 0;i <= 8;++i) ans = min(ans,F[n][k][i]); printf("Case %d: %d\n",++nowCase,ans); } }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s152007767
p00000
C
#include <cstdio> #include<cstring> #include<algorithm> using namespace std; const long long inf=0xffffffffffff; struct P { int h, m, n; int id; bool operator<(const P & a)const { if (h == a.h) return m < a.m; return h < a.h; } } p[60]; int s[40][40], n, m, k, r, c; bool mark[40][40]; bool fuck(int x) { if (x > m) return 0; long long ans = -inf; for (int i = 0; i < n; ++i) { for (int j = 0, l;j <= m - x; ++j) { long long tem = 0; for (l = 0; l < x; ++l) if (mark[i][j + l]) break; else tem += s[i][j + l]; if (l == x) if (tem > ans) ans = tem, r = i, c = j; } } if (ans == -inf) { for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) if (!mark[i][j] && ans < s[i][j]) ans = s[i][j], r = i, c = j; if (ans == -inf) return 0; mark[r][c] = 1; return 1; } for (int j = c; j < c + x; ++j) mark[r][j] = 1; return 1; } int main() { while (scanf("%d%d%d", &n, &m, &k) && n) { for (int i = 0; i < n; ++i) for (int j = 0; j < m; ++j) scanf("%d", &s[i][j]); memset(mark, 0, sizeof (mark)); for (int i = 0; i < k; ++i){ scanf("%d:%d%d", &p[i].h, &p[i].m, &p[i].n); p[i].id=i; } sort(p, p + k); int ans[60][2]; for (int i = 0; i < k; ++i) { if (fuck(p[i].n)) ans[p[i].id][0]=r+1,ans[p[i].id][1]=c+1; else ans[p[i].id][0]=-1; } for(int i=0;i<k;++i) if(ans[i][0]==-1) puts("-1"); else printf("%d %d\n",ans[i][0],ans[i][1]); } return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s676433607
p00000
C
# include <cstdio> # include <cstring> # define bignum 200000000 # define N 2050 # define M 100000 int first[N],next[M],d[N],zd[M],c[M],pre[N],qd[M]; int n,q[N],vis[N]; int spfa(int x) { int head=0,tail=1,now; for (int i=2;i<=n;i++) d[i]=bignum; vis[1]=1; q[1]=1; d[1]=0; while (head++<tail) { now=q[head%N]; vis[now]=0; for (int cur=first[now];cur;cur=next[cur]) { if (cur==x) continue ; if (d[now]+c[cur]<d[zd[cur]]) { d[zd[cur]]=d[now]+c[cur]; if (x==0) pre[zd[cur]]=cur; if (!vis[zd[cur]]) { q[(++tail)%N]=zd[cur]; vis[zd[cur]]=1; } } } } return d[n]; } int main (void) { int t,m,tt; scanf("%d",&t); while (t--) { scanf("%d%d",&n,&m); memset(first,0,sizeof(first)); memset(pre,-1,sizeof(pre)); for (int i=1;i<=m;i++) { scanf("%d%d%d",&qd[i],&zd[i],&c[i]); next[i]=first[qd[i]]; first[qd[i]]=i; } if (spfa(0)==bignum) { printf("-1\n"); continue ; } int now=n,del; int ans=d[n]; while (now!=1) { del=pre[now]; tt=spfa(del); if (tt>ans) ans=tt; if (tt==bignum) break; now=qd[del]; } if (ans==bignum) printf("-1\n"); else printf("%d\n",ans); } return 0; }
main.c:1:11: fatal error: cstdio: No such file or directory 1 | # include <cstdio> | ^~~~~~~~ compilation terminated.
s508595928
p00000
C
#include <stdio.h> int main(){ int i,j; for(i=1;i<=9;i++){for(j=1;j <=9;j++){printf("%dx%d=%d\n",i,j,i*j)}}return 0; }
main.c: In function 'main': main.c:4:38: error: expected ';' before '}' token 4 | <=9;j++){printf("%dx%d=%d\n",i,j,i*j)}}return 0; | ^ | ;
s446615132
p00000
C
# include <iostream> # include <cstring> # include <cstdio> # include <vector> # define N 55010 using namespace std; struct node { int u,w; node(int uu,int ww) { u=uu; w=ww; } }; vector <node> tree[N]; int p[N][50],d[N],dist[N]; void dfs (int x,int pre) { int y,len=tree[x].size(),now; for (int i=0;i<len;i++) { y=tree[x][i].u; if (y==pre) continue; now=p[y][0]=x; d[y]=d[x]+1; dist[y]=dist[x]+tree[x][i].w; for (int j=0;now!=-1 && p[now][j]!=-1;j++) { p[y][j+1]=p[now][j]; now=p[now][j]; } dfs(y,x); } } int LCA(int x,int y) { if (x==y) return x; int tem; if (d[x]<d[y]) { tem=x; x=y; y=tem; } int dis=d[x]-d[y],k=0; while (dis) { if (dis&1) x=p[x][k]; dis>>=1; k++; } k=0; while (x!=y) { if ( p[x][k]!=p[y][k] || (p[x][k]==p[y][k] && k==0) ) { x=p[x][k]; y=p[y][k]; k++; }else k--; } return x; } int main (void) { int n,u,v,c,q,m; char s[20]; scanf("%d%d",&n,&m); for (int i=1;i<=n;i++) tree[i].clear(); memset(p,-1,sizeof(p)); for (int i=0;i<m;i++) { scanf("%d%d%d%s",&u,&v,&c,s); tree[u].push_back(node(v,c)); tree[v].push_back(node(u,c)); } dist[1]=0; d[1]=0; dfs(1,-1); scanf("%d",&q); while (q--) { scanf("%d%d",&u,&v); printf("%d\n",dist[u]+dist[v]-2*dist[LCA(u,v)]); } return 0; }
main.c:1:11: fatal error: iostream: No such file or directory 1 | # include <iostream> | ^~~~~~~~~~ compilation terminated.
s466096243
p00000
C
#include<stdio.h> #include<cstring> #include <iostream> #include <algorithm> #include <vector> using namespace std; typedef long long ll; #define PB push_back #define MP make_pair #define REP(i,n) for(int i=0;i<n;i++) ll sum[500007]; vector< pair<int,int> > cus[100007]; int n,m,q; int main() { int Cases,nowCase = 0; cin >> Cases; while (Cases--) { scanf("%d%d%d",&n,&m,&q); REP(i,n) cus[i].clear(); REP(i,m) { int a,b,c; scanf("%d%d%d",&a,&b,&c); cus[a-1].PB(MP(-b,c)); } REP(i,m) sum[i] = 0; REP(i,n) { sort(cus[i].begin(),cus[i].end()); int rank = 0; REP(j,cus[i].size()) { if (j && cus[i][j].first != cus[i][j-1].first) ++rank; sum[rank] += cus[i][j].second; } } REP(i,m) if (i > 0) sum[i] += sum[i-1]; printf("Case #%d:\n",++nowCase); REP(i,q) { int x; x = min(x,m); scanf("%d",&x); printf("%I64d\n",sum[x-1]); } } return 0; }
main.c:2:9: fatal error: cstring: No such file or directory 2 | #include<cstring> | ^~~~~~~~~ compilation terminated.
s514849844
p00000
C
# include <cstdio> # include <cstring> # include <iostream> # include <algorithm> using namespace std; # define N 3005 int dp[N],a[N],b[N],c[N],x[N],y[N],out[N],n,m; int search(int x) { int left=1,right=m,mid; while (left<=right) { mid=(left+right)>>1; if (c[mid]<x) left=mid+1; else if (c[mid]>x) right=mid-1; else return mid; } return -1; } int main (void) { int t,tot,k; scanf("%d",&t); for (int cas=1;cas<=t;cas++) { scanf("%d",&n); memset(dp,0,sizeof(dp)); tot=0; for (int i=1;i<=n;i++) { scanf("%d%d",&a[i],&b[i]); c[++tot]=a[i]; c[++tot]=b[i]; } sort(c+1,c+1+n+n); m=1; for(int i=2;i<2*n+1;i++) { if(c[i]!=c[i-1]) { c[++m]=c[i]; } } for (int i=1;i<=n;i++) { x[i]=search(a[i]); y[i]=search(b[i]); } //~ for (int i=1;i<=m;i++) //~ printf("%d\n",c[i]); //~ for (int i=1;i<=n;i++) //~ printf("%d %d\n",x[i],y[i]); for (int i=1;i<=m;i++) { tot=0; k=2*n+10; memset(out,0,sizeof(int)*i); for (int j=1;j<=n;j++) if (x[j]<=i && y[j]>=i) { ++tot; ++out[x[j]]; if (x[j]<k) k=x[j]; } dp[i]=dp[i-1]; if (tot>2) { dp[i]=max(dp[i],dp[k-1]+tot); for (int j=k;j<i;j++) { tot-=out[j]; dp[i]=max(dp[i],dp[j]+tot); if (tot<=2) break; } } } for (int i=1;i<=m;i++) printf("%d %d %d\n",i,c[i],dp[i]); printf("Case #%d: %d\n",cas,dp[m]); } return 0 ; } 1 1 0 2 2 0 3 3 3 4 4 4 5 10 4 6 11 4 7 12 4 8 13 6 9 14 7 10 15 7 11 19 7 12 20 7 13 21 7 14 22 10 15 23 10 16 24 10 Case #1: 10
main.c:1:11: fatal error: cstdio: No such file or directory 1 | # include <cstdio> | ^~~~~~~~ compilation terminated.
s875340477
p00000
C
#include <iostream> #include <cstdio> #include <cmath> #include <cstring> #include <cstdlib> #define maxn 1000000 #define M 100000 using namespace std; typedef long long typec; struct matrix{ typec v[120][120]; }; const int CH=4; int trie[10000][CH]; int que[5000000]; int fail[10000]; int sw[128]; int word[10000]; int loc,maxx; void insert(char *s,int len) { int r=0; for(int i=0;i<len;i++) { int index=sw[s[i]]; if(!trie[r][index]) { trie[r][index]=++loc; word[loc]=0; for(int j=0;j<CH;j++) { trie[loc][j]=0; } } r=trie[r][index]; } word[r]=1; return ; } void AC() { int front=0,rear=0; for(int i=0;i<CH;i++) { if(trie[0][i]) { fail[trie[0][i]]=0; que[rear++]=trie[0][i]; } } while(front!=rear) { int p=que[front++]; word[p]=word[p]||word[fail[p]]; for(int i=0;i<CH;i++) { if(trie[p][i]) { int v=trie[p][i]; que[rear++]=v; fail[v]=trie[fail[p]][i]; } else { trie[p][i]=trie[fail[p]][i]; } } } } matrix multiply(matrix a,matrix b) { matrix c; memset(c.v,0,sizeof(c.v)); for(int i=0;i<maxx;i++) { for(int j=0;j<maxx;j++) { for(int k=0;k<maxx;k++) { c.v[i][j]+=a.v[i][k]*b.v[k][j]; c.v[i][j]%=M; } } } return c; } matrix gao(matrix a,typec n) { matrix ans; for(int i=0;i<maxx;i++) { for(int j=0;j<maxx;j++) { if(i==j) ans.v[i][j]=1; else ans.v[i][j]=0; } } while(n!=0) { if(n&1) ans=multiply(ans,a); a=multiply(a,a); n=n/2; } return ans; } char ss[20]; matrix xx,ans; int main(void) { typec n,m; loc=0; sw['A']=0;sw['T']=1;sw['G']=2;sw['C']=3; for(int i=0;i<CH;i++) { trie[0][i]=0; } cin>>n>>m; while(n--) { scanf("%s",ss); int len=strlen(ss); insert(ss,len); } AC(); memset(ans.v,0,sizeof(ans.v)); for(int i=0;i<=loc;i++) { for(int j=0;j<CH;j++) { if(word[i]==0&&word[trie[i][j]]==0) { ans.v[i][trie[i][j]]++; } } } maxx=loc+1; xx=gao(ans,m); typec sum=0; for(int i=0;i<=loc;i++) { sum+=xx.v[0][i]; sum=sum%M; } cout<<sum%M<<endl; //system("pause"); return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s534323653
p00000
C
# include <cmath> # include <algorithm> # include <iostream> # include <cstring> # define bignum 200000000 # define eps 1e-6 # define N 655 using namespace std; int p; struct Point { int x,y; }pt[N],pln[N]; int dlcmp(int x) { return x<0?-1:x>0; } int cross(Point a,Point b,Point s) { int x1=a.x-s.x,y1=a.y-s.y; int x2=b.x-s.x,y2=b.y-s.y; return x1*y2-x2*y1; } double dis(Point a,Point b) { double dx=a.x-b.x; double dy=a.y-b.y; return sqrt( dx*dx + dy*dy ); } int cmp(Point a,Point b) { if (dlcmp(cross(a,b,pt[0]))==1 || (dlcmp(cross(a,b,pt[0]))==0 && dis(pt[0],a)<dis(pt[0],b)) ) return 1; else return 0; } int graham_scan(int n) { int top,t,i; if (n<=1) return n; for (t=0,i=1;i<n;i++) if (dlcmp(pt[i].y-pt[t].y)==-1 || (dlcmp(pt[i].y-pt[t].y)==0 && dlcmp(pt[i].x-pt[t].x)==-1)) t=i; swap(pt[0],pt[t]); sort (pt+1,pt+n,cmp); for (i=0;i<2;i++) pln[i]=pt[i]; top=2; for (i=2;i<n;i++) { while (top>1 && dlcmp(cross(pln[top-1],pt[i],pln[top-2]))<=0) top--; pln[top++]=pt[i]; } return top; }
main.c:1:11: fatal error: cmath: No such file or directory 1 | # include <cmath> | ^~~~~~~ compilation terminated.
s696603863
p00000
C
5 300 0 0 9 0 9 5 8 9 0 9 117 5 300 0 0 9 0 9 5 8 9 0 9 1175 300 0 0 9 0 9 5 8 9 0 9 1175 300 0 0 9 0 9 5 8 9 0 9 1175 300 0 0 9 0 9 5 8 9 0 9 1175 300 0 0 9 0 9 5 8 9 0 9 1175 300 0 0 9 0 9 5 8 9 0 9 1175 300 0 0 9 0 9 5 8 9 0 9 117
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 5 300 | ^
s832000767
p00000
C
#include<cstdio> #include<cstring> #include<cmath> #include<algorithm> using namespace std; struct Rectangle { double x1,x2,y1,y2; int legal; }; struct Point { double x,y; }; Rectangle screen,inverse; Point s,t; int main() { double w,h,a,b,r,dx,dy,ans; int sm,tm; int flag; while (scanf("%lf%lf%lf%lf",&w,&h,&a,&b)!=EOF) { scanf("%lf%lf%d%lf%lf%d",&s.x,&s.y,&sm,&t.x,&t.y,&tm); screen.x1=0; screen.x2=w; screen.y1=0; screen.y2=h; r=sqrt(a*a+b*b)/2; flag=1; if (sm==1) { if (s.x-a/2<screen.x1||s.x+a/2>screen.x2|| s.y-b/2<screen.y1||s.y+b/2>screen.y2) flag=0; } else { if (s.x-b/2<screen.x1||s.x+b/2>screen.x2|| s.y-a/2<screen.y1||s.y+a/2>screen.y2) flag=0; } if (tm==1) { if (t.x-a/2<screen.x1||t.x+a/2>screen.x2|| t.y-b/2<screen.y1||t.y+b/2>screen.y2) flag=0; } else { if (t.x-b/2<screen.x1||t.x+b/2>screen.x2|| t.y-a/2<screen.y1||t.y+a/2>screen.y2) flag=0; } if (flag==0) { printf("-1\n"); continue; } inverse.x1=screen.x1+r; inverse.x2=screen.x2-r; inverse.y1=screen.y1+r; inverse.y2=screen.y2-r; if (inverse.x1>inverse.x2||inverse.y1>inverse.y2) inverse.legal=0; else inverse.legal=1; if (sm==tm) { ans=fabs(s.x-t.x)+fabs(s.y-t.y); printf("%.3f\n",ans); } else { if (inverse.legal==0) { printf("-1\n"); continue; } if (max(s.x,t.x)<inverse.x1) dx=fabs(inverse.x1-max(s.x,t.x)); else if (min(s.x,t.x)>inverse.x2) dx=fabs(inverse.x2-min(s.x,t.x)); else dx=0; if (max(s.y,t.y)<inverse.y1) dy=fabs(inverse.y1-max(s.y,t.y)); else if (min(s.y,t.y)>inverse.y2) dy=fabs(inverse.y2-min(s.y,t.y)); else dy=0; ans=fabs(s.x-t.x)+fabs(s.y-t.y)+dx*2+dy*2; printf("%.3f\n",ans); } } return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s808172911
p00000
C
#include<stdio.h> int main(){ int a,b; for(a=1,a<=9;a++){ for(b=1;b<9;b++){ printf("%dx%d=%d\n",a,b,a*b); } } return 0; }
main.c: In function 'main': main.c:5:25: error: expected ';' before ')' token 5 | for(a=1,a<=9;a++){ | ^ | ;
s277333826
p00000
C
main(){a,b;for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){a,b;for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;} | ^~~~ main.c: In function 'main': main.c:1:8: error: 'a' undeclared (first use in this function) 1 | main(){a,b;for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;} | ^ main.c:1:8: note: each undeclared identifier is reported only once for each function it appears in main.c:1:10: error: 'b' undeclared (first use in this function) 1 | main(){a,b;for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;} | ^ main.c:1:46: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | main(){a,b;for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main(){a,b;for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;} main.c:1:46: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | main(){a,b;for(a=1;a<=9;a++)for(b=1;b<=9;b++)printf("%dx%d=%d\n",a,b,a*b);return 0;} | ^~~~~~ main.c:1:46: note: include '<stdio.h>' or provide a declaration of 'printf'
s175070864
p00000
C
struct line { point a,b; }; //ティツョツ。テァツョツ幼ross product (P1-P0)x(P2-P0) テ・ツ渉嘉ァツァツッ double xmult(point p1,point p2,point p0){ return (p1.x-p0.x)*(p2.y-p0.y)-(p2.x-p0.x)*(p1.y-p0.y); } //ティツョツ。テァツョツ妖ot product (P1-P0).(P2-P0) テァツつケテァツァツッ double dmult(point p1,point p2,point p0){ return (p1.x-p0.x)*(p2.x-p0.x)+(p1.y-p0.y)*(p2.y-p0.y); }
main.c:2:5: error: unknown type name 'point'; did you mean 'int'? 2 | point a,b; | ^~~~~ | int main.c:6:14: error: unknown type name 'point'; did you mean 'int'? 6 | double xmult(point p1,point p2,point p0){ | ^~~~~ | int main.c:6:23: error: unknown type name 'point'; did you mean 'int'? 6 | double xmult(point p1,point p2,point p0){ | ^~~~~ | int main.c:6:32: error: unknown type name 'point'; did you mean 'int'? 6 | double xmult(point p1,point p2,point p0){ | ^~~~~ | int main.c:11:14: error: unknown type name 'point'; did you mean 'int'? 11 | double dmult(point p1,point p2,point p0){ | ^~~~~ | int main.c:11:23: error: unknown type name 'point'; did you mean 'int'? 11 | double dmult(point p1,point p2,point p0){ | ^~~~~ | int main.c:11:32: error: unknown type name 'point'; did you mean 'int'? 11 | double dmult(point p1,point p2,point p0){ | ^~~~~ | int
s515643917
p00000
C
point intersection(line u,line v){ point ret=u.a; double t=((u.a.x-v.a.x)*(v.a.y-v.b.y)-(u.a.y-v.a.y)*(v.a.x-v.b.x)) /((u.a.x-u.b.x)*(v.a.y-v.b.y)-(u.a.y-u.b.y)*(v.a.x-v.b.x)); ret.x+=(u.b.x-u.a.x)*t; ret.y+=(u.b.y-u.a.y)*t; return ret; }
main.c:1:1: error: unknown type name 'point'; did you mean 'int'? 1 | point intersection(line u,line v){ | ^~~~~ | int main.c:1:20: error: unknown type name 'line' 1 | point intersection(line u,line v){ | ^~~~ main.c:1:27: error: unknown type name 'line' 1 | point intersection(line u,line v){ | ^~~~
s422863179
p00000
C
#include<cstdio> #include<iostream> #include<algorithm> #include <cstdlib> using namespace std; typedef long long llong; struct rect{ llong x1,y1,x2,y2; }mat[110]; llong p[110]; int main() { freopen("d:\\in.txt","w",stdout); llong w,h,n,m; int t = 10; //while(t--){ srand(time(NULL)); w = (llong)rand()*rand()+100; h = (llong)rand()*rand()+100; n = 10; cout<<w<<" "<<h<<" "<<n<<" "<<2<<endl; for(int i = 0; i < n*4; ++i){ p[i] = (llong)rand()*rand()%w%h; } sort(p,p+n*4); for(int i = 0; i < n; ++i){ for(int j = 0; j < 4; ++j){ cout<<p[i*4+j]<<" "; } puts(" "); } //} return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s787812542
p00000
C
b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))++(b%=9)||a++;}
main.c:1:1: warning: data definition has no type or storage class 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))++(b%=9)||a++;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))++(b%=9)||a++;} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))++(b%=9)||a++;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))++(b%=9)||a++;} main.c:1:21: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))++(b%=9)||a++;} | ^~~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:50: error: lvalue required as increment operand 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))++(b%=9)||a++;} | ^~
s905037178
p00000
C
b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((b%=9)++)||a++;}
main.c:1:1: warning: data definition has no type or storage class 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((b%=9)++)||a++;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((b%=9)++)||a++;} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((b%=9)++)||a++;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((b%=9)++)||a++;} main.c:1:21: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((b%=9)++)||a++;} | ^~~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:57: error: lvalue required as increment operand 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((b%=9)++)||a++;} | ^~
s896222143
p00000
C
b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))(++b%=9)||a++;}
main.c:1:1: warning: data definition has no type or storage class 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))(++b%=9)||a++;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))(++b%=9)||a++;} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))(++b%=9)||a++;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))(++b%=9)||a++;} main.c:1:21: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))(++b%=9)||a++;} | ^~~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:54: error: lvalue required as left operand of assignment 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))(++b%=9)||a++;} | ^~
s689011611
p00000
C
b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((++b)%=9)||a++;}
main.c:1:1: warning: data definition has no type or storage class 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((++b)%=9)||a++;} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'b' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((++b)%=9)||a++;} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:21: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((++b)%=9)||a++;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((++b)%=9)||a++;} main.c:1:21: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((++b)%=9)||a++;} | ^~~~~~ main.c:1:21: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:56: error: lvalue required as left operand of assignment 1 | b;main(a){for(;a-10;printf("%dx%d=%d\n",a,b,a*b))((++b)%=9)||a++;} | ^~
s603470343
p00000
C
i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);i=0}
main.c:1:1: warning: data definition has no type or storage class 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);i=0} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);i=0} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:36: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);i=0} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);i=0} main.c:1:36: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);i=0} | ^~~~~~ main.c:1:36: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:70: error: expected ';' before '}' token 1 | i;main(j){for(;i++<9;)for(j=0;j<9;)printf("%dx%d=%d\n",i,j,i*++j);i=0} | ^ | ;
s282847052
p00000
C
/*======================================== 2-sat 解决问题 (A1 v A2) ^ (A1 v A3') 这种 只有括号里最多有两个变量的析取范式 1:a不能和b一起去,则a->opp(b), b->opp(a)(就是连两条边)说明a去,opp(b)一定去. 2:事件A一定要取的表示是:-A->A,这样表示取-A一定要取A,与2-sat前提矛盾。 1:缩圈(缩完后判断是否v和v’在一个强连通分量,若是,则无解!退出,很显然,v和v’在一个分量中说明两个必须同时去,而又不能,矛盾!) 2: 反向连边构造新图,这样选了入度为0的点就相当于选了原图出度为0的点,就不需要去染后继点了! 3:拓扑排序(按入度) 4:从入度为0的点开始取,取一个记为1,就把其opp点以及opp点所有相连的点统统标记为2。(必然无矛盾,论文已证明!) =========================================*/ int dfn[V], low[V], stack[V], head[V]; int opp[V], pon[V], bo[V], thead[V]; int indeg[V], tnext[V], tpot[V], Q[V]; int next[E], pot[E], now[E]; bool instack[V]; int tot, n, m, top, num, sign; void connect(int a,int b) { pot[++tot]=b; next[tot]=head[a]; head[a]=tot; } // 缩圈 void dfs(int v) { dfn[v]=low[v]=++sign; stack[++top]=v; instack[v] = true; for (int e=head[v];e!=-1;e=next[e]) { int u=pot[e]; if ( dfn[u]==0 ) { dfs(u); low[v]=min(low[v],low[u]); } else if (instack[u]) low[v]=min(low[v],dfn[u]); } if (low[v]==dfn[v]) { pon[++num] = v; //表示新节点的原归属点 do { int u=stack[top--]; now[u]=num; instack[u]=false; }while (stack[top+1]!=v); } } void toposort() { int h=1,t=0; for (int i=1;i<=num;i++) if (indeg[i] == 0) Q[++t] = i; while (h <= t) { int v = Q[h++]; for (int e=thead[v];e!=0;e=tnext[e]) { if (--indeg[tpot[e]] == 0) Q[++t] = tpot[e]; } } memset(bo,0,sizeof(bo)); for (int i=1;i<=t;i++) if (bo[Q[i]] == 0) { bo[Q[i]] = 1; bo[now[opp[pon[Q[i]]]]] = 2; //由于对称性,只需要标记一个点。 } } bool 2-sat() { // 先算好opp数组,根据题目来设 n = n * 2; for (int i=1;i<=n;i++) if ((i&1)>0) opp[i]=i+1; else opp[i]=i-1; // 连边 一对矛盾a->opp[b],b->opp[a],既选a一定要选opp[b] tot = -1; memset(head,-1,sizeof(head)); for (int i=1;i<=m;i++) { scanf("%d%d",&a,&b); connect(a,opp[b]); connect(b,opp[a]); } //缩圈 sign=0; num=0; top=0; memset(dfn,0,sizeof(dfn)); memset(instack,false,sizeof(instack)); //理论上每次做完每个结点都会出栈,求保险 for (int i=1;i<=n;i++) if (dfn[i]==0) dfs(i); //看是否有解,A和A’在一个环中就无解 for (int i=1;i<=n;i++) if (now[i] == now[opp[i]]) return false; // 有解则反向构图,求解 tot = -1; memset(thead,-1,sizeof(thead)); memset(indeg,0,sizeof(indeg)); for (int i=1;i<=n;i++) { int v = now[i]; for (int e=head[i];e!=-1;e=next[e]) if (now[pot[e]] != v) { int u = now[pot[e]]; tpot[++tot] = v; tnext[tot] = thead[u]; thead[u] = tot; indeg[v]++; } } toposort(); //如果 bo[i]==1 表示选该点 for (int i=1;i<=n;i++) if (bo[now[i]] == 1) printf("%d\n",i); }
main.c:11:9: error: 'V' undeclared here (not in a function) 11 | int dfn[V], low[V], stack[V], head[V]; | ^ main.c:15:10: error: 'E' undeclared here (not in a function) 15 | int next[E], pot[E], now[E]; | ^ main.c:16:1: error: unknown type name 'bool' 16 | bool instack[V]; | ^~~~ main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' +++ |+#include <stdbool.h> 1 | /*======================================== main.c: In function 'dfs': main.c:27:22: error: 'true' undeclared (first use in this function) 27 | instack[v] = true; | ^~~~ main.c:27:22: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c:27:22: note: each undeclared identifier is reported only once for each function it appears in main.c:34:32: error: implicit declaration of function 'min' [-Wimplicit-function-declaration] 34 | low[v]=min(low[v],low[u]); | ^~~ main.c:46:36: error: 'false' undeclared (first use in this function) 46 | instack[u]=false; | ^~~~~ main.c:46:36: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c: In function 'toposort': main.c:66:9: error: implicit declaration of function 'memset' [-Wimplicit-function-declaration] 66 | memset(bo,0,sizeof(bo)); | ^~~~~~ main.c:1:1: note: include '<string.h>' or provide a declaration of 'memset' +++ |+#include <string.h> 1 | /*======================================== main.c:66:9: warning: incompatible implicit declaration of built-in function 'memset' [-Wbuiltin-declaration-mismatch] 66 | memset(bo,0,sizeof(bo)); | ^~~~~~ main.c:66:9: note: include '<string.h>' or provide a declaration of 'memset' main.c: At top level: main.c:74:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before numeric constant 74 | bool 2-sat() | ^
s451335320
p00000
C
#include <cstdio> #include <cstring> #include <algorithm> #define maxn 52 using namespace std; int n, m, ans, A[5]; int num[maxn][maxn]; int sum[maxn][maxn]; int getsum(int x1, int y1, int x2, int y2) { return sum[x2][y2] - sum[x1 - 1][y2] - sum[x2][y1 - 1] + sum[x1 - 1][y1 - 1]; } void work() { while (~scanf("%d%d", &n, &m)) { memset(num, 0, sizeof (num)); memset(sum, 0, sizeof (sum)); ans = 0; for (int i = 1; i <= n; ++i) { for (int j = 1; j <= m; ++j) { scanf("%d", &num[i][j]); sum[i][j] = sum[i][j - 1] + num[i][j]; } for (int j = 1; j <= m; ++j) sum[i][j] += sum[i - 1][j]; } scanf("%d%d%d", A + 1, A + 2, A + 3); sort(A + 1, A + 4); int s[4]; for (int i = 1; i < n; ++i) { for (int j = i + 1; j < n; ++j) { s[1] = getsum(1, 1, i, m); s[2] = getsum(i + 1, 1, j, m); s[3] = getsum(j + 1, 1, n, m); sort(s + 1, s + 4); if (s[1] == A[1] && s[2] == A[2] && s[3] == A[3]) ans++; } } for (int i = 1; i < m; ++i) { for (int j = i + 1; j < m; ++j) { s[1] = getsum(1, 1, n, i); s[2] = getsum(1, i + 1, n, j); s[3] = getsum(1, j + 1, n, m); sort(s + 1, s + 4); if (s[1] == A[1] && s[2] == A[2] && s[3] == A[3]) ans++; } } printf("%d\n", ans); } } int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); work(); return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s106008048
p00000
C
#include <cstdio> #include <cstring> #include <algorithm> #include <map> #include <string> #include <iostream> #define MAXN 1000000 #define MAXM 2000000 #define inf 2147483647 using namespace std; map <int, int> mp; map <int, int> mp2; struct edge { int to, c, next; } e[MAXM]; int vert[MAXN], l, N, top; char str[30]; int getid(int val) { if (mp.find(val)==mp.end()) { mp[val] = ++N; mp2[N] = val; } else return mp[val]; } void addedge(int u, int v, int c) { e[++top].to = v, e[top].c = c; e[top].next = vert[u], vert[u] = top; e[++top].to = u, e[top].c = 0; e[top].next = vert[v], vert[v] = top; } void dfs1(int u, int pos, int tot, int dep, int val) { if (tot == dep) { int v = getid(val); addedge(u, v, 1); return; } for (int i = pos+1; i < l; ++i) dfs1(u, i, tot+1, dep, val*27+str[i]-'A'+1); } void gen(int u) { for (int i = 1; i <= 4; ++i) dfs1(u, -1, 0, i, 0); } int L[MAXN], now[MAXN], q[MAXN]; bool find_path(int src, int des) { for (int i = 0; i <= N; ++i) L[i] = inf, now[i] = -1; L[q[0] = src] = 0; for (int h = 0, t = 1; h != t; h = (h + 1) % MAXN) { int u = q[h]; if (L[u] >= L[des]) break; for (int i = vert[u]; i != -1; i = e[i].next) if (e[i].c > 0) { if (now[u] == -1) now[u] = i; if (L[e[i].to] == inf) { L[e[i].to] = L[u] + 1; q[t] = u, t = (t + 1) % MAXN; } } } return L[des] != inf; } int dfs(int src, int des, int now_flow) { if (src == des) return now_flow; int flow = 0, t; for (t = now[src]; t != -1; t =e[t].next) if (e[t].c > 0 && L[e[t].to] == L[src] + 1) { int tmp = dfs(e[t].to, des, min(e[t].c, now_flow-flow)); e[t].c -= tmp; e[t^1].c += tmp; flow += tmp; if (flow == now_flow) break; } if ((now[src]=t) == -1) L[src] = inf; return flow; } int maxflow(int src, int des) { int ret = 0; while (find_path(src, des)) ret += dfs(src, des, inf); return ret; } void out(int id) { int x = mp2[id], len = -1; char s[5]; for (;x;x/=27) if (x%27) s[++len] = 'a' + x % 27; for (int i=len; i>=0; --i) printf("%c", s[i]); puts(""); } void init() { int n; while (~scanf("%d", &n)) { mp.clear(); mp2.clear(); N = n; top = -1; for (int i = 1; i <= n; ++i) { addedge(0, i, 1); scanf("%s", str); l = strlen(str); gen(i); } ++N; for (int i=n+1; i<N; ++i) addedge(i, N, 1); int flow = maxflow(0, N); if (flow == n) { for (int i = n+1; i < N; ++i) if (e[vert[i]].c == 0) out(i); } else puts("-1"); } } int main() { //freopen("input.txt", "r", stdin); //freopen("output.txt", "w", stdout); init(); return 0; }
main.c:1:10: fatal error: cstdio: No such file or directory 1 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s667369707
p00000
C
struct point { double x, y; } p[size]; int n, tmp[size]; bool cmpx(point a, point b) { return a.x + eps < b.x || (a.x < b.x + eps && a.y + eps < b.y); } bool cmpy(int a, int b) { return p[a].y + eps < p[b].y || (p[a].y < p[b].y + eps && p[a].x + eps < p[b].x); } double MinDist(int l, int r) { int i, j; double ret = 1e200; if (r - l <= 10) { for (i = l; i < r; i++) for (j = i + 1; j <= r; j++) ret = min(ret, dis(p[i], p[j])); return ret; } int mid = (l + r) >> 1, tot = 0; ret = min(ret, (min(MinDist(l, mid), MinDist(mid + 1, r))); for (i = mid; i >= l; i--) if (p[mid].x - p[i].x < ret) tmp[tot++] = i; else break; for (i = mid + 1; i <= r; i++) if (p[i].x - p[mid].x < ret) tmp[tot++] = i; else break; sort(tmp, tmp + tot, cmpy); for (i = 0; i < tot; i++) for (j = 1; j <= 7 && j + i < tot; j++) ret = min(ret, dis(p[tmp[i]], p[tmp[i + j]])); return ret; }
main.c:4:5: error: 'size' undeclared here (not in a function) 4 | } p[size]; | ^~~~ main.c:7:1: error: unknown type name 'bool' 7 | bool cmpx(point a, point b) | ^~~~ main.c:1:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' +++ |+#include <stdbool.h> 1 | struct point main.c:7:11: error: unknown type name 'point'; did you mean 'int'? 7 | bool cmpx(point a, point b) | ^~~~~ | int main.c:7:20: error: unknown type name 'point'; did you mean 'int'? 7 | bool cmpx(point a, point b) | ^~~~~ | int main.c:12:1: error: unknown type name 'bool' 12 | bool cmpy(int a, int b) | ^~~~ main.c:12:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>' main.c: In function 'cmpy': main.c:14:21: error: 'eps' undeclared (first use in this function) 14 | return p[a].y + eps < p[b].y || (p[a].y < p[b].y + eps && p[a].x + eps < p[b].x); | ^~~ main.c:14:21: note: each undeclared identifier is reported only once for each function it appears in main.c: In function 'MinDist': main.c:23:68: error: implicit declaration of function 'min' [-Wimplicit-function-declaration] 23 | for (i = l; i < r; i++) for (j = i + 1; j <= r; j++) ret = min(ret, dis(p[i], p[j])); | ^~~ main.c:23:77: error: implicit declaration of function 'dis' [-Wimplicit-function-declaration] 23 | for (i = l; i < r; i++) for (j = i + 1; j <= r; j++) ret = min(ret, dis(p[i], p[j])); | ^~~ main.c:27:63: error: expected ')' before ';' token 27 | ret = min(ret, (min(MinDist(l, mid), MinDist(mid + 1, r))); | ~ ^ | ) main.c:37:16: error: expected ';' before '}' token 37 | return ret; | ^ | ; 38 | } | ~
s771491536
p00000
C
#include <iostream> #include <algorithm> #include <cmath> #include <cstdio> #include <cstring> #define eps 1e-10 using namespace std; double ans; struct node { double x, y; } p[100010]; int n; bool cal_less(node p1, node p2) { if (p1.x != p2.x) return p1.x < p2.x; else return p1.y < p2.y; } double dist(node a, node b) { return sqrt((a.x - b.x)*(a.x - b.x) + (a.y - b.y)*(a.y - b.y)); } double getmin(double a, double b) { return a < b ? a : b; } int vi, vj; double solve(int l, int r) { if (l == r) return 1000000000; if (l == r - 1) return dist(p[l], p[r]); if (l == r - 2) return getmin(getmin(dist(p[l], p[l + 1]), dist(p[l + 1], p[l + 2])), dist(p[l], p[l + 2])); int i, j, mid = (l + r) >> 1; double curmin = getmin(solve(l, mid), solve(mid + 1, r)); for (i = l; i <= r; i++) for (j = i + 1; j <= i + 5 && j <= r; j++) { if (dist(p[i], p[j]) + eps < curmin) { curmin = dist(p[i], p[j]); vi = i, vj = j; } } return curmin; } int id[100010]; int belong(node p) { if (p.x >= 0) { if (p.y >= 0) return 1; else return 3; } else { if (p.y >= 0) return 2; else return 4; } } void init() { while (~scanf("%d", &n)) { for (int i = 0; i < n; ++i) { scanf("%lf%lf", &p[i].x, &p[i].y); id[i] = belong(p[i]); p[i].x = fabs(p[i].x), p[i].y = fabs(p[i].y); } sort(p, p + n, cal_less); ans = solve(0, n - 1); printf("%d %d %d %d\n", vi + 1, id[vi], vj + 1, 5 - id[vj]); //printf("%lf\n", ans); } } int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); init(); return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s404979490
p00000
C
#include <stdio.h> main() { int i,j,ans; for(i = 1 ; i <= 9 ; i++) { for(j = 1 ; j <= 9 ; j++) { ans = i x j; printf("%d * %d = %d\n",i,j,ans); } } return 0; }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main() | ^~~~ main.c: In function 'main': main.c:10:18: error: expected ';' before 'x' 10 | ans = i x j; | ^~ | ;
s344378196
p00000
C
main(argc,char *argv[]){ while(strlen(argv[0])>10); return 0; }
main.c:1:11: error: expected ')' before 'char' 1 | main(argc,char *argv[]){ | ^~~~ | )
s370626044
p00000
C
main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^~~~ main.c: In function 'main': main.c:1:10: error: expected declaration specifiers before 'for' 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^~~ main.c:1:18: error: expected declaration specifiers before 'i' 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^ main.c:1:23: error: expected declaration specifiers before 'i' 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^ main.c:1:35: error: expected declaration specifiers before 'j' 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^ main.c:1:40: error: expected declaration specifiers before 'printf' 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^~~~~~ main.c:1:72: error: expected declaration specifiers before 'exit' 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^~~~ main.c:1:80: error: expected declaration specifiers before '}' token 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^ main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] 1 | main(i,j)for(i=1;i<=9;i++)for(j=1;j<=9;printf("%dx%d=%d\n",i,j++,i*j));exit(0);} | ^~~~ main.c:1:1: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:2: error: expected '{' at end of input
s597617352
p00000
C
i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);}
main.c:1:1: warning: data definition has no type or storage class 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:47: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:47: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:47: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:1:47: error: void value not ignored as it ought to be 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~~ main.c:1:55: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:55: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
s100646027
p00000
C
main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:47: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:47: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:47: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:1:47: error: void value not ignored as it ought to be 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~~ main.c:1:55: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:55: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | main(i,j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
s269418112
p00000
C
i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);}
main.c:1:1: warning: data definition has no type or storage class 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:47: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:47: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:47: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:1:47: error: void value not ignored as it ought to be 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~~ main.c:1:55: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:55: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | i;main(j){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:55: note: include '<stdio.h>' or provide a declaration of 'printf'
s447783321
p00000
C
i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);}
main.c:1:1: warning: data definition has no type or storage class 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int] main.c:1:3: warning: data definition has no type or storage class 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^ main.c:1:3: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int] main.c:1:5: error: return type defaults to 'int' [-Wimplicit-int] 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c: In function 'main': main.c:1:48: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:48: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~ main.c:1:48: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:1:48: error: void value not ignored as it ought to be 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~~ main.c:1:56: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} main.c:1:56: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | i;j;main(){for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j);} | ^~~~~~ main.c:1:56: note: include '<stdio.h>' or provide a declaration of 'printf'
s179014733
p00000
C
int main(){ int i,j; for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); }
main.c: In function 'main': main.c:3:45: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | int main(){ main.c:3:45: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~ main.c:3:45: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:3:45: error: void value not ignored as it ought to be 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~~~~ main.c:3:53: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | int main(){ main.c:3:53: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~~~ main.c:3:53: note: include '<stdio.h>' or provide a declaration of 'printf'
s961194475
p00000
C
int main(void){ int i,j; for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); return 0; }
main.c: In function 'main': main.c:3:45: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | int main(void){ main.c:3:45: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~ main.c:3:45: note: include '<stdlib.h>' or provide a declaration of 'exit' main.c:3:45: error: void value not ignored as it ought to be 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~~~~ main.c:3:53: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | int main(void){ main.c:3:53: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 3 | for(i=j=1;i<=9||(i=(j++));i++,j<=9||exit(0))printf("%dx%d=%d\n",j,i,i*j); | ^~~~~~ main.c:3:53: note: include '<stdio.h>' or provide a declaration of 'printf'
s009075234
p00000
C
main(i,j){for(i=j=1;(i<=9||(i=(j++)&&1))&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j)}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(i,j){for(i=j=1;(i<=9||(i=(j++)&&1))&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j)} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:52: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | main(i,j){for(i=j=1;(i<=9||(i=(j++)&&1))&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j)} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main(i,j){for(i=j=1;(i<=9||(i=(j++)&&1))&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j)} main.c:1:52: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | main(i,j){for(i=j=1;(i<=9||(i=(j++)&&1))&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j)} | ^~~~~~ main.c:1:52: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:80: error: expected ';' before '}' token 1 | main(i,j){for(i=j=1;(i<=9||(i=(j++)&&1))&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j)} | ^ | ;
s444927604
p00000
C
main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'j' defaults to 'int' [-Wimplicit-int] main.c:1:29: error: lvalue required as left operand of assignment 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} | ^ main.c:1:47: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} main.c:1:47: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} | ^~~~~~ main.c:1:47: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:76: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration] 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} | ^~~~ main.c:1:1: note: include '<stdlib.h>' or provide a declaration of 'exit' +++ |+#include <stdlib.h> 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} main.c:1:76: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch] 1 | main(i,j){for(i=j=1;(i<=9||i=j++>0)&&j<=9;i++)printf("%dx%d=%d\n",j,i,i*j);exit(0);} | ^~~~ main.c:1:76: note: include '<stdlib.h>' or provide a declaration of 'exit'
s769617501
p00000
C
main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:41: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} main.c:1:41: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} | ^~~~~~ main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:74: error: 'exit' undeclared (first use in this function) 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} | ^~~~ main.c:1:1: note: 'exit' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>' +++ |+#include <stdlib.h> 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} main.c:1:74: note: each undeclared identifier is reported only once for each function it appears in 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} | ^~~~ main.c:1:78: error: expected ';' before numeric constant 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit 0;} | ^~ | ;
s688489864
p00000
C
main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;} | ^~~~ main.c: In function 'main': main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int] main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int] main.c:1:41: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;} | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;} main.c:1:41: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;} | ^~~~~~ main.c:1:41: note: include '<stdio.h>' or provide a declaration of 'printf' main.c:1:74: error: 'exit' undeclared (first use in this function) 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;} | ^~~~ main.c:1:1: note: 'exit' is defined in header '<stdlib.h>'; this is probably fixable by adding '#include <stdlib.h>' +++ |+#include <stdlib.h> 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;} main.c:1:74: note: each undeclared identifier is reported only once for each function it appears in 1 | main(a,b){for(;a<10;a++){for(b=1;b<10;){printf("%dx%d=%d\n",a,b++,a*b);}}exit;} | ^~~~
s513228000
p00000
C
include<vector> #include<list> #include<map> #include<set> #include<deque> #include<queue> #include<stack> #include<bitset> #include<algorithm> #include<functional> #include<numeric> #include<utility> #include<iostream> #include<sstream> #include<iomanip> #include<cmath> #include<cstdlib> #include<cctype> #include<string> #include<cstring> #include<cstdio> #include<ctime> #include<climits> #include<complex> #include<cassert> #define mp make_pair #define pb push_back #define sz(x) (int)((x).size()) #define all(x) x.begin(),x.end() #define clr(x) memset((x),0,sizeof(x)) #define rep(i,n) for (i=0;i<n;i++) #define Rep(i,a,b) for (i=a;i<=b;i++) #define ff(i,x) for (i=start[x];i!=-1;i=a[i].next) #define foreach(e,x) for(__typeof(x.begin()) e=x.begin();e!=x.end();++e) using namespace std; const double eps=1e-8; const double pi=acos(-1.0); int dblcmp(double d){if (fabs(d)<eps)return 0;return d>eps?1:-1;} typedef long long ll; typedef vector<int> vi; typedef vector<ll> vl; typedef vector<string> vs; typedef pair<int,int> pii; typedef vector<pii> vpi; int isleap(int y) { return (y%100!=0&&y%4==0||y%100==0); } int dd[]={0,31,28,31,30,31,30,31,31,30,31,30,31}; int days(int y,int m,int d) { int rt=0,i; for (i=0;i<y;i++) { rt+=isleap(i)+365; } for (i=1;i<m;i++) { rt+=dd[i]; rt+=isleap(y)&&(i==2); } rt+=d-1; return rt; } void nextday(int &y,int &m,int &d) { int dm=dd[m]+(isleap(y)&&(m==2)); if (d<dm) { ++d; return; } else if (m<12) { m++; d=1; return; } else { y++; m=d=1; return; } } bool v[31111]; int c[31111],sc[31111]; int h[31111],sh[31111]; int main() { int i,j,k; int o=days(1980,1,1); //cout<<days(2020,12,31)-o<<endl; int y,m,d; while (scanf("%d/%d/%d",&m,&d,&y)!=EOF) { int d1=days(y,m,d)-o; scanf("%d/%d/%d",&m,&d,&y); int d2=days(y,m,d)-o; int n; memset(v,0,sizeof(v)); scanf("%d",&n); while (n--) { int ya,ma,da; int yb,mb,db; scanf("%d/%d/%d",&ma,&da,&ya); scanf("%d/%d/%d",&mb,&db,&yb); int dx=days(ya,ma,da)-o; int dy=days(yb,mb,db)-o; for (i=dx;i<=dy;i++)v[i]=1; } //printf("%d %d\n",d1,d2); memset(c,0,sizeof(c)); memset(h,0,sizeof(h)); for (i=d1;i<d2;i++) { if (!v[i])c[i]=1; } sc[0]=c[0]; for (i=1;i<31111;i++) { sc[i]=c[i]+sc[i-1]; } for (i=d2;i<31111;i++) { if (!v[i])h[i]=1; } sh[0]=h[0]; for (i=1;i<31111;i++) { sh[i]=h[i]+sh[i-1]; } int ans; for (i=1000;i<=17000;i++) { int has=0,hf=0; /* for (j=i+1-1460;j<=i;j++) { if (v[j])continue; if (j<d1)continue; if (j>=d1&&j<d2)hf++; hf=min(hf,730); if (j>=d2) { has++; has+=hf/2; hf=0; } } */ j=i-1460; has=sh[i]; if (j>=0)has-=sh[j]; hf=sc[i]; if (j>=0)hf-=sc[j]; hf=min(hf,730); has+=hf/2; if (has>=1095) { //printf("%d\n",ans); ans=i; break; } } ans++; //printf("%d\n",ans); y=1980,m=1,d=1; while (ans--) { nextday(y,m,d); } printf("%d/%d/%d\n",m,d,y); } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<vector> | ^ main.c:2:9: fatal error: list: No such file or directory 2 | #include<list> | ^~~~~~ compilation terminated.
s216986587
p00000
C
main(){getch();}
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int] 1 | main(){getch();} | ^~~~ main.c: In function 'main': main.c:1:8: error: implicit declaration of function 'getch' [-Wimplicit-function-declaration] 1 | main(){getch();} | ^~~~~
s089470411
p00000
C
#include<cstdio> int main() { int i,j; for(i=1;i<=9;i++) { for(j=1;j<=9;j++) printf("%dx%d=%d\n",i,j,i*j); } return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s950149977
p00000
C
#include <iostream> #define max_size 1000 using namespace std; int main() { int d= 0; int j = 0; for(d = 1;d<= 9;d++) { for(j = 1;j<=9;j++) printf("%dx%d=%d\n",d ,j,d*j); } //system("pause"); return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s347074070
p00000
C
#include<stdio.h> int main(void){ int i,j; for(i=0;i<10;i++){ for(j=0;j<10;j++{ printf("%dx%d=%d",i,j,i*j); } } return 0; }
main.c: In function 'main': main.c:6:19: error: expected ')' before '{' token 6 | for(j=0;j<10;j++{ | ~ ^ | ) main.c:9:2: error: expected expression before '}' token 9 | } | ^
s093436616
p00000
C
#include <stdio.h> #define N 10; int main(void){ int i,j; for(i=1;i<N;i++) for(j=1;j<N;j++) printf("%dx%d=%d",i,j,i*j); return 0; }
main.c: In function 'main': main.c:6:20: error: expected expression before ';' token 6 | for(i=1;i<N;i++) | ^ main.c:7:28: error: expected expression before ';' token 7 | for(j=1;j<N;j++) | ^
s672706988
p00000
C
#include <stdio.h> #define N 10; int main(void){ int i,j; for(i=1;i<N;i++){ for(j=1;j<N;j++){ printf("%d",i); printf("x%d",j; printf("=%d"i*j); } } return 0; }
main.c: In function 'main': main.c:6:20: error: expected expression before ';' token 6 | for(i=1;i<N;i++){ | ^ main.c:7:28: error: expected expression before ';' token 7 | for(j=1;j<N;j++){ | ^ main.c:9:39: error: expected ')' before ';' token 9 | printf("x%d",j; | ~ ^ | ) main.c:10:42: error: expected ';' before '}' token 10 | printf("=%d"i*j); | ^ | ; 11 | } | ~
s401426109
p00000
C
#include<stdio.h> main(){ int a,b; for(a=1;a<10,a++){ for(b=1;b<10,b++){ printf("%dx%d=%d\n",a,b,a*b); } } return 0; }
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int] 3 | main(){ | ^~~~ main.c: In function 'main': main.c:6:17: error: expected ';' before ')' token 6 | for(a=1;a<10,a++){ | ^ | ; main.c:7:17: error: expected ';' before ')' token 7 | for(b=1;b<10,b++){ | ^ | ;
s817403466
p00000
C
#include <stdio.h> int main() { int i,j; for(i=0; i<9; i++) for(j=0; j<9; j++) printf("%dx%d=%d ",i+1,j+1,(i+1)*(j+1)); return 0; }
main.c: In function 'main': main.c:6:14: warning: missing terminating " character 6 | printf("%dx%d=%d | ^ main.c:6:14: error: missing terminating " character 6 | printf("%dx%d=%d | ^~~~~~~~~ main.c:7:1: warning: missing terminating " character 7 | ",i+1,j+1,(i+1)*(j+1)); | ^ main.c:7:1: error: missing terminating " character 7 | ",i+1,j+1,(i+1)*(j+1)); | ^~~~~~~~~~~~~~~~~~~~~~~ main.c:8:3: error: expected expression before 'return' 8 | return 0; | ^~~~~~ main.c:8:12: error: expected ';' before '}' token 8 | return 0; | ^ | ; 9 | } | ~
s929983494
p00000
C
%23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A
main.c:1:1: error: expected identifier or '(' before '%' token 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^ main.c:1:2: error: invalid suffix "include" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~~~~~~~ main.c:1:15: error: invalid suffix "Cstdio.h" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~~~~~~~ main.c:1:25: error: exponent has no digits 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:28: error: invalid suffix "Aint" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~~~ main.c:1:34: error: invalid suffix "main" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~~~~ main.c:1:50: error: invalid suffix "B" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:53: error: invalid suffix "A" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:59: error: invalid suffix "int" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~~~ main.c:1:69: error: invalid suffix "Cj" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~ main.c:1:73: error: invalid suffix "B" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:76: error: invalid suffix "A" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:82: error: invalid suffix "for" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~~~ main.c:1:92: error: invalid suffix "D0" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~ main.c:1:96: error: invalid suffix "B" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:103: error: invalid suffix "C9" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~ main.c:1:107: error: invalid suffix "B" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:114: error: invalid suffix "B" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:117: error: invalid suffix "B" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:123: error: invalid suffix "A" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~ main.c:1:135: error: invalid suffix "for" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~~~ main.c:1:145: error: invalid suffix "D0" on integer constant 1 | %23include%20%3Cstdio.h%3E%0Aint%20main%28%29%20%7B%0A%20%20int%20i%2Cj%3B%0A%20%20for%28i%3D0%3B%20i%3C9%3B%20i%2B%2B%29%0A%20%20%20%20for%28j%3D0%3B%20j%3C9%3B%20j%2B%2B%29%0A%20%20%20%20%20%20printf%28%22%25dx%25d%3D%25d%0A%22%2Ci%2B1%2Cj%2B1%2C%28i%2B1%29%2A%28j%2B1%29%29%3B%0A%20%20return%200%3B%0A%7D%0A | ^~~ main.c:1:149: error: invalid suffix "B" on integer
s225211129
p00000
C
/* * by purple * at 12-03-06 7:13:04 PM */ #include <cstdio> #include <algorithm> #include <cstring> #include <vector> #include <string> #include <map> #include <iostream> using namespace std; #define sz(x) ((int)((x).size())) #define out(x) printf(#x" %d\n", x) #define rep(i,n) for(int i=0;i<(n);++i) #define repf(i,a,b) for(int i=(a);i<=(b);++i) template<class T> struct arrayBase { vector<T> val; void clear() { val.clear(); } void insert(T x) { val.push_back(x); } arrayBase operator+(const arrayBase& x) const { arrayBase res = *this; rep (i, sz(res.val)) { res.val[i] = res.val[i] + x.val[i]; } return res; } arrayBase operator-(const arrayBase& x) const { arrayBase res = *this; rep (i, sz(res.val)) { res.val[i] = res.val[i] - x.val[i]; } return res; } arrayBase operator*(const arrayBase& x) const { arrayBase res = *this; rep (i, sz(res.val)) { res.val[i] = res.val[i] * x.val[i]; } return res; } arrayBase operator+(const int& x) const { arrayBase res = *this; rep (i, sz(res.val)) { res.val[i] = res.val[i] + x; } return res; } arrayBase operator-(const int& x) const { arrayBase res = *this; rep (i, sz(res.val)) { res.val[i] = res.val[i] - x; } return res; } arrayBase operator*(const int& x) const { arrayBase res = *this; rep (i, sz(res.val)) { res.val[i] = res.val[i] * x; } return res; } T self_add() { int res = val[sz(val) - 1]; for (int k = sz(val) - 2; k >= 0; --k) { res = val[k] + res; } return res; } T self_sub() { int res = val[sz(val) - 1]; for (int k = sz(val) - 2; k >= 0; --k) { res = val[k] - res; } return res; } T self_mul() { int res = val[sz(val) - 1]; for (int k = sz(val) - 2; k >= 0; --k) { res = val[k] * res; } return res; } }; typedef arrayBase<int> array1D; typedef arrayBase<array1D> array2D; typedef arrayBase<array2D> array3D; char s[88]; void APLparser() { } int main() { int Case = 1; while (gets(s), s[0] != '#') { printf ("Case %d: %s\n", Case++, s); APLparser(); } return 0; } array1D
main.c:6:10: fatal error: cstdio: No such file or directory 6 | #include <cstdio> | ^~~~~~~~ compilation terminated.
s371037031
p00000
C
#include<cstdio> #include<cstring> #include<map> #include<algorithm> #include<iostream> using namespace std; const int M = 10000; int tonum(char* s) { int i = 0,ans = 0; if(s[0] == '1') ans += 1; if(s[1] == '1') ans += 2; if(s[2] == '1') ans += 4; return ans; } int m[M],d[M],hh[M],mm[M],state[M]; char ss[100]; char who[M][10]; int dday[M],ttime[M]; int sum[100]; int tbg[100],ted[100]; void fun(int l,int r) { memset(tbg,-1,sizeof(tbg)); memset(ted,-1,sizeof(ted)); for(int i = l;i <r;i++) { int p = tonum(who[i]); if(state[i] == 0) tbg[p] = ttime[i]; else ted[p] = ttime[i]; } if(tbg[0] == -1 || ted[0] == -1) return ; for(int i = 1 ;i < 8;i++) { if(tbg[i] >= tbg[0] && ted[i] <= ted[0] ) sum[i] += ted[i] - tbg[i]; else if(tbg[i] >= tbg[0] && ted[i] > ted[0] && ted[0] > tbg[i]) sum[i] += ted[0] - tbg[i]; else if(tbg[i] < tbg[0] && ted[i] > tbg[0] && ted[i] < ted[0]) sum[i] += ted[i] - tbg[0]; else if(tbg[i] < tbg[0] && ted[i] > ted[0]) sum[i] += ted[0] - tbg[0]; else ; } } int main() { int n,i,j,k; while(cin>>n) { memset(sum,0,sizeof(sum)); for(i=0;i<n;i++) { scanf("%d/%d %d:%d %s %s",m+i,d+i,hh+i,mm+i,ss,who[i]); printf("%d/%d %d:%d %s %s\n",m[i],d[i],hh[i],mm[i],ss,who[i]); if(ss[0] == 'I') state[i] = 0; else state[i] = 1; dday[i] = m[i] * 30 + d[i] ; ttime[i] = hh[i] * 60 + mm[i]; } for(i=0;i<n;) { int l = i; int r = i; for( j = l+1;j < n;j++) { if(dday[j] == dday [j -1]) r = j; else break; } printf("l = %d r = %d\n",l,r); fun(l,r); i = r+1; } int Max = 0; for(i = 0; i< 8;i++) Max = max(sum[i],Max); printf("%d\n",Max); } }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s230732312
p00000
C
#include<stdio.h> main(){ int a; for(a=1;a<100;a++){ b=a*a printf("%d×%d=%d",a,a,b); } }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(){ | ^~~~ main.c: In function 'main': main.c:5:6: error: 'b' undeclared (first use in this function) 5 | b=a*a | ^ main.c:5:6: note: each undeclared identifier is reported only once for each function it appears in main.c:5:11: error: expected ';' before 'printf' 5 | b=a*a | ^ | ; 6 | printf("%d×%d=%d",a,a,b); | ~~~~~~
s570644078
p00000
C
#include<stdio.h> int main(){ int a,b; for(a=1;a<10;a++){ b=a*a; printf("%d×%d=%d",a,a,b); } return o; }
main.c: In function 'main': main.c:8:13: error: 'o' undeclared (first use in this function) 8 | return o; | ^ main.c:8:13: note: each undeclared identifier is reported only once for each function it appears in
s396431830
p00000
C
#include<stdio.h> int main(){ int i; int j; for (i=1; i<10; i++){ for (j=1; j<10; j++){ printf("%dx%d=%d\n", j,i, j*i); } } return 0; } ~ ~
main.c:14:1: error: expected identifier or '(' before '~' token 14 | ~ | ^
s580502968
p00000
C
あなたの、あたまを、あたらしく。
main.c:1:9: error: stray '\343' in program 1 | <U+3042><U+306A><U+305F><U+306E><U+3001><U+3042><U+305F><U+307E><U+3092><U+3001><U+3042><U+305F><U+3089><U+3057><U+304F><U+3002> | ^~~~~~~~ main.c:1:1: error: unknown type name '\U00003042\U0000306a\U0000305f\U0000306e' 1 | あなたの、あたまを、あたらしく。 | ^~~~~~~~ main.c:1:19: error: stray '\343' in program 1 | <U+3042><U+306A><U+305F><U+306E><U+3001><U+3042><U+305F><U+307E><U+3092><U+3001><U+3042><U+305F><U+3089><U+3057><U+304F><U+3002> | ^~~~~~~~ main.c:1:21: error: expected '=', ',', ';', 'asm' or '__attribute__' before '\U00003042\U0000305f\U00003089\U00003057\U0000304f' 1 | あなたの、あたまを、あたらしく。 | ^~~~~~~~~~ main.c:1:31: error: stray '\343' in program 1 | <U+3042><U+306A><U+305F><U+306E><U+3001><U+3042><U+305F><U+307E><U+3092><U+3001><U+3042><U+305F><U+3089><U+3057><U+304F><U+3002> | ^~~~~~~~
s397987312
p00000
C
public class Main { public static void main(String[] args) { for (int i = 1; i <= 9; i++) { for (int j = 1; j <= 9; j++) { System.out.println(i + "×" + j + "=" + i * j); } } } }
main.c:1:1: error: unknown type name 'public' 1 | public class Main { | ^~~~~~ main.c:1:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'Main' 1 | public class Main { | ^~~~
s638174023
p00000
C
#include<iostream> #include<vector> #include<algorithm> #include<cstdio> #include<queue> #include<stack> #include<string> #include<map> #include<set> #include<cmath> #include<cassert> #include<cstring> #include<iomanip> using namespace std; #define FOR(i,a,b) for( int i = (a) ; i <= (b) ; i ++) #define FF(i,a) for( int i = 0 ; i < (a) ; i ++) #define FFD(i,a) for( int i = (a)-1 ; i >= 0 ; i --) #define S64(a) scanf(in64,&a) #define SS(a) scanf("%d",&a) #define LL(a) ((a)<<1) #define RR(a) (((a)<<1)+1) #define pb push_back #define CL(Q) while(!Q.empty())Q.pop() #define MM(name,what) memset(name,what,sizeof(name)) #define read freopen("in.txt","r",stdin) #define write freopen("out.txt","w",stdout) const int inf = 0x3f3f3f3f; const double oo = 10e9; const double eps = 1e-10; const double pi = acos(-1.0); char a[6][6]; string s; int sx,sy; //譽狗尨荳岩?x窶吝柱窶椀窶咏噪謨ー驥? int num(int x,int y) // 扈呎」狗尨逧?ッ丈クェ轤ケ郛門捷??~16 { return (x-1)*4+y; } bool you(int x,int temp) //逵?x 逧?コ瑚ソ帛宛蠖「蠑冗噪隨ャ temp 菴肴弍蜷ヲ荳コ 1 { return (x&(1<<temp)); } bool win(int x) // 蛻、譁ュ螻?擇譏ッ蜷ヲ蟾イ扈剰オ「莠? { int temp; bool ok; for(int u=1;u<=4;u++) { ok = true; for(int k=1;k<=4;k++) { temp = num(u,k); if(!you(x,temp)) { ok = false; break; } } if(ok) return true; } for(int k=1;k<=4;k++) { ok = true; for(int u=1;u<=4;u++) { temp = num(u,k); if(!you(x,temp)) { ok = false; break; } } if(ok) return true; } ok = true; for(int u=1;u<=4;u++) { temp = num(u,u); if(!you(x,temp)) { ok = false; break; } } if(ok) return true; ok = true; for(int u=1;u<=4;u++) { temp = num(5-u,u); if(!you(x,temp)) { ok = false; break; } } if(ok) return true; return false; } bool dfwin(int step,int x,int y,bool wh) //蛻、譁ュXXX譏ッ蜷ヲ閭ス襍「 { if(win(x)) return true; if(win(y)) return false; if(step == 17) return false; if(wh) { for(int u=1;u<=16;u++) { if(!you(x,u) && !you(y,u)) { if(dfwin(step+1,x+(1<<u),y,false)) { return true; } } } return false; } else { for(int u=1;u<=16;u++) { if(!you(x,u) && !you(y,u)) { if(!dfwin(step+1,x,y+(1<<u),true)) { return false; } } } return true; } } bool dflose(int step,int x,int y,bool wh) //蛻、譁ュXXX譏ッ蜷ヲ閭ス霎? { if(win(x)) return false; if(win(y)) return true; if(step == 17) return false; if(wh) { for(int u=1;u<=16;u++) { if(!you(x,u) && !you(y,u)) { if(dflose(step+1,x+(1<<u),y,false)) { return true; } } } return false; } else { for(int u=1;u<=16;u++) { if(!you(x,u)&&!you(y,u)) { if(!dflose(step+1,x,y+(1<<u),true)) { return false; } } } return true; } } bool pin(int step,int x,int y,bool wh) //蛻、譁ュXXX譏ッ蜷ヲ閭ス蟷ウ { if(win(x) || win(y)) return false; if(step == 17) return true; if(wh) { for(int u=1;u<=16;u++) { if(!you(x,u) && !you(y,u)) { if(pin(step+1,x+(1<<u),y,false)) { return true; } } } return false; } else { for(int u=1;u<=16;u++) { if(!you(x,u) && !you(y,u)) { if(!pin(step+1,x,y+(1<<u),true)) { return false; } } } return true; } } bool start() { int temp; int x,y; x = 0; y = 0; if(sx == sy) { for(int u=1;u<=4;u++) { for(int k=1;k<=4;k++) { if(a[u][k]=='x') { temp = num(u,k); x |= 1<<temp; } else if(a[u][k] == 'o') { temp = num(u,k); y |= 1<<temp; } } } } else { for(int u=1;u<=4;u++) { for(int k=1;k<=4;k++) { if(a[u][k]=='x') { temp = num(u,k); y |= 1<<temp; } else if(a[u][k] == 'o') { temp = num(u,k); x |= 1<<temp; } } } } int step = sx+sy +1; if(s=="LOSE") { return dflose(step,x,y,true); } else if(s=="WIN") { return dfwin(step,x,y,true); } else if(s=="TIE") { return pin(step,x,y,true); } } int main() { int T; freopen("f.in","r",stdin); freopen("hisf.out","w",stdout); cin>>T; while(T--) { cin>>s; sx =0; sy= 0; for(int i=1;i<=4;i++) { for(int j=1;j<=4;j++) { cin>>a[i][j]; if(a[i][j]=='x') { sx++; } else if(a[i][j]=='o') { sy++; } } } if(start()) { cout<<"YES"<<endl; } else { cout<<"NO"<<endl; } } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s097145795
p00000
C
class Main{ public static void main(String[] a){ for(int i = 1; i <= 9; i++){ for(int j = 1; j <= 9; j++) System.out.printf("%dx%d=%d\n", i, j, i * j); } } }
main.c:1:1: error: unknown type name 'class' 1 | class Main{ | ^~~~~ main.c:1:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token 1 | class Main{ | ^
s388983211
p00000
C
#include<iostream> using namespace std; int main(){ for(int i=1; i<10; i++){ for(int j=1; j<10; j++){ cout <<i<<"x"<<j<<"="<<i*j<<endl; } } }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s708196239
p00000
C
#include<iostream> using namespace std; int main(){ for(int i=1; i<10; i++){ for(int j=1; j<10; j++){ cout <<i<<"x"<<j<<"="<<i*j<<endl; } } return 0; }
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s575067573
p00000
C
#include<stdio.h> int main(void) { inta,i,j; for(i=1;i<10;i++) for(j=1;j<10;j++) { printf("%dx%d=%d\n",i,j,a,a=i*j); } return 0; }
main.c: In function 'main': main.c:4:9: error: 'inta' undeclared (first use in this function); did you mean 'int'? 4 | inta,i,j; | ^~~~ | int main.c:4:9: note: each undeclared identifier is reported only once for each function it appears in main.c:4:14: error: 'i' undeclared (first use in this function) 4 | inta,i,j; | ^ main.c:4:16: error: 'j' undeclared (first use in this function) 4 | inta,i,j; | ^ main.c:8:49: error: 'a' undeclared (first use in this function) 8 | printf("%dx%d=%d\n",i,j,a,a=i*j); | ^
s384418897
p00000
C
#include <iostream> using namespace std; int main() { int i, j; for (i = 1; i <= 9; i++) { for (j = 1; j <= 9; j++){ cout << i << "x" << j << "=" << i*j <<"\n"; } } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s385168452
p00000
C
#include<stdio.h> int main(){ int a,b; for(a=1;a<10;a++){ for(b=1;b<10;b++){ puts("%d×%d=%d\n",a,b,a*b); } } return 0; }
main.c: In function 'main': main.c:8:13: error: too many arguments to function 'puts' 8 | puts("%d×%d=%d\n",a,b,a*b); | ^~~~ In file included from main.c:1: /usr/include/stdio.h:714:12: note: declared here 714 | extern int puts (const char *__s); | ^~~~
s474055672
p00000
C
X;main(Y){for(;++X<10;for(Y=0;Y<9;printf("%dx%d=%d\n",X,Y,++Y*X)));}
main.c:1:1: warning: data definition has no type or storage class 1 | X;main(Y){for(;++X<10;for(Y=0;Y<9;printf("%dx%d=%d\n",X,Y,++Y*X)));} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'X' [-Wimplicit-int] main.c:1:3: error: return type defaults to 'int' [-Wimplicit-int] 1 | X;main(Y){for(;++X<10;for(Y=0;Y<9;printf("%dx%d=%d\n",X,Y,++Y*X)));} | ^~~~ main.c: In function 'main': main.c:1:3: error: type of 'Y' defaults to 'int' [-Wimplicit-int] main.c:1:23: error: expected expression before 'for' 1 | X;main(Y){for(;++X<10;for(Y=0;Y<9;printf("%dx%d=%d\n",X,Y,++Y*X)));} | ^~~
s836026726
p00000
C
#include <stdio.h> int main() { int i,j; for(i=1;i<10;i++) { for (j=1;j<10;j++) { printf("%d%*d=%d\n",i,j,i*j) } } return 0; }
main.c: In function 'main': main.c:9:53: error: expected ';' before '}' token 9 | printf("%d%*d=%d\n",i,j,i*j) | ^ | ; 10 | } | ~
s445883545
p00000
C
main (0){for(;X++<90;)printf("%dx%d=%d",X/9,X%9,X/9*X%9)}
main.c:1:7: error: expected declaration specifiers or '...' before numeric constant 1 | main (0){for(;X++<90;)printf("%dx%d=%d",X/9,X%9,X/9*X%9)} | ^
s166250878
p00000
C
#include <iostream> #include <algorithm> #include <vector> using namespace std; #define REP(i, n) for (int i = 0; i < n; ++i) #define PB push_back vector<int> group[36]; int n, cost[36], sz[36]; vector<vector<int> > cut[5]; long long sum[36]; long long best = 0, pos; void dfs(int u, int a, int b, int c, int d, long long cos, long long plan) { if (u == n) { if (cos > best) { if (a < c) return; a -= c; b %= 2; if (2*a < b) return; best = cos; pos = plan; } return; } if (sum[u] + cos < best) return; int s = sz[u]; for (int i = 0; i < cut[s].size(); ++i) { int x[4] = {a, b, c, d}; long long nxt = cos; REP(j, cut[s][i].size()) { nxt += cost[u] * (cut[s][i][j])*(cut[s][i][j]-1); ++x[cut[s][i][j]-1]; } dfs(u+1, x[0], x[1], x[2], x[3], nxt, (plan+i)*cut[s].size()); } } int main() { cut[1].resize(1); cut[1][0].PB(1); cut[2].resize(2); cut[2][0].PB(2); cut[2][1].PB(1), cut[2][1].PB(1); cut[3].resize(3); cut[3][0].PB(3); cut[3][1].PB(2), cut[3][1].PB(1); cut[3][2].PB(1), cut[3][2].PB(1), cut[3][2].PB(1); cut[4].resize(5); cut[4][0].PB(4); cut[4][1].PB(3), cut[4][1].PB(1); cut[4][2].PB(2), cut[4][2].PB(2); cut[4][3].PB(2), cut[4][3].PB(1), cut[4][3].PB(1); cut[4][4].PB(1), cut[4][4].PB(1), cut[4][4].PB(1), cut[4][4].PB(1); while (cin >> n) { REP(i, n) group[i].clear(); REP(i, n) { cin >> sz[i] >> cost[i]; group[i].resize(sz[i]); REP(j, sz[i]) cin >> group[i][j]; } sum[n-1] = cost[n-1]; for (int i = n-2; i >= 0; --i) sum[i] = cost[i] + sum[i+1]; best = -1; dfs(0, 0, 0, 0, 0, 0, 0); cout << best << endl; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s472195952
p00000
C
#include <stdio.h>$ $ int main() {$ int i, j;$ $ for (i = 1; i <= 9; i++) {$ for (j = 1; j <= 9; j++) {$ printf("%dx%d=%d\n", i, j, i * j);$ }$ }$ $ return 0;$ }$
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include <stdio.h>$ | ^ main.c:2:2: error: expected ';' before 'int' 2 | $ | ^ | ; 3 | int main() {$ | ~~~ main.c: In function 'main': main.c:3:13: error: '$' undeclared (first use in this function) 3 | int main() {$ | ^ main.c:3:13: note: each undeclared identifier is reported only once for each function it appears in main.c:3:14: error: expected ';' before 'int' 3 | int main() {$ | ^ | ; 4 | int i, j;$ | ~~~ main.c:4:13: error: expected ';' before '$' 4 | int i, j;$ | ^ | ; 5 | $ | ~ main.c:12:13: error: expected ';' before '}' token 12 | return 0;$ | ^ | ; 13 | }$ | ~ main.c: At top level: main.c:13:1: error: expected '=', ',', ';', 'asm' or '__attribute__' at end of input 13 | }$ | ^
s983284845
p00000
C
# include <cstring> # include <cstdlib> # include <cstdio> # include <iostream> # include <algorithm> using namespace std; long long solve (long long n,long long x) { if (n<=0) return 0; int a[20],tot=0; long long num[20]; long long nn=n; while (nn) { a[++tot]=nn%10; nn/=10; } long long xx=x/10; int len=1; while (xx) { len++; xx/=10; } int now=tot-len-1; num[0]=1; for (int i=1;i<=now || i<=len;i++) num[i]=num[i-1]*10; long long ans=0; for (int i=tot;i>=len+1;i--) { for (int j=0;j<a[i];j++) ans+=num[now]; now--; } if (n%num[len]>=x) ans++; return ans; } int main (void) { int t; cin>>t; while (t--) { long long x,a,b; cin>>x>>a>>b; cout<<solve(b,x)-solve(a-1,x)<<endl; } return 0; }
main.c:1:11: fatal error: cstring: No such file or directory 1 | # include <cstring> | ^~~~~~~~~ compilation terminated.
s466320326
p00000
C
#include<cstdio> #include<cstring> #include<iostream> using namespace std; unsigned long long pow[20]; unsigned long long func(unsigned long long a,unsigned long long x) { int i,res,p,l,r; if (x==0) { l=a/10; r=a%10; res=l; if (r>0) res++; return res; } for (i=0;i<20;i++) if (x/pow[i]==0) { p=i; break; } l=a/pow[p]; r=a%pow[p]; res=l; if (r>x) res++; return res; } main() { int i,t; unsigned long long x,a,b,ans; pow[0]=1; for (i=1;i<20;i++) pow[i]=pow[i-1]*10; cout<<pow[18]<<endl; cin>>t; while (t--) { cin>>x>>a>>b; ans=func(b+1,x)-func(a,x); cout<<"a "<<func(a,x)<<endl; cout<<"b "<<func(b+1,x)<<endl; cout<<ans<<endl; } return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s701550235
p00000
C
#include <iostream> using namespace std; int main() { int i,j; for (i=1; i<=9; i++){ for (j=1; j<=9; j++){ printf ("%dx%d=%d\n", i, j, i*j); } } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s692359407
p00000
C
X,Y;main(0){for(;++X<10;)for(Y=0;Y<9;)printf("%dx%d=%d\n",X,Y,X*++Y);}
main.c:1:1: warning: data definition has no type or storage class 1 | X,Y;main(0){for(;++X<10;)for(Y=0;Y<9;)printf("%dx%d=%d\n",X,Y,X*++Y);} | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'X' [-Wimplicit-int] main.c:1:3: error: type defaults to 'int' in declaration of 'Y' [-Wimplicit-int] 1 | X,Y;main(0){for(;++X<10;)for(Y=0;Y<9;)printf("%dx%d=%d\n",X,Y,X*++Y);} | ^ main.c:1:10: error: expected declaration specifiers or '...' before numeric constant 1 | X,Y;main(0){for(;++X<10;)for(Y=0;Y<9;)printf("%dx%d=%d\n",X,Y,X*++Y);} | ^
s415998767
p00000
C
#include <iostream> #include <cstdio> #include <string.h> #include <algorithm> #include <string> #include <vector> #include <map> using namespace std; struct Man { string name; map<string, int> have; Man() {} Man(string _name) { name = _name; have.clear(); } void add(string st) { have[st]++; } }; const string S[34] = {"1N", "2N", "3N", "4N", "5N", "6N", "7N", "8N", "9N", "1S", "2S", "3S", "4S", "5S", "6S", "7S", "8S", "9S", "1B", "2B", "3B", "4B", "5B", "6B", "7B", "8B", "9B", "EH", "SH", "WH", "NH", "rH", "wH", "gH"}; const int maxn = 137, maxt = 507; int run, total; Man man[4]; string s[maxn]; string a[14]; map<string, int> hand[maxt]; void Add_hand(string a[14]) { ++total; hand[total].clear(); for (int i = 0; i < 14; i++) hand[total][a[i]]++; } void prepare() { total = 0; //Special 13T a[0] = "EH"; a[1] = "SH"; a[2] = "WH"; a[3] = "NH"; a[4] = "rH"; a[5] = "wH"; a[6] = "gH"; a[7] = "1N"; a[8] = "9N"; a[9] = "1S"; a[10] = "9S"; a[11] = "1B"; a[12] = "9B"; for (int i = 0; i < 13; i++) { a[13] = a[i]; Add_hand(a); } ///////////////////////////////////////////////////// } bool isPair(string a, string b) { return a==b; } bool check(Man a) { //Special 7Pair int sum = 0; for (map<string, int>::iterator it = a.have.begin(); it != a.have.end(); it++) if (it->second>=2) sum++; if (sum>=7) return true; ///////////////////////////////////////////////////// } void work() { for (int i = 1; i <= 136; i++) cin >> s[i]; man[0] = Man("Takakamo Shizuno"); man[1] = Man("Atarashi Ako"); man[2] = Man("Matsumi Kuro"); man[3] = Man("Haramura Nodoka"); int sign = 0; for (int i = 1; i <= 3; i++) for (int j = 0; j < 4; j++) for (int k = 1; k <= 4; k++) man[j].add(s[++sign]); for (int j = 0; j < 4; j++) man[j].add(s[++sign]); for (int turn = 1; turn <= 21; turn++) for (int i = 0; i < 4; i++) { man[i].add(s[++sign]); if (check(man[i])) { return; } } } int main() { prepare(); int test; for (run = 1; run <= test; run++) work(); }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s585238050
p00000
C
#include <iostream> #include <cstdio> #include <string> #include <cstring> using namespace std ; #define Maxn 1005 typedef long long LL ; int main() { while (cin >> n>>m>>op ) { for (int i=1;i<=op;i++){ cin>>s; if (s[0]=='D'){ cin>>xc>>yc>>r>>c; for (int j=xc-r;j<=xc+r;j++){ up=yc+r-abs(xc-j); down=yc-(r-abs(xc-j)); update(j,up,down,c); //蝨ィ隨ャj譽オ譬台ク雁ー?p蛻ーdown蛹コ髣エ譟捺?c } } if (s[0]=='T'){ cin>>xc>>yc>>w>>c>>W; } if (s[0]=='R'){ cin>>xc>>yc>>l>>w>>c; for (int j=) } if (s[0]=='C'){ cin>>xc>>yc>>rc>>c; } } } return 0 ; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s181236975
p00000
C
include<stdio.h> int main() { int i, j; for(i = 1; i <= 9; i++) { for(j = 1; j <= 9; j++) { printf("%d*%d=%d\n", i, j, i*j); } } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^
s942657999
p00000
C
#include <stdio.h> int main() { char hoge[100]; gets(hoge); }
main.c: In function 'main': main.c:5:1: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 5 | gets(hoge); | ^~~~ | fgets
s855356613
p00000
C
#include <iostream> using namespace std; int main() { int i,j; for(i=1;i<=9;i++) { for(j=1;j<=9;j++) { cout<<i<<"*"<<j<<"="<<i*j<<endl; } } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s226395923
p00000
C
#incldue<stdio.h> int main() { int i,j; for(i=1;i<=9;i++) for(j=1;j<=9;j++) printf("%d*%d=%d\n",i,j,i*j); return 0; }
main.c:1:2: error: invalid preprocessing directive #incldue; did you mean #include? 1 | #incldue<stdio.h> | ^~~~~~~ | include main.c: In function 'main': main.c:7:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration] 7 | printf("%d*%d=%d\n",i,j,i*j); | ^~~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf' +++ |+#include <stdio.h> 1 | #incldue<stdio.h> main.c:7:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch] 7 | printf("%d*%d=%d\n",i,j,i*j); | ^~~~~~ main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'printf'
s171025474
p00000
C
#include <cstdlib> #include <cctype> #include <cstring> #include <cstdio> #include <cmath> #include <algorithm> #include <vector> #include <string> #include <iostream> #include <sstream> #include <map> #include <set> #include <queue> using namespace std; #define lowbit(x) (x&(-x)) #define LL long long #define ULL unsigned long long #define maxn 20005 #define msize 2001 #define mod 1000000009ll #define CC(m,what) memset(m,what,sizeof(m)) #define inf 0x7f7f7f7f #define eps 1e-12 #define lson l , mid , fa << 1 #define rson mid + 1 , r , fa << 1 | 1 #define pi acos(-1.0) #define keytree (ch[ch[root][1]][0]) template<class Z>inline bool checkmax(Z &a,Z b){if(a==-1||a<b){a=b;return true;}return false;} template<class Z>inline bool checkmin(Z &a,Z b){if(a==-1||a>b){a=b;return true;}return false;}
main.c:1:10: fatal error: cstdlib: No such file or directory 1 | #include <cstdlib> | ^~~~~~~~~ compilation terminated.
s108693189
p00000
C
#include <stdio.h> int main(){int i,j;for(i=1;i<=9;i++)for(j=1;j<=9;j++)printf("%dx%d=%d\n",i,j,i*j);return 0;}
main.c:1:20: warning: extra tokens at end of #include directive 1 | #include <stdio.h> int main(){int i,j;for(i=1;i<=9;i++)for(j=1;j<=9;j++)printf("%dx%d=%d\n",i,j,i*j);return 0;} | ^~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start': (.text+0x17): undefined reference to `main' collect2: error: ld returned 1 exit status
s393616887
p00000
C
#include <iostream> using namespace std; int main() { for(int j=1;j<=9;j++) for(int i=1;i<10;i++) { cout<<j<<"x"<<i<<"="<<i*j<<endl; } return 0; }
main.c:1:10: fatal error: iostream: No such file or directory 1 | #include <iostream> | ^~~~~~~~~~ compilation terminated.
s317262751
p00000
C
#include<cstdio> #include<queue> #include<cstring> using namespace std; #define inf 0x3f3f3f3f #define min(a,b) (a>b?a:b) const int maxn=200000; const int maxm=200000; int a[200][200]; bool isprm[20000]; bool vis[200][200]; typedef pair<int,int> T; struct Nod { int b,val,nxt; void init(int b,int val,int nxt) { this->b=b;this->val=val;this->nxt=nxt; } }; //struct Dijkstra //{ // Nod buf[200000];int len; // int E[maxn],n; // int d[maxn]; // void init(int n) // { // this->n=n; // memset(E,255,sizeof(E)); // len=0; // } // void addEdge(int a,int b,int val) // { // buf[len].init(b,val,E[a]);E[a]=len++; // } // void solve(int s) // { // static priority_queue<T,vector<T>,greater<T> >q; // while(!q.empty()) q.pop(); // memset(d,63,sizeof(d)); // d[s]=0; // q.push(T(0,s)); // int u,du,v,dv; // while(!q.empty()) // { // u=q.top().second; // du=q.top().first; // q.pop(); // if(du!=d[u]) continue; // for(int i=E[u];i!=-1;i=buf[i].nxt) // { // v=buf[i].b; // dv=du+buf[i].val; // if(dv<d[v]) // { // d[v]=dv; // q.push(T(dv,v)); // } // } // } // } //}dij; #define th(x) this->x=x; struct SPFA { Nod buf[maxm]; int len; int E[maxn],n; int d[maxn]; void init(int n) { th(n); memset(E,255,sizeof(E)); len=0; } void addEdge(int a,int b,int val) { buf[len].init(b,val,E[a]); E[a]=len++; } bool solve(int s) { static queue<int> q; static int cnt[maxn]; static bool vis[maxn]; while(!q.empty())q.pop(); memset(cnt,0,sizeof(cnt)); memset(d,63,sizeof(d)); memset(vis,0,sizeof(vis)); d[s]=0; q.push(s); vis[s]=true; int u,v; while(!q.empty()) { u=q.front(); q.pop(); vis[u]=false; for(int i=E[u];i!=-1;i=buf[i].nxt) { v=buf[i].b; if(d[u]+buf[i].val<d[v]) { d[v]=d[u]+buf[i].val; if(!vis[v]) { q.push(v); vis[v]=true; } if(++cnt[v]>n)return false; } } } return true; } }; SPFA dij; int main() { memset(a,-1,sizeof(a)); memset(isprm,1,sizeof(isprm)); isprm[1]=0; for(int i=2;i<20000;i++) if(isprm[i]) for(int j=i+i;j<20000;j+=i) isprm[j]=0; int x=100,y=100,k=1,dir=1,step=1; a[x][y]=1; while(k<=30000) { if(dir==1) { for(int i=0;i<step;i++) a[x][++y]=++k; dir=2; } if(dir==2) { for(int i=0;i<step;i++) a[--x][y]=++k; dir=3;step++; } if(dir==3) { for(int i=0;i<step;i++) a[x][--y]=++k; dir=4; } if(dir==4) { for(int i=0;i<step;i++) a[++x][y]=++k; dir=1;step++; } } //for(int i=95;i<105;i++,puts("")) for(int j=95;j<105;j++) printf("%3d ",a[i][j]); dij.init(20000); int dx[]={1,-1,0,0}; int dy[]={0,0,1,-1}; for(int i=5;i<195;i++) for(int j=5;j<195;j++) { if(a[i][j]==-1||isprm[a[i][j]]) continue; for(int k=0;k<4;k++) { int x=dx[k]+i; int y=dy[k]+j; if(a[x][y]==-1||isprm[a[x][y]]) continue; dij.addEdge(a[i][j],a[x][y],1); dij.addEdge(a[x][y],a[i][j],1); } } int s,e,cas=1; while(scanf("%d%d",&s,&e)!=EOF) { dij.solve(s); int ans=dij.d[e]; printf("Case %d: ",cas++); if(ans==0x3f3f3f3f) puts("impossible"); else printf("%d\n",ans); } return 0; } //#include <cstdio> //int main() //{ // int n,p,q,cas=1; // while(~scanf("%d%d%d",&n,&p,&q)) // { // printf("Case %d: ",cas++); // if(q == 0) // { // if(p == 0) printf("0.5000\n"); // else printf("0.0000\n"); // } // else // printf("%.4f\n",q*1.0/p); // } //}
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s920597827
p00000
C
#include<cstdio> #include<algorithm> using namespace std; struct seg { int a,b; bool operator < (const seg p) const { return a!=p.a?a<p.a:b>p.b; } }s[50000]; int main() { //freopen("d:\\in.txt","r",stdin); int l,g; while(scanf("%d%d",&l,&g),l||g) { for(int i=0;i<g;i++) { int x,r; scanf("%d%d",&x,&r); s[i].a=x-r; s[i].b=x+r; } sort(s,s+g); int cnt=0,pre=0,i=0,fg=1; while(i<g&&pre<l) { int j=i,tmp=pre; for(;s[j].a<=pre&&j<g;j++) if(s[j].b>tmp) tmp=s[j].b; if(j==0||j>=g&&tmp<l) fg=0; i=j,pre=tmp,cnt++; } printf("%d\n",fg?g-cnt:-1); } return 0; }
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s210648365
p00000
C
#include<stdio.h> int main() { int a,b,c; for(a=1;a<10;i++) { for(b=1;b<10;i++) { c = a * b; printf("%dx%d=%d\n"); } } return 0; }
main.c: In function 'main': main.c:5:14: error: 'i' undeclared (first use in this function) 5 | for(a=1;a<10;i++) | ^ main.c:5:14: note: each undeclared identifier is reported only once for each function it appears in
s841205191
p00000
C
include<stdio.h> int main(){ int i,j; for(i=1;i<10;i++){ for(j=1;j<10;j++) printf("%dx%d=%d\n",i,j,i*j); } return 0; }
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include<stdio.h> | ^