submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s840373859
p00618
C
int __builtin_popcount(int i,int n) { int j,res; res = 0; for(j = 0;j<n;j++) if((i >> j) & 1) res++; return res; }
main.c:1:5: warning: conflicting types for built-in function '__builtin_popcount'; expected 'int(unsigned int)' [-Wbuiltin-declaration-mismatch] 1 | int __builtin_popcount(int i,int n) | ^~~~~~~~~~~~~~~~~~ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start...
s926957518
p00618
C
#include<iostream> #include<cstdio> #include<vector> using namespace std; typedef vector<int> VI; typedef vector<VI> VVI; int ans,U; void dfs(VI& G,VI& c,int total,int cost,int b) { if(cost >= ans) return; int n = G.size(); for(int i=0;i<n;i++) { if((b>>i) & 1) continue; int pre = G[i]; ...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s495641409
p00618
C
#include<cstdio> #include<iostream> #include<bitset> #include<deque> #include<algorithm> using namespace std; struct Pox { int state,cost; Pox(int state,int cost):state(state),cost(cost){} }; int main() { while(1) { int n,U,k,r; scanf("%d %d",&n,&U); if(n+U == 0) break; deque<Pox> d...
main.c:1:9: fatal error: cstdio: No such file or directory 1 | #include<cstdio> | ^~~~~~~~ compilation terminated.
s396872565
p00618
C++
#include<iostream> #include<algorithm> using namespace std; int popcount32(unsigned int x){ x = (x>>1 & 0x55555555)+(x & 0x55555555); x = (x>>2 & 0x33333333)+(x & 0x33333333); x = (x>>4 & 0x0f0f0f0f)+(x & 0x0f0f0f0f); x = (x>>8 & 0x00ff00ff)+(x & 0x00ff00ff); return (x>>16)+(x & 0x0000ffff); } int tanni[20]; in...
a.cc: In function 'int main()': a.cc:20:17: error: 'memset' was not declared in this scope 20 | memset(tanni,0,sizeof(tanni)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<algorithm> ...
s409623895
p00618
C++
#include <iostream> #include <algorithm> #include <queue> using namespace std; #define MAX 20 #define INF 1e9 struct State{ int total,sub,S; State(int total,int sub,int S) : total(total),sub(sub),S(S) {} }; int main(){ int N,U,c[MAX],k,r; while(cin >> N >> U, (N | U)){ int arr[MAX]; for(int i = 0 ;...
a.cc: In function 'int main()': a.cc:31:5: error: 'memset' was not declared in this scope 31 | memset(visited,false,sizeof(visited)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <queue> +++ |+#include <cs...
s207827619
p00618
C++
#include <iostream> #include <vector> #include <cmath> #include <map> #include <stack> #include <algorithm> using namespace std; int main() { for( int a,worse; cin>>a>>worse , a|worse ; ) { map< int , int > m; map< int , vector<int> > flg; for( int i=0 ; i<a ; i++ ) { int num1,num2; cin>> num1 >> num2...
a.cc: In function 'int main()': a.cc:34:38: error: 'INT_MAX' was not declared in this scope 34 | int maxIndex=INT_MAX; | ^~~~~~~ a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>' 6...
s004651226
p00618
C++
#include<cstdio> #include<algorithm> using namespace std; #define REP(i, N) for(int i=0;i<(int)(N);++i) int unit[20]; int need[20]; int nextInt() { int r = 0, ch; while( isspace(ch = getchar())); do { r = r * 10 + ch - '0'; }while( isdigit( ch = getchar() ) ); return r; } int main() { for(;;) { ...
a.cc: In function 'int nextInt()': a.cc:12:10: error: 'isspace' was not declared in this scope 12 | while( isspace(ch = getchar())); | ^~~~~~~ a.cc:15:11: error: 'isdigit' was not declared in this scope 15 | }while( isdigit( ch = getchar() ) ); | ^~~~~~~
s258379881
p00618
C++
#include<stdio.h> static inline int getint(){ int ret = 0; int g; while(!isdigit(g = getchar())); ret = g-'0'; while(isdigit(g = getchar())){ ret *= 10; ret += g-'0'; } return ret;; } static inline int cnt(unsigned int bits) { bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555); bits = (bi...
a.cc: In function 'int getint()': a.cc:6:10: error: 'isdigit' was not declared in this scope 6 | while(!isdigit(g = getchar())); | ^~~~~~~ a.cc:8:9: error: 'isdigit' was not declared in this scope 8 | while(isdigit(g = getchar())){ | ^~~~~~~
s517104933
p00618
C++
#include<iostream> #include<vector> #include<cstring> #include<queue> using namespace std; #define REP(i,a,b) for(i=a; i<b; ++i) #define rep(i,n) REP(i,0,n) vector<int> cv,pv; int n,U; int memo[1<<20]; struct state { int used,cost,depth; state(int used,int depth,int cost) : used(used), depth(depth), cost(cost) ...
a.cc: In function 'int bfs()': a.cc:30:26: error: 'k' was not declared in this scope 30 | || memo[ns.used|k] | ^ a.cc:37:1: warning: control reaches end of non-void function [-Wreturn-type] 37 | } | ^
s649821628
p00618
C++
#include <stdio.h> #include <stdlib.h> typedef struct { int unit; int k; int end_sub[20]; } SUBJECT; int main(void) { unsigned int bit; SUBJECT sub[20]; int ans; int u; int n; while (1){ scanf("%d%d", &n, &u); if (!n) break; for (int i = 0; i < n; i++){ scanf("%d%d", &sub[i].unit, &sub[i].k); ...
a.cc: In function 'int main()': a.cc:52:39: error: 'min' was not declared in this scope; did you mean 'main'? 52 | ans = min(ans, sub_cnt); | ^~~ | main
s050729012
p00618
C++
k#include <iostream> #include <vector> #include <algorithm> using namespace std; int tani[21]; int needs[21]; // i‚̏ó‘Ô‚©‚çUˆÈã‚Ì’PˆÊ‚É‚½‚ǂ蒅‚­Å¬—šC” int dp[1<<20]; // s‚«æ //vector<int> tos[1<<20]; int U; int n; int dfs(int s,int sum){ if(dp[s]!=-1) return dp[s]; else if(sum>=U){ dp[s]=0; return...
a.cc:1:2: error: stray '#' in program 1 | k#include <iostream> | ^ a.cc:1:1: error: 'k' does not name a type 1 | k#include <iostream> | ^ In file included from /usr/include/c++/14/bits/stl_algobase.h:62, from /usr/include/c++/14/vector:62, from a.cc:2: /usr/include...
s225189942
p00618
C++
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int n,U; int c[30],k[30],r[30][30]; while(scanf("%d%d",&n,&U),(n||U)){ for(int i=0;i<n;i++){ scanf("%d%d",&c[i],&k[i]); for(int j=0;j<k[i];j++)scanf("%d",&r[i][j]); } int res = n; for(int i=0;i<...
a.cc: In function 'int main()': a.cc:30:25: error: 'Darsein' was not declared in this scope 30 | if(!f)break;Darsein | ^~~~~~~
s582347125
p00619
C++
#include <cstdio> #include <cstdlib> #include <cmath> #include <climits> #include <cfloat> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include <sstream> #include <complex> #include <stack> #include...
a.cc: In function 'std::istream& operator>>(std::istream&, P&)': a.cc:27:12: error: no match for 'operator>>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and 'double') 27 | is >> p.real() >> p.imag(); | ~~ ^~ ~~~~~~~~ | | | | | ...
s646092391
p00619
C++
#include <bits/stdc++.h> using namespace std; #define EPS (1e-6) #define equal(a,b) (fabs(a-b) < EPS) #define lt(a,b) (a-b < -EPS) #define MAX 252 #define INF (1e9) #define PI acos(-1) struct Point{ double x,y; Point(){} Point(double x,double y) : x(x),y(y) {} Point operator + (const Point &p)const...
In file included from /usr/include/c++/14/string:49, from /usr/include/c++/14/bitset:52, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52, from a.cc:1: /usr/include/c++/14/bits/stl_function.h: In instantiation of 'constexpr bool std::less<_Tp>::operator()(con...
s309718711
p00620
C++
#include <stdio.h> #include <list> #include <iostream> #include <conio.h> using namespace std; #define GU (-100) list<unsigned long long> LineData[32]; int map[8 + 2][8 + 2]; int n; int make_line(int x, int y, int now, int goal, unsigned long long flag, int start_id) { if (now == goal){ LineData[start_id].push_b...
a.cc:4:10: fatal error: conio.h: No such file or directory 4 | #include <conio.h> | ^~~~~~~~~ compilation terminated.
s149729042
p00620
C++
#include<bits/stdc++.h> #define REP(i,s,n) for(int i=s;i<n;i++) #define rep(i,n) REP(i,0,n) #define IINF (INT_MAX) #define MAX 9 using namespace std; typedef unsigned long long ull; const string Y = "YES", N = "NO"; int n,field[MAX][MAX],V; vector<int> V_sum; vector<int> coor; int dx[] = {0,1,0,-1}; int dy[] = {1,...
a.cc: In function 'int main()': a.cc:94:5: error: 'visited' was not declared in this scope 94 | visited.clear(); | ^~~~~~~
s008002856
p00621
Java
import javafx.beans.property.ReadOnlyIntegerProperty; import java.io.*; import java.util.*; public class Main { void run() { while (true) { int W = readInt(); int Q = readInt(); if (W == 0 && Q == 0) break; int[] used = new int[W]; Arrays.fill(us...
Main.java:1: error: package javafx.beans.property does not exist import javafx.beans.property.ReadOnlyIntegerProperty; ^ 1 error
s993120014
p00621
Java
import java.until.Scanner; class Main{ Main(){ readscores(); showResult(); System.out.println("END"); } void readscores(){ scanner sc = new Scanner(System.in); while(sc.hasNext){ int W = sc.nextInt(); int Q = sc.nextInt(); } while(sc.hasNext){ String c = sc.nextInt(); int id =...
Main.java:1: error: package java.until does not exist import java.until.Scanner; ^ Main.java:12: error: cannot find symbol scanner sc = new Scanner(System.in); ^ symbol: class scanner location: class Main Main.java:12: error: cannot find symbol scanner sc = new Scanner(System.in); ...
s846663086
p00621
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #define wall_max 100 #define pos(a) struct wall{ int iti; int catid; int catleng; struct wall* nextcat; }; int typechk(char record[], int* num1, int* num2){ char *wkptr = NULL; char wkchar[256]; int wknum = 0; int slen = 0; if(strncmp(record,"0",1) =...
main.c: In function 'typechk': main.c:25:34: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 25 | (*wkptr) = NULL; | ^ main.c:30:34: error: assignment to 'char' from 'void *' makes integer from point...
s242394592
p00621
C
#include <stdio.h> #include <string.h> #include <stdlib.h> #define wall_max 100 #define pos(a) typedef struct wall{ int iti; int catid; int catleng; struct wall* nextcat; }; int typechk(char record[], int* num1, int* num2){ char *wkptr = NULL; char wkchar[256]; int wknum = 0; int slen = 0; if(strncmp(record,...
main.c:11:1: warning: useless storage class specifier in empty declaration 11 | }; | ^ main.c: In function 'typechk': main.c:25:34: error: assignment to 'char' from 'void *' makes integer from pointer without a cast [-Wint-conversion] 25 | (*wkptr) = NULL; | ...
s131990149
p00621
C++
#include <iostream> using namespace std; #define REP(i,a,b) for(int i=a;i<(int)b;i++) #define rep(i,n) REP(i,0,n) int main() { int W, Q; while(cin >> W >> Q && (W|Q)) { int line[W]; memset(line, -1, sizeof line); rep(_, Q) { char ch; cin >> ch; if(ch == 's') { int id, w; ...
a.cc: In function 'int main()': a.cc:13:5: error: 'memset' was not declared in this scope 13 | memset(line, -1, sizeof line); | ^~~~~~ a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 1 | #include <iostream> +++ |+#include <cstring...
s696615117
p00621
C++
#include<stdio.h> #include<iostream> #include<string> #include<algorithm> using namespace std; int main(){ int W,Q;int x,w; string str; while(1){ int N[101]={}; for(int i=0;i<101;i++) N[i]=999; cin>>W>>Q;if(W==0&&Q==0)break; for(int i=0;i<Q;i++){ cin>>str; if(str=="s"){ cin>>x>>w;bool f=false; ...
a.cc: In function 'int main()': a.cc:45:15: error: 'END' was not declared in this scope 45 | cout<<END<<endl; | ^~~
s045951222
p00621
C++
// SleepingCats.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef _MSC_VER #include <intrin.h> #endif typedef struct _cat_inf{ char cat_id; char length; char pos; char dummy; } CA...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s122299145
p00621
C++
// SleepingCats.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef _MSC_VER #include <intrin.h> #endif typedef struct _cat_inf{ char cat_id; char length; char pos; char dummy; } CA...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s660557234
p00621
C++
// SleepingCats.cpp : コンソール アプリケーションのエントリ ポイントを定義します。 // #include "stdafx.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef _MSC_VER #include <intrin.h> #endif typedef struct _cat_inf{ char cat_id; char length; char pos; char dummy; } CAT_INF; typedef struct _wall_inf { CAT_INF cat_inf[100]; ...
a.cc:4:10: fatal error: stdafx.h: No such file or directory 4 | #include "stdafx.h" | ^~~~~~~~~~ compilation terminated.
s952950221
p00621
C++
// SleepingCats.cpp : ??????????????? ??¢????????±????????§????????¨????????? ????????????????????????????????? // #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef _MSC_VER #include <intrin.h> #endif typedef struct _cat_inf{ char cat_id; char length; char pos; char dummy; } CAT_INF; typedef struc...
a.cc:33:22: error: '_TCHAR' has not been declared 33 | int _tmain(int argc, _TCHAR* argv[]) | ^~~~~~ a.cc: In function 'int _tmain(int, int**)': a.cc:46:9: error: 'fopen_s' was not declared in this scope; did you mean 'fopen64'? 46 | fopen_s(&fp,(char *)DATFILE, (char *)"r"); ...
s757436883
p00621
C++
#include<iostream> using namespace std; int x[1000],n,q,a,b; int y[1000][2]; char c; int main(){ while(true){ for(int i=0;i<1000;i++){x[i]=0;y[i][0]=0;y[i][1]=0;} cin>>n>>q; if(n==0 && q==0){break;} for(int i=0;i<q;i++){ cin>>c>>a>>b; if(c=='s'){ for(int j=0;j<=a-b;j++){ int t=b; for(int ...
a.cc: In function 'int main()': a.cc:28:63: error: invalid types 'int[int]' for array subscript 28 | y[a][0]=j;x[a][1]=j+b; | ^
s353285361
p00621
C++
#include<iostream> #include<string> #include<cstdio> #define P pair<int,string> using namespace std; int main() { int a, b; while (cin >> b>>a, a | b) { int c[100]{}; for (int d = 0; d < a; d++) { char e; cin >> e; if (e == 's') { int f, g; cin >> f >> g; f++; int s = 0; for (int i = 0; i < b; ...
a.cc: In function 'int main()': a.cc:38:2: error: expected '}' at end of input 38 | } | ^ a.cc:8:1: note: to match this '{' 8 | { | ^
s192612624
p00621
C++
#include<bits/stdc++.h> #define P pair<int,string> using namespace std; int main() { int a, b; while (cin >> b>>a, a | b) { int c[100]{}; for (int d = 0; d < a; d++) { char e; cin >> e; if (e == 's') { int f, g; cin >> f >> g; f++; int s = 0; for (int i = 0; i < b; i++) { if (c[i] == 0) { ...
a.cc: In function 'int main()': a.cc:36:2: error: expected '}' at end of input 36 | } | ^ a.cc:6:1: note: to match this '{' 6 | { | ^
s889247892
p00621
C++
/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
s174478091
p00621
C++
#include<iostream> #include<cstdlib> using namespace std; int main(){ int w,n,s[100],sp,x,y; char c; while(cin>>w>>n,w||n){ memset(s,-1,sizeof(s)); for(int i=0;i<n;i++){ cin>>c; if(c=='w'){ cin>>x; for(int j=0;j<w;j++){ if(s[j]==x) s[j]=-1; } }else{ int j,k; cin>>x>>y; ...
a.cc: In function 'int main()': a.cc:8:17: error: 'memset' was not declared in this scope 8 | memset(s,-1,sizeof(s)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include<cstdlib> +++ |+#i...
s737443575
p00621
C++
#include <cstdio> #include <vector> #define R second.second using namespace std; typedef vector<pair<int,pair<int,int> > >vpp; int main(){ int W,Q,d,w; char s[2]; for(;scanf("%d%d",&W,&Q),W;){ //some case Q==0. vpp v; v.push_back(make_pair(-2,make_pair(0,0))); v.push_back(make_pair(-1,make_pair(W,0))); for(...
a.cc: In function 'int main()': a.cc:27:38: error: 'i' was not declared in this scope 27 | if(v[i].first==-1)puts("impossible"); | ^
s577443091
p00621
C++
#include <cstdio> #include <vector> #define R second.second #define Z(i,a,b,c)v.insert(v.begin()+i,make_pair(a,make_pair(b,c))) using namespace std; main(){ int W,Q,d,w,i;char s[2]; for(;scanf("%d%d",&W,&Q),W;puts("END"))//some case Q==0 for(vector<pair<int,pair<int,int> > >v,Z(0,-2,0,0),Z(1,-1,W,0);Q;Q--) if(sc...
a.cc:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~ a.cc: In function 'int main()': a.cc:4:20: error: expected ';' before '.' token 4 | #define Z(i,a,b,c)v.insert(v.begin()+i,make_pair(a,make_pair(b,c))) | ^ a.cc:9:56: note: in ...
s531329633
p00622
C
char r[99],g[99],d[99];main(c,i,j,k){for(;scanf("%s%s%s",r,g,d)>2;puts(""))for(i=j=k=0,c=g[j++];i+j<=strlen(r)+strlen(g);)if(c==d[k])k++,c=r[i++];else putchar(c),c=g[j++];}exit(0);}
main.c:1:24: error: return type defaults to 'int' [-Wimplicit-int] 1 | char r[99],g[99],d[99];main(c,i,j,k){for(;scanf("%s%s%s",r,g,d)>2;puts(""))for(i=j=k=0,c=g[j++];i+j<=strlen(r)+strlen(g);)if(c==d[k])k++,c=r[i++];else putchar(c),c=g[j++];}exit(0);} | ^~~~ main.c: In function 'main':...
s832916796
p00622
C
char r[99],g[99],d[99];main(c,i,j,k){for(;scanf("%s%s%s",r,g,d)>2;puts(""))for(i=j=k=0,c=g[j++];i+j<=strlen(r)+strlen(g);){if(c==d[k])k++,c=r[i++];else putchar(c),c=g[j++];}}exit(0);}
main.c:1:24: error: return type defaults to 'int' [-Wimplicit-int] 1 | char r[99],g[99],d[99];main(c,i,j,k){for(;scanf("%s%s%s",r,g,d)>2;puts(""))for(i=j=k=0,c=g[j++];i+j<=strlen(r)+strlen(g);){if(c==d[k])k++,c=r[i++];else putchar(c),c=g[j++];}}exit(0);} | ^~~~ main.c: In function 'main...
s240384036
p00622
C
char r[99],g[99],*G,d[99];main(c,i,k){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(i=k=0,c=*(G=g)++;*(G-1);)c=c==d[k]?k++,r[i++]:(putchar(c),*G++);exit(0);}
main.c:1:27: error: return type defaults to 'int' [-Wimplicit-int] 1 | char r[99],g[99],*G,d[99];main(c,i,k){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(i=k=0,c=*(G=g)++;*(G-1);)c=c==d[k]?k++,r[i++]:(putchar(c),*G++);exit(0);} | ^~~~ main.c: In function 'main': main.c:1:27: error: type ...
s973168742
p00622
C
char r[99],g[99],*G,d[99];main(c,i){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(i=k=0,G=g,c=*G++;*(G-1);)c=c==d[i]?r[i++]:(putchar(c),*G++);exit(0);}
main.c:1:27: error: return type defaults to 'int' [-Wimplicit-int] 1 | char r[99],g[99],*G,d[99];main(c,i){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(i=k=0,G=g,c=*G++;*(G-1);)c=c==d[i]?r[i++]:(putchar(c),*G++);exit(0);} | ^~~~ main.c: In function 'main': main.c:1:27: error: type of 'c'...
s554353214
p00622
C
char r[99],g[99],*G,d[99];main(c,i){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(i=0,G=g,c=*G++;*(G-1);)c=c!=d[i]?putchar(c),*G++;r[i++];exit(0);}
main.c:1:27: error: return type defaults to 'int' [-Wimplicit-int] 1 | char r[99],g[99],*G,d[99];main(c,i){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(i=0,G=g,c=*G++;*(G-1);)c=c!=d[i]?putchar(c),*G++;r[i++];exit(0);} | ^~~~ main.c: In function 'main': main.c:1:27: error: type of 'c' def...
s642960129
p00622
C
char r[99],g[99],*G,d[99];main(c){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(G=g,c=*G++,*g=0;*(G-1);)c=c-d[*g]?putchar(c),*G++:r[*g++];exit(0);}
main.c:1:27: error: return type defaults to 'int' [-Wimplicit-int] 1 | char r[99],g[99],*G,d[99];main(c){for(;scanf("%s%s%s",r,g,d)>1;puts(G))for(G=g,c=*G++,*g=0;*(G-1);)c=c-d[*g]?putchar(c),*G++:r[*g++];exit(0);} | ^~~~ main.c: In function 'main': main.c:1:27: error: type of 'c' def...
s567152751
p00622
C++
#include<iostream> #include<string> using namespace std; string S, T, U; int main() { while (true) { cin >> T; if (T == "-")break; cin >> S >> U; string V = ""; int c = 0; reverse(S.begin(), S.end()); reverse(T.begin(), T.end()); T += S[S.size() - 1]; while (S.size() + T.size() >= 1) { cout << S << ' ' << T <...
a.cc: In function 'int main()': a.cc:8:17: error: 'reverse' was not declared in this scope 8 | reverse(S.begin(), S.end()); reverse(T.begin(), T.end()); T += S[S.size() - 1]; | ^~~~~~~
s719025037
p00622
C++
#include<iostream> #include<string> using namespace std; string S, T, U; int main() { while (true) { cin >> T; if (T == "-")break; cin >> S >> U; string V = ""; int c = 0; reverse(S.begin(), S.end()); reverse(T.begin(), T.end()); T += S[S.size() - 1]; while (S.size() + T.size() >= 1) { cout << S << ' ' << T <...
a.cc: In function 'int main()': a.cc:8:17: error: 'reverse' was not declared in this scope 8 | reverse(S.begin(), S.end()); reverse(T.begin(), T.end()); T += S[S.size() - 1]; | ^~~~~~~
s276221373
p00622
C++
#include <string> #include <iostream> using namespace std; string a, b, c; int main() { while (cin >> a, a != "-") { cin >> b >> c; reverse(a.begin(), a.end()); reverse(b.begin(), b.end()); char r = b.back(); b.pop_back(); string ret; while (true) { if (c.find(r) != string::npos) { if (a.size() == 0...
a.cc: In function 'int main()': a.cc:8:17: error: 'reverse' was not declared in this scope 8 | reverse(a.begin(), a.end()); | ^~~~~~~
s146840317
p00622
C++
#include <iostream> #include <vector> #include <queue> using namespace std; int main(){ while(true){ string Red,Green,Out; // cin>>Red; getline(cin,Red); if(Red[0]=='-') return 0; // cin>>Green>>Out; getline(cin,Green); getline(cin,Out); if(!Out.size...
a.cc:29:28: error: extended character ¢ is not valid in an identifier 29 | if(!O.empty()&?¢re==O.front()){ | ^ a.cc: In function 'int main()': a.cc:29:27: error: expected primary-expression before '?' token 29 | if(!O.empty()&?¢re==O.front()){ | ...
s144292911
p00622
C++
while(!Q.empty()){ u = Q.front(); Q.pop(); if(u.n1 == str.size() && u.n2 == str2.size()){ ans = u.right; break; } if(u.n1 < str.size()){ v = u; v.down += v.c; v.c = str[v.n1++]; for(i=0;i<v.down.size();i++){ if(v.down[i] != str3[i]) break; } if(i == v.down.size()) Q.push(v...
a.cc:1:5: error: expected unqualified-id before 'while' 1 | while(!Q.empty()){ | ^~~~~
s143683540
p00623
Java
import java.util.Scanner; public class Main { Scanner sc = new Scanner(System.in); // Tree := (Tree Tree) | Leaf String t; int idx; int nidx; int ls[]; int n; int ps[]; Tree T; Tree tree() { if (t.charAt(idx) >= '0' && t.charAt(idx) <= '9') { int v = t.charAt(idx) - '0'; idx++; return new Tree(v...
Main.java:57: error: unreported exception Exception; must be caught or declared to be thrown int set = check(T); ^ 1 error
s328503767
p00623
C++
#include <iostream> #include <vector> using namespace std; int curPos = 0; string str; int info[128] = {}; vector< vector<int> > g; int number[128] = {}; int mx = 0; void parse(int pos){ //cout << curPos << " " << str[curPos] << endl; mx = max(pos,mx); if( str[curPos] >= '0' && str[curPos] <= '9'){ number[pos] = ...
a.cc: In function 'void parse(int)': a.cc:20:9: error: 'assert' was not declared in this scope 20 | assert(str[curPos] == '('); | ^~~~~~ a.cc:3:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 2 | #include <vector> +++ |+#include ...
s520839906
p00624
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <climits> #include <cfloat> #include <ctime> #include <cassert> #include <map> #include <utility> #include <set> #include <iostream> #include <memory> #include <string> #include <vector> #include <algorithm> #include <functional> #include...
a.cc:55:10: fatal error: tr1/unorderd_map: No such file or directory 55 | #include <tr1/unorderd_map> | ^~~~~~~~~~~~~~~~~~ compilation terminated.
s083390873
p00624
C++
#include<queue> #include<set> #include<vector> #include<cstdio> #include<cstring> using namespace std; struct S{ char p,x,y; vector<pair<char,char> > w,c; S(char p=0,char x=0,char y=0):p(p),x(x),y(y){ } }; int main(){ int i,j,k,l; int h,w; while(scanf("%d%d",&h,&w),h||w){ int a[10][10]={},x,y; S s; for(i=0...
In file included from /usr/include/c++/14/bits/refwrap.h:39, from /usr/include/c++/14/deque:67, from /usr/include/c++/14/queue:62, from a.cc:1: /usr/include/c++/14/bits/stl_function.h: In instantiation of 'constexpr bool std::less<_Tp>::operator()(const _Tp&, const _Tp...
s457767138
p00625
C++
#include <iostream> #include <algorithm> #include <complex> #include <vector> #include <cmath> using namespace std; typedef complex<double> P; const int MAXN = 11; const double eps = 1e-7; const double inf = 1e100; int N, M; vector<P> Ds; vector<double> V; int num[MAXN]; bool equals(double a, double b) { return abs...
a.cc: In function 'double getT(P, P, P, double)': a.cc:29:5: error: 'assert' was not declared in this scope 29 | assert(a != 0.0); | ^~~~~~ a.cc:6:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 5 | #include <cmath> +++ |+#include <casse...
s894499411
p00626
C++
// Description: ??£?????°??????????????????????°??????\??????????????¨ // TimeComplexity: $ \mathcal{O}(V^3+ V^2 2^T + V3^T)$ T????????????????????° // Verifyed: AOJ GRL_2_C todo auto Dreyfus_wagner(const G &graph,const auto &term){ using W=int; W inf=1<<28; const int n=graph.size(),t=term.size(); if(t<=1) return ...
a.cc:5:27: error: 'G' does not name a type 5 | auto Dreyfus_wagner(const G &graph,const auto &term){ | ^ a.cc:5:42: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts' 5 | auto Dreyfus_wagner(const G &graph,const auto &term){ | ...
s568629129
p00626
C++
// Description: ??£?????°??????????????????????°??????\??????????????¨ // TimeComplexity: $ \mathcal{O}(V^3+ V^2 2^T + V3^T)$ T????????????????????° // Verifyed: AOJ GRL_2_C todo auto Dreyfus_wagner(const G &graph,const auto &term){ using W=int; W inf=1<<28; const int n=graph.size(),t=term.size(); if(t<=1) return ...
a.cc:5:27: error: 'G' does not name a type 5 | auto Dreyfus_wagner(const G &graph,const auto &term){ | ^ a.cc:5:42: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts' 5 | auto Dreyfus_wagner(const G &graph,const auto &term){ | ...
s806581918
p00626
C++
#include <bits/stdc++.h> #define _overload(_1,_2,_3,name,...) name #define _rep(i,n) _range(i,0,n) #define _range(i,a,b) for(int i=int(a);i<int(b);++i) #define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__) #define _rrep(i,n) _rrange(i,n,0) #define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i) #define r...
a.cc:37:42: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts' 37 | auto Dreyfus_wagner(const G &graph,const auto &term){ | ^~~~ a.cc: In function 'auto Dreyfus_wagner(const G&, const auto:28&)': a.cc:5:23: error: expected u...
s340378368
p00626
C++
#include<iostream> using namespace std; #define REP(i,b,n) for(int i=b;i<n;i++) #define rep(i,n) REP(i,0,n) const int W = 12,H = 12; int visited[H][W]; bool visnode[6]; int in[H][W]; int inx[7],iny[7]; int dx[]={0,0,1,-1}; int dy[]={1,-1,0,0}; bool dfs(int n,int now,int cnt,int limit,int y,int x,int r,int c){ //...
a.cc: In function 'bool dfs(int, int, int, int, int, int, int, int)': a.cc:37:13: error: 'assert' was not declared in this scope 37 | }else assert(false); | ^~~~~~ a.cc:2:1: note: 'assert' is defined in header '<cassert>'; this is probably fixable by adding '#include <cassert>' 1 | #inclu...
s900078983
p00626
C++
1 1 1 1 2 1 1 3 3 1 0 0 0 0 0 1 0 0 3 3 1 0 0 1 0 0 1 0 0 3 3 1 1 1 0 0 0 0 0 0 4 4 1 0 0 0 0 0 1 0 0 1 0 0 1 0 0 1 1 1 1 2 3 1 0 0 0 0 1 12 12 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 1 1 | ^
s394668862
p00626
C++
#include <cstdio> #include <iostream> #include <sstream> #include <fstream> #include <iomanip> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <list> #include <queue> #include <stack> #include <set> #include <map> #include <bitset> #include <numeric> #include <climits> #include <cfloa...
a.cc: In function 'int main()': a.cc:119:26: error: cannot bind non-const lvalue reference of type 'std::vector<std::bitset<12> >&' to an rvalue of type 'std::vector<std::bitset<12> >' 119 | cout << solve(0, vector<bitset<12> >(h)) << endl; | ^~~~~~~~~~~~~~~~~~~~~~ a.cc:29:48: n...
s645960744
p00627
Java
while True: n=input() if n==0:break print sum(input() for i in range(n/4))
Main.java:1: error: class, interface, enum, or record expected while True: ^ 1 error
s145670353
p00627
Java
while True: n=input() if n==0:break print sum(input() for i in range(n/4))
Main.java:1: error: class, interface, enum, or record expected while True: ^ 1 error
s228066979
p00627
Java
while True: n=input() if n==0: break print sum(input() for i in range(n/4))
Main.java:1: error: class, interface, enum, or record expected while True: ^ 1 error
s561257649
p00627
C
#include <stdio.h> int main(void) { int n; while (scnaf("%d", &n) * n != 0){ int sum = 0; n /= 4; while (n-- > 0){ int t; scanf("%d", &t); sum += t; } printf("%d\n", sum); } return 0; }
main.c: In function 'main': main.c:7:16: error: implicit declaration of function 'scnaf'; did you mean 'scanf'? [-Wimplicit-function-declaration] 7 | while (scnaf("%d", &n) * n != 0){ | ^~~~~ | scanf
s524779766
p00627
C
#include<stdio.h> int main() { int n,t[100000],k,s; while(1){ scanf("%d",&n); if(n==0)break; s=0; for(k=0;k<(n/4);k++){ scanf("%d",&t[k]); s=s+t[k]; } printf("%d\n",s); }
main.c: In function 'main': main.c:14:3: error: expected declaration or statement at end of input 14 | } | ^
s888487831
p00627
C
#include <stdio.h> int main(void) { int n; int sum=0,a; while(scanf("%d",&n)&&n!=0){ for(i=0;i<n/4;i++){ scanf("%d",&a); sum+=a; } printf("%d\n",sum); sum=0; } return 0 ; }
main.c: In function 'main': main.c:9:21: error: 'i' undeclared (first use in this function) 9 | for(i=0;i<n/4;i++){ | ^ main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
s501329936
p00627
C
main(l.h.a){for(;scanf("%d",&l),l;printf("%d",h))for(h=0;l>1;l=l-4,h+=a)scanf("%d",a);}
main.c:1:7: error: expected ')' before '.' token 1 | main(l.h.a){for(;scanf("%d",&l),l;printf("%d",h))for(h=0;l>1;l=l-4,h+=a)scanf("%d",a);} | ^ | )
s890896779
p00627
C++
#include<stdio.h> int main(){ int n; int x,s=0; while(1){ scanf("%d",&n); for(int i=0;i<n/4;i++) {scanf("%d",&x); sum+=x;} printf("%d\n",s); s=0; } return 0; }
a.cc: In function 'int main()': a.cc:13:1: error: 'sum' was not declared in this scope 13 | sum+=x;} | ^~~
s835841588
p00627
C++
import java.util.Scanner; import java.util.ArrayList; import java.util.Stack; class Main{ public static void main(String[] args){ Solve s = new Solve(); s.solve(); } } class Solve{ Solve(){} void solve(){ Scanner in = new Scanner(System.in); while(in.hasNext()) { int n = in.nextInt() / 4; if ...
a.cc:2:1: error: 'import' does not name a type 2 | import java.util.Scanner; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:3:1: error: 'import' does not name a type 3 | import java.util.ArrayList; | ^~~~~~ a.cc:3:1: note: C++20 'import' only available with '-fmodule...
s087441002
p00627
C++
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int num; while ((num = Integer.parseInt(br.readLine())) != 0) { int total = 0; for (int i = ...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.BufferedReader; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: 'import' does not name a type 2 | import java.io.InputStreamReader; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available wit...
s054564704
p00627
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n; while(cin>>n,n){ int sum=0; int temp; for(int i=0;i<n/4;++i){ cin>>temp>>endl; sum+=temp; } cout<<sum<<endl; } }
a.cc: In function 'int main()': a.cc:13:20: error: no match for 'operator>>' (operand types are 'std::basic_istream<char>::__istream_type' {aka 'std::basic_istream<char>'} and '<unresolved overloaded function type>') 13 | cin>>temp>>endl; | ~~~~~~~~~^~~~~~ In file included from /usr/include...
s251712446
p00627
C++
#include<stdio.h> main(n,k,s){for(;scanf("%d",&n),s=0,n;){for(;n>0;n-=4)scanf("%d",&k),s+=k;printf("%d\n",s);}}
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(n,k,s){for(;scanf("%d",&n),s=0,n;){for(;n>0;n-=4)scanf("%d",&k),s+=k;printf("%d\n",s);}} | ^
s882966815
p00627
C++
#include <iostream> using namespace std; int main(){ int i,n,utu,ans=0; while(cin >> n,n){ for(i=0;i<n/4;i++){ cin >> utu; ans += utu } cout << ans << endl; } return 0; }
a.cc: In function 'int main()': a.cc:12:35: error: expected ';' before '}' token 12 | ans += utu | ^ | ; 13 | } | ~
s283245050
p00627
C++
i,a;main(n){for(;scanf("%d",&n),n;a=!printf("%d\n",a))for(;scanf("%d",&i),a+=i,n-=4;);}
a.cc:1:1: error: 'i' does not name a type 1 | i,a;main(n){for(;scanf("%d",&n),n;a=!printf("%d\n",a))for(;scanf("%d",&i),a+=i,n-=4;);} | ^ a.cc:1:9: error: expected constructor, destructor, or type conversion before '(' token 1 | i,a;main(n){for(;scanf("%d",&n),n;a=!printf("%d\n",a))for(;scanf("%d",&i),a+=...
s328328631
p00627
C++
while True: n = int(raw_input()) if n == 0: break print sum(int(raw_input()) for i in xrange(n / 4))
a.cc:1:1: error: expected unqualified-id before 'while' 1 | while True: | ^~~~~
s739788605
p00627
C++
#include<iostream> using namespace std; int main() { int n; for(cin>>n,n) { int sum=0; for(;;n=n/5) { int tmp; cin>>tmp; sum+=tmp; } cout<<sum<<endl; } }
a.cc: In function 'int main()': a.cc:6:14: error: expected ';' before ')' token 6 | for(cin>>n,n) | ^ | ; a.cc:18:1: error: expected primary-expression before '}' token 18 | } | ^ a.cc:16:2: error: expected ';' before '}' token 16 | } | ^ | ; 17 | ...
s003679770
p00628
Java
import java.io.PrintWriter; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); while (true) { String str = sc.nextLine(); if (str.equals("END OF INPUT")) break; String[] strs = str....
Main.java:20: error: reached end of file while parsing } ^ 1 error
s755663506
p00628
Java
import java.util.Scanner; public class p1042{ public p1042(){ Scanner sc = new Scanner(System.in); while(true){ String str = sc.nextLine(); if(str.equals("END OF INPUT")){ break; } String[] s = str.split(" "); for(String st: s){ System.out.print(st.length()); } System.out.prin...
Main.java:3: error: class p1042 is public, should be declared in a file named p1042.java public class p1042{ ^ 1 error
s869411690
p00628
Java
import java.util.Scanner; public class p1042{ public p1042(){ Scanner sc = new Scanner(System.in); while(true){ String str = sc.nextLine(); if(str.equals("END OF INPUT")){ break; } str.replaceAll(" ", " sasami "); System.out.println(str); String[] s = str.split(" "); for(String s...
Main.java:3: error: class p1042 is public, should be declared in a file named p1042.java public class p1042{ ^ 1 error
s036135453
p00628
Java
import java.util.*; import java.util.regex.*; public class AOJ1042 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); sc.useDelimiter("\n"); while (true) { String s = sc.next(); if (s.equals("END OF INPUT")) { break; } Matcher m = Pattern.compile("\\w+").matcher...
Main.java:5: error: class AOJ1042 is public, should be declared in a file named AOJ1042.java public class AOJ1042 { ^ 1 error
s206149814
p00628
C
char *p,s[999]; main(i){ for(;gets(s),strcmp(p=s,"END OF INPUT");puts("")) for(strcat(s," ");*p;printf("%d",i)) for(i=0;*p++!=' ';i++); }
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int] 2 | main(i){ | ^~~~ main.c: In function 'main': main.c:2:1: error: type of 'i' defaults to 'int' [-Wimplicit-int] main.c:3:8: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration] 3 | for(;gets(s),strcmp(p=s,"EN...
s602431145
p00628
C
#include<stdio.h> #include<string.h> int main(){ int h,i,pre; char s[2000]; while(1){ gets(s); if(strcmp("END OF INPUT",s)==0) break; pre=0; h=strlen(s); for(i=0;i<h+1;i++){ if(s[i]==' '){ printf("%d",i-pre); pre=i+1; if(s[i+1]==' '){ printf("0"); i++; pre++; } ...
main.c: In function 'main': main.c:7:17: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 7 | gets(s); | ^~~~ | fgets
s039364128
p00628
C
c; int main(i) { char s[999]; for(;;printf("%d\n",c-1)) { fgets(s,999,stdin); if(!strcmp(s,"END OF INPUT")) exit(0); for(c=i=0;s[i]!='\0';c++) if(s[i++]==' ') printf("%d",c),c=-1; } }
main.c:1:1: warning: data definition has no type or storage class 1 | c; | ^ main.c:1:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c: In function 'main': main.c:2:5: error: type of 'i' defaults to 'int' [-Wimplicit-int] 2 | int main(i) | ^~~~ main.c:5:9: error: im...
s847130849
p00628
C
c; main(i) { char s[99]; for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1)) for(;s[i]!=0;) c=s[i++]-32?c+1:!printf("%d",c); }
main.c:2:1: warning: data definition has no type or storage class 2 | c; | ^ main.c:2:1: error: type defaults to 'int' in declaration of 'c' [-Wimplicit-int] main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int] 3 | main(i) | ^~~~ main.c: In function 'main': main.c:3:1: error: type of 'i...
s980818823
p00628
C
#include <stdio.h>c;main(i){char s[99];for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))for(;s[i];)c=s[i++]-32?c+1:!printf("%d",c);}
main.c:1:19: warning: extra tokens at end of #include directive 1 | #include <stdio.h>c;main(i){char s[99];for(;fgets(s,99,stdin),c=i=!strstr(s,"END OF INPUT");printf("%d\n",c-1))for(;s[i];)c=s[i++]-32?c+1:!printf("%d",c);} | ^ /usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-li...
s347937096
p00628
C
#include <stdio.h> #include <string.h> #include <time.h> char s[16]; int main(void){ clock_t c1 = clock(); int cnt = 0; for(; scanf("%s", s) != EOF ){ if( strcmp(s, "END") == 0 ) ++cnt; } clock_t c2 = c1 + CLOCKS_PER_SEC * 0.02 * cnt; while( c2 > clock() ); return 0; }
main.c: In function 'main': main.c:10:37: error: expected ';' before ')' token 10 | for(; scanf("%s", s) != EOF ){ | ^
s112418721
p00628
C
#include<stdio.h> #include<string.h> char str[1000000],buf[10]; int t,i; int main() { for(;gets(str),!strstr(str,"END OF INPUT");) { for(i=t=0;str[i];i++) { for(;str[i]&&str[i]!=' ';i++); if(t!=i) printf("%d",i-t); t=i; for(;str[i]&&str[i]==' ';i++); if(i-t>1) for(int j=0;j<i-t;j++) pu...
main.c: In function 'main': main.c:7:14: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 7 | for(;gets(str),!strstr(str,"END OF INPUT");) | ^~~~ | fgets
s337749511
p00628
C
#include<stdio.h> #include<string.h> char str[1000000],buf[10]; int t,i,j; int main() { for(;gets(str),!strstr(str,"END OF INPUT");) { for(i=t=0;str[i];i++) { for(;str[i]&&str[i]!=' ';i++); if(t!=i) printf("%d",i-t); t=i; for(;str[i]&&str[i]==' ';i++); if(i-t>1) for(int j=0;j<i-t;j++) ...
main.c: In function 'main': main.c:7:14: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration] 7 | for(;gets(str),!strstr(str,"END OF INPUT");) | ^~~~ | fgets
s811784881
p00628
C++
#include <iostream> using namespace std; int main(){ string a; while (getline(cin,a)&&a!="END OF INPUT"){ int num=0; for(int i=0;i<a.length();++i){ if(a[i]==" ") cout << num,num=0; else num++; } cout << endl; } }
a.cc: In function 'int main()': a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(a[i]==" ") cout << num,num=0;
s778918513
p00628
C++
#include <iostream> using namespace std; int main(){ string a; while (getline(cin,a)&&a!="END OF INPUT"){ int num=0; for(int i=0;i<a.length();++i){ if(a[i]==" ") { cout << num; num=0; }else num++; } cout << endl; } }
a.cc: In function 'int main()': a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(a[i]==" ") {
s314185637
p00628
C++
#include <iostream> using namespace std; int main(){ string a; while (getline(cin,a)&&a!="END OF INPUT"){ int num=0; for(int i=0;i<a.length();++i){ if(*a[i]==" ") { cout << num; num=0; }else num++; } cout << endl; } }
a.cc: In function 'int main()': a.cc:10:16: error: invalid type argument of unary '*' (have '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}) 10 | if(*a[i]==" ") {
s224962552
p00628
C++
#include <iostream> using namespace std; int main(){ string a; while (getline(cin,a)&&a!="END OF INPUT"){ int num=0; for(int i=0;i<a.length();++i){ if(a[i]==" ") { cout << num; num=0; }else num++; } cout << cnt << endl; ...
a.cc: In function 'int main()': a.cc:10:20: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 10 | if(a[i]==" ") { a.cc:15:17: error: 'cnt' was not declared in this scope; did you mean 'int'? 15 | cout << cnt << endl; | ^~~ | ...
s680039444
p00628
C++
#include <iostream> using namespace std; int main(){ string a; while (getline(cin,a)&&a!="END OF INPUT"){ int num=0; for(int i=0;i<a.length();++i){ if(a[i]==' ') { cout << num; num=0; }else num++; } cout << cnt << endl; ...
a.cc: In function 'int main()': a.cc:15:17: error: 'cnt' was not declared in this scope; did you mean 'int'? 15 | cout << cnt << endl; | ^~~ | int
s902848987
p00628
C++
#include <iostream> #include <algorithm> #include <string> using namespace std; int main() { string s; while (getline(cin, s), s == "END OF INPUT") { for (int i = 0, n = 0; i < s.length; i++) { if (i == s.length -1 || s[i] == ' ') { cout << n; } else { n++; } } cout << endl; } return 0; }
a.cc: In function 'int main()': a.cc:9:46: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsi...
s120228285
p00628
C++
#include <iostream> using namespace std; int main(){ string s; int temp; whlie(true){ getline(cin,s); if(s=="END OF INPUT")return 0; temp=0; for(int i=0;i<s.size();i++){ if(s[i]==' '){ printf("%d",temp); temp=0; } ...
a.cc: In function 'int main()': a.cc:6:5: error: 'whlie' was not declared in this scope 6 | whlie(true){ | ^~~~~
s303031593
p00628
C++
#include <iostream> #include <stdio.h> using namespace std; int main(){ string s; int temp; whlie(true){ getline(cin,s); if(s=="END OF INPUT")return 0; temp=0; for(int i=0;i<s.size();i++){ if(s[i]==' '){ printf("%d",temp); temp=0; ...
a.cc: In function 'int main()': a.cc:7:5: error: 'whlie' was not declared in this scope 7 | whlie(true){ | ^~~~~
s868484528
p00628
C++
#include<iostream> #include<string> int main(){std::string s;while(1){std::getline(cin,s);if(s=="END OF INPUT")break;int t=0;for(int i=0;i<s.length();i++)if(s.at(i)==' ')std::cout<<t,t=0;else t++;std::cout<<t<<"\n";}}
a.cc: In function 'int main()': a.cc:3:48: error: 'cin' was not declared in this scope; did you mean 'std::cin'? 3 | int main(){std::string s;while(1){std::getline(cin,s);if(s=="END OF INPUT")break;int t=0;for(int i=0;i<s.length();i++)if(s.at(i)==' ')std::cout<<t,t=0;else t++;std::cout<<t<<"\n";}} | ...
s323641160
p00628
C++
#include<iostream> using namespace std; int main(void){ char w[100],end[12]={"END OF INPUT"}; int i; int cnt; while(1){ cnt=0; cin.getline(w,sizeof(w)); for(i=0;i<12;i++){ if(w[i]!=end[i]) break; else return 0; } for(i=0;w[i]!='\0';i++){ if(w[i]==' '){ cout<<cnt; cnt=0; if(w[i+...
a.cc: In function 'int main()': a.cc:4:30: error: initializer-string for 'char [12]' is too long [-fpermissive] 4 | char w[100],end[12]={"END OF INPUT"}; | ^~~~~~~~~~~~~~
s381373299
p00628
C++
#include<cstdio> #include<cstring> using namespace std; int main(){ char s[1000]; int n,i; for(;gets(s),strpbrk(s,"END OF INPUT");) for(n=i=0;i<strlen(s);i++) i==strlen(s)-1?printf("%d\n",n+1):s[i]==' '?printf("%d",n),n=0:n++; }
a.cc: In function 'int main()': a.cc:7:14: error: 'gets' was not declared in this scope; did you mean 'getw'? 7 | for(;gets(s),strpbrk(s,"END OF INPUT");) | ^~~~ | getw
s682409208
p00628
C++
#include <iostream> #include <string> using namespace std; int main(){ string str; while(cin >> str){ if(str == "END_OF_INPUT") break; str += " "; int idx = 0; while(idx < str.size()){ int cnt = 0; while(str[idx++]!=" ") cnt++; cout << cnt; } cout << endl; } }
a.cc: In function 'int main()': a.cc:14:23: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 14 | while(str[idx++]!=" ") cnt++;
s383656351
p00628
C++
#include <iostream> #include <string> using namespace std; int main(){ string str; while(getline(ciin, str)){ if(str == "END OF INPUT") break; int idx = 0; while(idx < str.size()){ int cnt = 0; while(idx < str.size() && str[idx++]!=' ') cnt++; cout << cnt; } cout << endl; }...
a.cc: In function 'int main()': a.cc:8:17: error: 'ciin' was not declared in this scope 8 | while(getline(ciin, str)){ | ^~~~
s263890940
p00628
C++
import java.io.*; public class aoj1042 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s; while(true){ s = br.readLine(); if(s.equals("END OF INPUT")) break; String[] ss = s.split(" "); for(i...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.*; | ^~~~~~ a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts' a.cc:2:1: error: expected unqualified-id before 'public' 2 | public class aoj1042 { | ^~~~~~
s772323048
p00629
Java
import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); P1043_Selecting_Teams_Advanced_to_Regional p = new P1043_Selecting_Teams_Adv...
Main.java:11: error: cannot find symbol P1043_Selecting_Teams_Advanced_to_Regional p = new P1043_Selecting_Teams_Advanced_to_Regional(); ^ symbol: class P1043_Selecting_Teams_Advanced_to_Regional location: class Main Main.java:11: error: cannot find symbol P1043_Selecting_Teams_Advanced_to_Regional p = new ...
s279879429
p00629
C++
/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
s349464623
p00629
C++
#include <iostream> #include <vector> #include <cmath> using namespace std; struct Team { int id; int uni; int solved; int penalty; bool selected; bool operator<(const Team& another) const { if(solved != another.solved) { return (solved > another.solved); } if (penalty != another.penalty) { return (...
a.cc: In function 'int main()': a.cc:44:17: error: 'sort' was not declared in this scope; did you mean 'sqrt'? 44 | sort(teams.begin(), teams.end()); | ^~~~ | sqrt