submission_id
stringlengths
10
10
problem_id
stringlengths
6
6
language
stringclasses
3 values
code
stringlengths
1
522k
compiler_output
stringlengths
43
10.2k
s756922915
p00467
C
include <stdio.h> int main() { int siji[1000], me[1000]; int i, cnt = 0, now = 0; while (1) { scanf("%d%d", &siji[0], &me[0]); if (siji[0] == me[0] == 0)break; for (i = 1;i < siji[0];i++) { scanf("%d", &siji[i]); } for (i = 0;i < me[0];i++, cnt++) { scanf("%d", &me[i]); now += me[i]; now += s...
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token 1 | include <stdio.h> | ^
s257820532
p00467
C
main(s[9000],n,m,t,f,i){ while(scanf("%d%d",&n,&m),i=0,t=f=1,n) while(++i<=n+m) if(scanf("%d",&s[i]),i>n)if(t+=s[t+=s[i]],t>=n&f==1) printf("%d\n",i-n,f=0); }
main.c:1:6: error: unknown type name 's' 1 | main(s[9000],n,m,t,f,i){ | ^ main.c:1:14: error: unknown type name 'n' 1 | main(s[9000],n,m,t,f,i){ | ^ main.c:1:16: error: unknown type name 'm' 1 | main(s[9000],n,m,t,f,i){ | ^ main.c:1:18: error: unknown type ...
s418181800
p00467
C
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> field; int d=0,n,m,pl=0,goal=0; while(cin>>n>>m){ if(n==0 && m==0) break; for(int i = 0;i < n; i++){ cin>>d; field.push_back(d); } for(int i = 0;i < m; i++){ cin>>d; pl += d; if(pl+1>=n && goal==0){ goal = i +...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s708450920
p00467
C
#include<iostream> #include<vector> using namespace std; int main(){ vector<int> field; int d=0,n,m,pl=0,goal=0; while(cin>>n>>m){ if(n==0 && m==0) break; for(int i = 0;i < n; i++){ cin>>d; field.push_back(d); } for(int i = 0;i < m; i++){ cin>>d; pl += d; if(pl+1>=n && goal==0){ goal = i +...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s572172498
p00467
C
#include <stdio.h> int main(){ while(1){ int n,m,i; scanf("%d &d",&n,&m); if(n==0 && m==0){ break; } int masu[1001],me[1001]; for(i=0;i<n;i++){ scanf("%d",&masu[i+1]); } for(i=0;i<m;i++){ scanf("%d",&me[i+1]); } int ma...
main.c: In function 'main': main.c:18:20: error: expected ';' before 'masux' 18 | masux += me[i+1] | ^ | ; 19 | masux += masu[masu] | ~~~~~
s074313517
p00467
C
#include <stdio.h> int main(){ while(1){ int n,m,i; scanf("%d &d",&n,&m); if(n==0 && m==0){ break; } int masu[1001],me[1001]; for(i=0;i<n;i++){ scanf("%d",&masu[i+1]); } for(i=0;i<m;i++){ scanf("%d",&me[i+1]); } int ma...
main.c: In function 'main': main.c:19:19: error: array subscript is not an integer 19 | masux += masu[masu]; | ^
s073152311
p00467
C
#include <stdio.h> int main(){ while(1){ int n,m,i; scanf("%d &d",&n,&m); if(n==0 && m==0){ break; } int masu[1001],me[1001]; for(i=0;i<n;i++){ scanf("%d",&masu[i+1]); } for(i=0;i<m;i++){ scanf("%d",&me[i+1]); } int ma...
main.c: In function 'main': main.c:20:6: error: expected ',' or ';' before 'masux' 20 | masux += masu[k]; | ^~~~~
s458612591
p00467
C
#include <stdio.h> int main(void) { int n, m; int i, j; int pd[1000]; int dd[1000]; int prog; int ans; while (1){ scanf("%d %d", &n, &m); if (n == 0 && m == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &pd[i]); } for (i = 0; i < m; i++){ scanf("%d", &dd[i]); } prog = 0; ...
main.c: In function 'main': main.c:31:33: error: expected ';' before 'prog' 31 | j = prog | ^ | ; 32 | prog += pd[j]; | ~~~~
s474079279
p00467
C
#include <stdio.h> int main(void) { int n, m; int i, j; int pd[1000]; int dd[1000]; int prog; int ans; while (1){ scanf("%d %d", &n, &m); if (n == 0 && m == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &pd[i]); } for (i = 0; i < m; i++){ scanf("%d", &dd[i]); } prog = 0; ...
main.c: In function 'main': main.c:31:33: error: expected ';' before 'prog' 31 | j = prog | ^ | ; 32 | prog += pd[j]; | ~~~~
s907077239
p00467
C
#include <stdio.h> int main(void) { int n, m; int i, j; int pd[1000]; int dd[1000]; int prog; int ans; while (1){ scanf("%d %d", &n, &m); if (n == 0 && m == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &pd[i]); } for (i = 0; i < m; i++){ scanf("%d", &dd[i]); } prog = 0; ...
main.c: In function 'main': main.c:31:33: error: expected ';' before 'prog' 31 | j = prog | ^ | ; 32 | prog += pd[j]; | ~~~~
s362578455
p00467
C
#include <stdio.h> int main(){ int n, m, i, c, count, a[1000], b[1000], start; while(1){ start = 1; count = 0; scanf("%d%d",&n,&m); if(n == 0 && m == 0) break; for(i = 0 ; i < n ; i++){ scanf("%d",&a[i]); } for(i = 0 ; i < m ; i++){ scanf("%d",&b[i]); } for(i = 0 ;...
main.c: In function 'main': main.c:18:24: error: expected expression before '<' token 18 | for(i = 0 ; start =< 10 ; i++){ | ^
s677464929
p00467
C
/* sugoroku.c */ #include <stdio.h> int main(void) { int N; // Nはマス目 int M; // Mはさいころを振る回数の最大値 int n[1001]; //各マス目での指示 int m[1001]; //各回でのさいころの目 int j; int i; int masu=1; scanf("%d%d",&N,&M); for(i=1; i<=N; i++){ scanf("%d",&n[i]); //最初の1回目は0を入力し、N回目も0を入力 -999<= n[i] <= 999 } for(j=1; j <= M; j++){ scanf("%d", &m[j])...
main.c: In function 'main': main.c:41:1: error: expected declaration or statement at end of input 41 | } | ^
s999582544
p00467
C++
#include<iostream> using namespace std; int main(){ int masu[1001]; int n,m[1001],x=0; int s; while(true){ cin>>n>>s; if(n===0&&s==0)break; for(int i=0;i<n;i++)cin>>masu[i]; for(int i=0;i<s;i++)cin>>m[i]; for(int i=0;i<s;i++){ if(x>=n-1){ cout<<i+1; return 0; } x+=m[i]; x+=masu[x]; if(x>=n...
a.cc: In function 'int main()': a.cc:10:15: error: expected primary-expression before '=' token 10 | if(n===0&&s==0)break; | ^
s249104658
p00467
C++
#include<iostream> using namespace std; int main(){ int masu[1001]; int n,m[1001],x=0; int s; while(true){ cin>>n>>s; if(n===0&&s==0)break; for(int i=0;i<n;i++)cin>>masu[i]; for(int i=0;i<s;i++)cin>>m[i]; for(int i=0;i<s;i++){ if(x>=n-1){ cout<<i+1; return 0; } x+=m[i]; x+=masu[x]; if(x>=n...
a.cc: In function 'int main()': a.cc:10:15: error: expected primary-expression before '=' token 10 | if(n===0&&s==0)break; | ^
s585746187
p00467
C++
#include<iostream> #include<queue> using namespace std; int main(){ int n,m; while(cin>>n>>m,n || m){ queue<int>Q; int field[10000]; for(int i=0;i<10000;i++)field[i]=0; for(int i=0;i<n;i++)cin>>field[i]; for(int i=0;i<m;i++){ int a; cin>>a; ...
a.cc: In function 'int main()': a.cc:24:15: error: expected primary-expression before '<<' token 24 | cout<<<<cnt<<endl; | ^~
s073140247
p00467
C++
#include <iostream> #include <fstream> using namespace std; int main() { ・・ifstream cin("INPUT.txt"); //ofstream cout("OUTPUT.txt"); int n, m, i, j; int command[1000] = {0}; int pos; int dice; while(cin >> n >> m) { if(n == 0 && m == 0) break; pos = 1; for(i = 1; i <= n; i++) { cin >> command[i...
a.cc: In function 'int main()': a.cc:7:9: error: '\U000030fb\U000030fbifstream' was not declared in this scope 7 | ・・ifstream cin("INPUT.txt"); | ^~~~~~~~~~~~
s874371980
p00467
C++
#include <iostream> using namespace std; int main(){ int ban, val,pos = 0,tmp,i; int borad[1000] = {0}; while (cin >> ban >> val) { pos = 0 if (ban == 0 && val == 0)break; for (i = 0; i < ban; i++) cin >> borad[i]; for (i = 0; i < val; i++) { cin >> tmp; pos += tmp; pos += borad[pos]; } co...
a.cc: In function 'int main()': a.cc:8:24: error: expected ';' before 'if' 8 | pos = 0 | ^ | ; 9 | if (ban == 0 && val == 0)break; | ~~
s268436496
p00467
C++
#include <iostream> using namespace std; int main (){ while(1) { int N,M; cin >> N >> M; if(N == 0 && M == 0) break; int x[15000] = {0}; for(int i=0;i<N;i++) cin >> x[i]; int t,m,flg = 0; int memo = 0; t = 1; for(int i=0;i<M;i++) { cin >> m; t += m; if(t >= N && flg...
a.cc: In function 'int main()': a.cc:40:12: error: expected '}' at end of input 40 | return 0; | ^ a.cc:4:12: note: to match this '{' 4 | int main (){ | ^
s736323656
p00467
C++
#include <iostream> using namespace std; int main() { int m, n ,move ,flag=0 ,turn=0; double masu[1000]; cin>>m>>n; for(int i=0;i<m;i++){ cin>>masu[i] } for(int i=0;i<n;i++){ move=0; cin>>move; flag=flag+move; flag=flag+masu[move]; turn++ if (flag=m) break; } cout<<turn<<endl; return 0; }
a.cc: In function 'int main()': a.cc:9:29: error: expected ';' before '}' token 9 | cin>>masu[i] | ^ | ; 10 | } | ~ a.cc:16:23: error: expected ';' before 'if' 16 | tur...
s419954203
p00467
C++
#include<string> #include<cstdio> #include<cctype> #include<iostream> #include<algorithm> #include<cmath> #include<queue> using namespace std; int main(){ while(1){ int n,m,road[1005]={0},go[1005]={0},now=0,cut=0; cin >>n>>m; if(n==m==-1)break; if(n==m==50)cout <<"14"<<endl; if(n==m==30)cout <<...
a.cc: In function 'int main()': a.cc:35:2: error: expected '}' at end of input 35 | } | ^ a.cc:10:11: note: to match this '{' 10 | int main(){ | ^
s042700052
p00467
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin >> n >> m, n){ vector<int> a(n), b(m); for(int i=0;i<n;i++){ cin >> a[i]; } for(int i=0;i<m;i++){ cin > b[i]; } int step = 0, cur = 0; for(;;){ cur += b[step]; cur += a[b]; step++;...
a.cc: In function 'int main()': a.cc:12:11: error: no match for 'operator>' (operand types are 'std::istream' {aka 'std::basic_istream<char>'} and '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}) 12 | cin > b[i]; a.cc:12:11: note: candidate: 'operator>(int, __gnu_cxx::__alloc_trai...
s903114077
p00467
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin >> n >> m, n){ vector<int> a(n), b(m); for(int i=0;i<n;i++){ cin >> a[i]; } for(int i=0;i<m;i++){ cin >> b[i]; } int step = 0, cur = 0; for(;;){ cur += b[step]; cur += a[b]; step++...
a.cc: In function 'int main()': a.cc:18:15: error: no match for 'operator[]' (operand types are 'std::vector<int>' and 'std::vector<int>') 18 | cur += a[b]; | ^ In file included from /usr/include/c++/14/vector:66, from /usr/include/c++/14/functional:64, fro...
s491734506
p00467
C++
10 5 0 0 5 6 -3 8 1 8 -4 0 1 3 5 1 5 10 10 0 -1 -1 4 4 -5 0 1 -6 0 1 5 2 4 6 5 5 4 1 6 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 10 5 | ^~
s343295293
p00467
C++
#include <stdio.h> int main() { int i1, N, M, *n, *m, sw = 0, s = 0, ct = 0; scanf("%d %d", &N, &M); n = new int [N]; m = new int [M]; for (i1 = 0; i1 < N; i1++) scanf("%d", &n[i1]); for (i1 = 0; i1 < M; i1++) scanf("%d", &m[i1]); while (sw == 0) { s += m[ct]; ct++; if (s >= N-1) sw = 1; else { ...
a.cc: In function 'int main()': a.cc:24:18: error: expected '}' at end of input 24 | return 0; | ^ a.cc:3:1: note: to match this '{' 3 | { | ^
s310077864
p00467
C++
#include <stdio.h> #include <algorithm> using namespace std; int map[1234]; int derume[1234]; int N, M; int now; int count; int main(){ while (1){ memset(map, 0, sizeof(map)); memset(derume, 0, sizeof(derume)); now = 0; count = 0; scanf("%d%d", &N, &M); if (N == 0 && M == 0) return 0; for (int a = 0; a ...
a.cc: In function 'int main()': a.cc:12:17: error: 'memset' was not declared in this scope 12 | memset(map, 0, sizeof(map)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> ...
s261302377
p00467
C++
#include <stdio.h> #include <algorithm> int map[1234]; int derume[1234]; int N, M; int now; int count; int buf; int main(){ while (1){ memset(map, 0, sizeof(map)); memset(derume, 0, sizeof(derume)); now = 0; count = 0; scanf("%d%d", &N, &M); if (N == 0 && M == 0) return 0; for (int a = 0; a < N; a++){ ...
a.cc: In function 'int main()': a.cc:12:17: error: 'memset' was not declared in this scope 12 | memset(map, 0, sizeof(map)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <algorithm> ...
s521329142
p00467
C++
#include <iostream> using namespace std; #define loop(i,n) for(int i=1;i<=n;i++) int n,m; int order[1002]; int dice[1002]; int solve(){ int pos=1; loop(i,n)cin>>order[i]; loop(j,m)cin>>dice[j]; for(int t=1;t<=m;t++){ pos+=dice[t]; if(pos>=n)break; pos+=order[pos]; if(pos>=n)break; } return...
a.cc: In function 'int solve()': a.cc:19:10: error: 't' was not declared in this scope; did you mean 'tm'? 19 | return t; | ^ | tm
s693209391
p00467
C++
#include<iostream> using namespace std; int main(){ int N,M,masu[1000],dice[1000],now; while(1){ cin >>N>>M; if( N == 0 && M == 0)break; now=1; for(int i=1 ; i <= N ; i++)cin >>masu[i]; for(int i=1 ; i <= M ; i++)cin >>dice[i]; for(int i=1 ; i <= M ; i++){ now+=dice[i]; now+=masu...
a.cc: In function 'int main()': a.cc:16:12: error: 'i' was not declared in this scope 16 | cout <<i<<endl; | ^
s059919489
p00467
C++
using System; public class Hello { public static void Main() { while (true) { string[] line = Console.ReadLine().Trim().Split(' '); var n = int.Parse(line[0]); var m = int.Parse(line[1]); if (n == 0 && m == 0) break; var a = new int[n]...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:3:1: error: expected unqualified-id before 'public' 3 | public class Hello | ^~~~~~
s512873658
p00467
C++
#include <bits/stdc++.h> #include <stdio.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i,a,b) for (long long i = (a); i < (b); ++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(), (v).end() #define pb push_back #define fi first #define se second typedef long long ll; typedef pair...
a.cc: In function 'int main()': a.cc:28:24: error: invalid types '<unresolved overloaded function type>[long long int]' for array subscript 28 | REP(i,1000) max[i]=x[i]=0; | ^
s055616386
p00467
C++
#include<iostream> using namespace std; int main() { for(;;){ int i, n, m, temp = 0, cont = 0 int ban[1000]; int me[1000]; cin >> n; //ツ全ツ閉板づ⒄ツマツス cin >> m; //mツ嘉アツサツイツコツδ債づーツ振ツづゥ if(n == 0 && m == 0){ break; } for(i = 0; i < n; i++){ cin >> ban[i]; } for(i = 0; i < m; i++){ ...
a.cc: In function 'int main()': a.cc:9:17: error: expected ',' or ';' before 'int' 9 | int ban[1000]; | ^~~ a.cc:20:32: error: 'ban' was not declared in this scope 20 | cin >> ban[i]; | ^~~ a.cc:27:39: error: 'ban'...
s177131401
p00467
C++
#include<iostream> #include<stdio.h> int main(){/* int s[9000],n,m,t,f,i; while(std::cin>>n>>m&&n){ for(i=t=f=1;i<=n+m;i++){ std::cin>>s[i]; if(i>n){ if(t+=s[t+=s[i]]&t>=n&f==1){ std::cout<<i-n<<std::endl; f=0; } } } }*//* int s[9000],n,m,t,f,i; while(scanf("%d%d",&n,&m)&&n){ for(i...
a.cc: In function 'int main()': a.cc:35:61: error: lvalue required as left operand of assignment 35 | if(t+=s[t+=s[i]]&t>=n&&f==1,!f=0){ | ^~
s943287516
p00467
C++
#include<stdio.h> int main(){ int n[1006]={0},m[1006]={0},k=0,i,N,M; for(;;k=0){ scanf("%d%d",&N,&M); if(M==0&&M==0)break; for(i=0;i<N;i++){scanf("%d",&n[i]); for(i=0;i<M;i++)scanf("%d",&m[i]); for(i=0;;i++){ k+=m[i]; k+=n[k]; if(k>=N-1)break; } printf("%d\n",i+1); } return 0; }
a.cc: In function 'int main()': a.cc:17:2: error: expected '}' at end of input 17 | } | ^ a.cc:2:11: note: to match this '{' 2 | int main(){ | ^
s695561650
p00467
C++
#include<stdio.h> int main(){ int n[1006]={0},m[1006]={0},k=0,i,N,M; for(;;k=0){ scanf("%d%d",&N,&M); if(M==0)break; for(i=0;i<N;i++)scanf("%d",&n[i]); for(i=0;i<M;i++)scanf("%d",&m[i]); for(i=0;;i++){ k+=m[i]; k+=n[k]; if(k>=N-1)break; } printf("%d\n",i+1); } exit(0); }
a.cc: In function 'int main()': a.cc:16:1: error: 'exit' was not declared in this scope 16 | exit(0); | ^~~~ a.cc:2:1: note: 'exit' is defined in header '<cstdlib>'; this is probably fixable by adding '#include <cstdlib>' 1 | #include<stdio.h> +++ |+#include <cstdlib> 2 | int main(){
s950958643
p00467
C++
int main(){int s[9000],n,m,t,f,i;while(scanf("%d%d",&n,&m),n)for(i=t=f=1;i<=n+m,scanf("%d",&s[i]);i++)if(i>n)if(t+=s[t+=s[i]],t>=n&f==1)printf("%d\n",i,f=0);}
a.cc: In function 'int main()': a.cc:1:40: error: 'scanf' was not declared in this scope 1 | int main(){int s[9000],n,m,t,f,i;while(scanf("%d%d",&n,&m),n)for(i=t=f=1;i<=n+m,scanf("%d",&s[i]);i++)if(i>n)if(t+=s[t+=s[i]],t>=n&f==1)printf("%d\n",i,f=0);} | ^~~~~ a.cc:1:137:...
s932450934
p00467
C++
main(){int s[9000],n,m,t,f,i;while(scanf("%d%d",&n,&m),i=t=f=1,n)while(i<=n+m)if(scanf("%d",&s[i]),i>n)if(t+=s[t+=s[i]],t>=n&f==1)printf("%d\n",i-n,f=0);i++;}
a.cc:1:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 1 | main(){int s[9000],n,m,t,f,i;while(scanf("%d%d",&n,&m),i=t=f=1,n)while(i<=n+m)if(scanf("%d",&s[i]),i>n)if(t+=s[t+=s[i]],t>=n&f==1)printf("%d\n",i-n,f=0);i++;} | ^~~~ a.cc: In function 'int main()': a.cc:1:36: error: 'sca...
s880749245
p00467
C++
#include<stdio.h> main(i){ int s[9000],n,m,t,f; while(scanf("%d%d",&n,&m),i=0,t=f=1,n) while(++i<=n+m) if(scanf("%d",&s[i]),i>n)if(t+=s[t+=s[i]],t>=n&f==1) printf("%d\n",i-n,f=0); }
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(i){ | ^
s132925025
p00467
C++
main(i){ int s[9000],n,m,t,f; while(scanf("%d%d",&n,&m),i=0,t=f=1,n) while(++i<=n+m) if(scanf("%d",&s[i]),i>n)if(t+=s[t+=s[i]],t>=n&f==1) printf("%d\n",i-n,f=0); }
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(i){ | ^
s227926693
p00467
C++
main(i){int s[9000],n,m,t,f;while(scanf("%d%d",&n,&m),i=0,t=f=1,n)while(++i<=n+m)if(scanf("%d",&s[i]),i>n)if(t+=s[t+=s[i]],f==t>=n)printf("%d\n",i-n,f=0);}
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token 1 | main(i){int s[9000],n,m,t,f;while(scanf("%d%d",&n,&m),i=0,t=f=1,n)while(++i<=n+m)if(scanf("%d",&s[i]),i>n)if(t+=s[t+=s[i]],f==t>=n)printf("%d\n",i-n,f=0);} | ^
s072845687
p00467
C++
#include<stdio.h> main(i){ int s[9000],n,m,t,f; while(scanf("%d%d",&n,&m),i=0,t=f=1,n) while(i++<n+m) if(scanf("%d",&s[i]),i>n&(t+=s[t+=s[i]],f==t>=n)) printf("%d\n",i-n,f=0); }
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token 2 | main(i){ | ^
s558083956
p00467
C++
#include<csdio> int main(){ int n,m,j; scanf("%d%d",&n,&m); int ms[n],sg,b=0; for(int i=0;i<n;i++) scanf("%d",&ms[i]); for(j=0;j<m;j++){ scanf("%d",&sg); b+=sg; if(b>=m-1) break; b+=ms[b]; if(b>=m-1) break; } printf("%d",j+1); return 0; }
a.cc:1:9: fatal error: csdio: No such file or directory 1 | #include<csdio> | ^~~~~~~ compilation terminated.
s820408590
p00467
C++
#include <iostream> using namespace std; int main() { int n[1000]; int s[1000]; int m,x,p=1; while(true){ cin >> x >> m; if(x==0) break; for(int i=1 ;i<=x ;i++){ cin >> s[i]; } for(int i=1 ;i<=m ;i++){ cin >> n[i]; } for(int i=1 ;i<=m ;i++){ p+=n[i]; if(p>=x){ cout <<...
a.cc: In function 'int main()': a.cc:38:2: error: expected '}' at end of input 38 | } | ^ a.cc:4:1: note: to match this '{' 4 | { | ^
s024591057
p00467
C++
#include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <cassert> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <utility> #include <numeric> #include <algorithm> #include <bitset> #include <complex> #include <...
a.cc: In function 'int main()': a.cc:25:27: error: no matching function for call to 'std::basic_ifstream<char>::basic_ifstream(FILE*&)' 25 | ifstream ifs(stdin); | ^ In file included from a.cc:18: /usr/include/c++/14/fstream:619:9: note: candidate: 'template<class _Path, class...
s557423926
p00467
C++
#include <stdio.h> int main(void) { int n, m; int i, j; int pd[1000]; int dd[1000]; int prog; int ans; while (1){ scanf("%d %d", &n, &m); if (n == 0 && m == 0){ break; } for (i = 0; i < n; i++){ scanf("%d", &pd[i]); } for (i = 0; i < m; i++){ scanf("%d", &dd[i]); } prog = 0; ...
a.cc: In function 'int main()': a.cc:31:33: error: expected ';' before 'prog' 31 | j = prog | ^ | ; 32 | prog += pd[j]; | ~~~~
s486150774
p00467
C++
10 5 0 0 5 6 -3 8 1 8 -4 0 1 3 5 1 5 10 10 0 -1 -1 4 4 -5 0 1 -6 0 1 5 2 4 6 5 5 4 1 6 0 0
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 10 5 | ^~
s001649653
p00468
Java
import java.io.PrintWriter; import java.util.HashSet; import java.util.Scanner; import java.util.Stack; public class _0545_Party { public static void main(String[] args) { Scanner scan = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); while(true){ int n = Integer.parseInt(scan.next...
Main.java:7: error: class _0545_Party is public, should be declared in a file named _0545_Party.java public class _0545_Party { ^ 1 error
s499775475
p00468
C
#include<iostream> #include<vector> #include<queue> using namespace std; typedef pair<int,int> P; //cost,node struct node{ vector<int> et; int size; }*f; int cost[500]; void BFS(int start ){ queue<P> que; P now; que.push( P(0,0) ); while( !que.empty() ){ now = que.front(); que.pop(); if( cost[now.second...
main.c:1:9: fatal error: iostream: No such file or directory 1 | #include<iostream> | ^~~~~~~~~~ compilation terminated.
s751500902
p00468
C
#include<stdio.h> #include<string.h> char gouh[501]; char kankei[501][501]; int main(void){ int n,m,i,sasou,k; while(1){ scanf("%d%d",&n,&m); if(!n && !m)break; memset(gouh,0,sizeof(gouh)); memset(kankei,0,sizeof(kankei)); for(i=0;i<m;i++){ scanf("%d%d",&j,&k); kankei[j][k]=kankei[k][j]=1; } for...
main.c: In function 'main': main.c:15:39: error: 'j' undeclared (first use in this function) 15 | scanf("%d%d",&j,&k); | ^ main.c:15:39: note: each undeclared identifier is reported only once for each function it appears in
s534498850
p00468
C
100 500 24 40 17 20 73 77 38 46 31 47 11 66 21 65 79 99 11 29 34 42 18 93 44 65 13 50 2 50 66 86 56 77 13 40 23 67 62 89 40 99 41 90 37 66 13 100 30 64 40 49 38 87 39 51 43 66 22 37 45 90 32 34 41 87 7 23 12 63 9 57 61 93 40 71 51 57 13 33 21 37 18 44 55 72 82 91 3 15 57 89 6 46 54 58 6 41 7 59 2 29 1 48 17 94 3 20 13 ...
main.c:1:1: error: expected identifier or '(' before numeric constant 1 | 100 | ^~~
s596501871
p00468
C
#include<stdio.h> int a[10000],b[10000]; int main(void) { int n,k,i,,c,x[501]; while(1){ c=0; scanf("%d",&n); scanf("%d",&k); if(n==0&&k==0){ break; } for(i=0;i<=n;i++){ a[i]=0; b[i]=0; x[i]=0; } x[1]=1; for(i=0;i<k;i++){ scanf("%d %d",&a[i],&b[i]); if(a[i]==1){ x[b[i]]=1; c...
main.c: In function 'main': main.c:5:11: error: expected identifier or '(' before ',' token 5 | int n,k,i,,c,x[501]; | ^ main.c:7:17: error: 'c' undeclared (first use in this function) 7 | c=0; | ^ main.c:7:17: note: each undeclared identifier is reported on...
s708663654
p00468
C
#include<stdio.h> int main(void) { int n,m,i,cnt=0,flag[10001]={0},a[10001],b[10001]; scanf("%d %d",&n,&m); for(i = 0; i < m; i++){ scanf("%d %d",&a[i],&b[i]); if(a[i] ==1) flag[b[i]] = 1; } for(i = 0; i < m; i++){ if(flag[a[i]] == 1 && flag[b[i]] == 0; flag[b[i]] = 2; if(flag[a[i]] == 0 ...
main.c: In function 'main': main.c:17:54: error: expected ')' before ';' token 17 | if(flag[a[i]] == 1 && flag[b[i]] == 0; | ~ ^ | ) main.c:29:1: error: expected expression before '}' t...
s026329189
p00468
C
#include<stdio.h> int main() { int n,m,i,cnt,flag[501],a[10001],b[10001]; while(1){ for(i=0;i<=500;i++) flag[i]={0};cnt=0; scanf("%d %d",&n,&m); if(n==0&&m==0) break; for(i = 0; i < m; i++){ scanf("%d %d",&a[i],&b[i]); if(a[i] ==1) flag[b[i]] = 1; } for(i = 0; i < m; i++){ if(flag[a[i...
main.c: In function 'main': main.c:8:25: error: expected expression before '{' token 8 | flag[i]={0};cnt=0; | ^
s865692271
p00468
C
#include<stdio.h> int main() { int n,m,i,cnt,flag[501],a[10001],b[10001]; while(1){ for(i=0;i<=500;i++){ flag[i]={0}; cnt=0; } scanf("%d %d",&n,&m); if(n == 0 && m == 0) break; for(i = 0; i < m; i++){ scanf("%d %d",&a[i],&b[i]); if(a[i] ==1) flag[b[i]] = 1; } for(i = 0; i <...
main.c: In function 'main': main.c:9:33: error: expected expression before '{' token 9 | flag[i]={0}; | ^
s491511922
p00468
C
#include<stdio.h> int main(void) { int n,m,a[1000],b[1000],f[1000]={0},z,i; scanf("%d",&n); while(n!=0){ scanf("%d",&m); for(i=0;i<m;i++){ a[i]=0: b[i]=0; z=0; for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<m;i++){ if(1==a[i]){ f[b[i]]=1; f[a[i]]=1; z=z+1; } ...
main.c: In function 'main': main.c:9:15: error: expected ';' before ':' token 9 | a[i]=0: | ^ | ; main.c:36:1: error: expected declaration or statement at end of input 36 | } | ^
s382062177
p00468
C
#include<stdio.h> int main(void) { int n,m,a[1000],b[1000],f[1000]={0},z,i; scanf("%d",&n); while(n!=0){ scanf("%d",&m); for(i=0;i<m;i++){ a[i]=0: b[i]=0; } for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<m;i++){ if(1==a[i]){ f[b[i]]=1; f[a[i]]=1; z=z+1; } } ...
main.c: In function 'main': main.c:9:15: error: expected ';' before ':' token 9 | a[i]=0: | ^ | ;
s044854319
p00468
C
#include<stdio.h> int main(void) { int n,m,a[1000],b[1000],f[1000]={0},z,i; scanf("%d",&n); while(n!=0){ scanf("%d",&m); for(i=0;i<m;i++){ a[i]=0: b[i]=0; for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<m;i++){ if(1==a[i]){ f[b[i]]=1; f[a[i]]=1; z=z+1; } } for(i=0;i<...
main.c: In function 'main': main.c:9:15: error: expected ';' before ':' token 9 | a[i]=0: | ^ | ;
s533866387
p00468
C
#include<stdio.h> int main(void) { int n,m,a[1000],b[1000],f[1000]={0},z,i; scanf("%d",&n); while(n!=0){ scanf("%d",&m); for(i=0;i<m;i++){ a[i]=0: b[i]=0; f[i]=0; for(i=0;i<m;i++){ scanf("%d %d",&a[i],&b[i]); } for(i=0;i<m;i++){ if(1==a[i]){ f[b[i]]=1; f[a[i]]=1; z=z+1; ...
main.c: In function 'main': main.c:9:15: error: expected ';' before ':' token 9 | a[i]=0: | ^ | ;
s676916458
p00468
C
#include <stdio.h> #include <string> int n, m, a[11234], b[11234]; int my_friends[11234], their_friends[11234]; int tmp = 0, ans = 0; bool cancel = false; int main(void) { scanf("%d%d", &n, &m); for (int i = 0; i < m; ++i) { scanf("%d%d", &a[i], &b[i]); } memset(my_friends, -1, sizeof(my_friends)); memset(their...
main.c:2:10: fatal error: string: No such file or directory 2 | #include <string> | ^~~~~~~~ compilation terminated.
s938616058
p00468
C
#include <stdio.h> int main() { int n[501]; int L[10000][2]; int n, m, F[500], invite = 0; int i, j, k, q; while (1) { scanf("%d %d", &n, &m); if (n == 0 && m == 0)break; for (i = 0;i < m;i++) { scanf("%d %d", &L[i][0], &L[i][1]); if (L[i][0] == 1) { j = 0; F[j] = L[i][1]; invite++;j++; ...
main.c: In function 'main': main.c:8:13: error: conflicting types for 'n'; have 'int' 8 | int n, m, F[500], invite = 0; | ^ main.c:6:13: note: previous declaration of 'n' with type 'int[501]' 6 | int n[501]; | ^
s762936906
p00468
C
#include <stdio.h> int main(void){ int i,j,n,m,ans=0; scanf("%d %d",&n,&m); int a[m],b[m],student[n+1]; for(i=1;i<=n;i++){ student[i]=0; } for(i=1;i<=m;i++){ scanf("%d %d",&a[i],&b[i]); if(a[i]==1)student[b[i]]=1; if(b[i]==1)student[a[i]]=1; } for(i=1;i<=m;i++){ if(student[a[i]]==1&&student[b[i]]=0...
main.c: In function 'main': main.c:17:51: error: lvalue required as left operand of assignment 17 | if(student[a[i]]==1&&student[b[i]]=0)student[b[i]]=2; | ^ main.c:18:51: error: lvalue required as left operand of assignment 18 | ...
s373697674
p00468
C
#include <stdio.h> #define YARIMASUNE 114514 int i,j; int a,b,n,m,sum=0; int f[YARIMASUNE][YARIMASUNE],p[YARIMASUNE],ans[YARIMASUNE]; #define str int main(){ #define END return 0;} #define MUGEN for(;;){ #define YAJU_OWATA if(n==0&&m==0){break;} #define output printf("%d\n",sum);} #define input "%d%d" #define A_mai a-1...
/tmp/cc517mHZ.o: in function `main': main.c:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/cc517mHZ.o main.c:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc517mHZ.o main.c:(.text+0x19a): relocat...
s190244803
p00468
C
#include <stdio.h> #define YARIMASUNE 114514 int i,j; int a,b,n,m,sum=0; int f[YARIMASUNE][YARIMASUNE],p[YARIMASUNE],ans[YARIMASUNE]; #define str int main(){ #define END return 0;} #define MUGEN for(;;){ #define YAJU_OWATA if(n==0&&m==0){break;} #define output printf("%d\n",sum);} #define input "%d%d" #define A_mai a-1...
/tmp/cc1UqMNv.o: in function `main': main.c:(.text+0x66): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/cc1UqMNv.o main.c:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc1UqMNv.o main.c:(.text+0x19a): relocat...
s411223681
p00468
C
int main(){ while(1){int n,m,i,j,a,b,x[501]={},c[501][501]={},num[501]={},sum=0; scanf("%d%d",&n,&m); if(n==0) break; for(i=1;i<=m;i++){scanf("%d %d",&a,&b); if(a==1){ num[b]++;}c[a][b]++; c[b][a]++;} for(i=1;i<=n;i++){for(j=1;j<=n;j++){ if(c[1][i]==1 && c[i][j]==1){num[j]++;}}} for(i=2;i<=n;i++){if(num[i]!=0) s...
main.c: In function 'main': main.c:3:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration] 3 | scanf("%d%d",&n,&m); if(n==0) break; for(i=1;i<=m;i++){scanf("%d %d",&a,&b); if(a==1){ num[b]++;}c[a][b]++; | ^~~~~ main.c:1:1: note: include '<stdio.h>' or provide a declaration o...
s904754641
p00468
C
while(1){int n,m,i,j,a,b,x[501]={},c[501][501]={},num[501]={},sum=0;scanf("%d%d",&n,&m); if(n==0) break; for(i=1;i<=m;i++){scanf("%d%d",&a,&b); if(a==1){num[b]++;}c[a][b]=1;c[b][a]=1;}for(i=1;i<=n;i++){for(j=1;j<=n;j++){if(c[1][i]==1&&c[i][j]==1){num[j]++;}}}for(i=2;i<=n;i++){if(num[i]!=0) sum++;}printf("%d\n",sum);}re...
main.c:1:1: error: expected identifier or '(' before 'while' 1 | while(1){int n,m,i,j,a,b,x[501]={},c[501][501]={},num[501]={},sum=0;scanf("%d%d",&n,&m); if(n==0) break; for(i=1;i<=m;i++){scanf("%d%d",&a,&b); if(a==1){num[b]++;}c[a][b]=1;c[b][a]=1;}for(i=1;i<=n;i++){for(j=1;j<=n;j++){if(c[1][i]==1&&c[i][j]==1){num[...
s083324139
p00468
C
while(1){int n,m,i,j,a,b,x[501]={},c[501][501]={},num[501]={},sum=0;scanf("%d%d",&n,&m);if(n==0)break;for(i=1;i<=m;i++){scanf("%d%d",&a,&b);if(a==1){num[b]++;}c[a][b]=1;c[b][a]=1;}for(i=1;i<=n;i++){for(j=1;j<=n;j++){if(c[1][i]==1&&c[i][j]==1){num[j]++;}}}for(i=2;i<=n;i++){if(num[i]!=0)sum++;}printf("%d\n",sum);};
main.c:1:1: error: expected identifier or '(' before 'while' 1 | while(1){int n,m,i,j,a,b,x[501]={},c[501][501]={},num[501]={},sum=0;scanf("%d%d",&n,&m);if(n==0)break;for(i=1;i<=m;i++){scanf("%d%d",&a,&b);if(a==1){num[b]++;}c[a][b]=1;c[b][a]=1;}for(i=1;i<=n;i++){for(j=1;j<=n;j++){if(c[1][i]==1&&c[i][j]==1){num[j]++...
s344395141
p00468
C++
#include<iostream> using namespace std; int main(){ int a,b,i,a1[1000],a2[1000],cnt=0,cc[1000],k,h,cntmark2=0; cin>>a; cin>>b; for(i=0;i<b;i++){ cin>>a1[i]>>a2[i]; } int j=0; for(i=0;i<b;i++){ if(a1[i]==1||a2[i]==1){ if(a1[i]==1){ cc[j]=a2[i]; cnt++; }else{ cc[j]=a1[i]; cnt++; } j+...
a.cc: In function 'int main()': a.cc:65:18: error: expected '}' at end of input 65 | return 0; | ^ a.cc:3:11: note: to match this '{' 3 | int main(){ | ^
s420257424
p00468
C++
50 200 24 40 17 20 23 27 38 46 31 47 11 16 15 21 29 49 11 29 34 42 18 43 15 44 13 50 2 50 16 36 6 27 13 40 17 23 12 39 40 49 40 41 16 37 14 30 37 38 1 39 16 43 22 37 40 45 32 34 37 41 7 23 12 13 7 9 11 43 21 40 1 7 13 33 21 37 18 44 5 22 32 41 3 15 7 39 6 46 4 8 6 41 2 29 1 48 17 44 3 20 13 18 23 40 18 19 10 23 27 47 2...
a.cc:1:1: error: expected unqualified-id before numeric constant 1 | 50 | ^~
s222569507
p00468
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; partial class Program { static void Main() { for (; ; ) { int n = int.Parse(Console.ReadLine()); int m = int.Parse(Console.ReadLine()); if (n == 0) return;...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s124383549
p00468
C++
using System; using System.Collections.Generic; using System.Linq; using System.Text; class Program { static void Main() { for (; ; ) { int n = int.Parse(Console.ReadLine()); int m = int.Parse(Console.ReadLine()); if (n == 0) return; ...
a.cc:1:7: error: expected nested-name-specifier before 'System' 1 | using System; | ^~~~~~ a.cc:2:7: error: expected nested-name-specifier before 'System' 2 | using System.Collections.Generic; | ^~~~~~ a.cc:3:7: error: expected nested-name-specifier before 'System' 3 | using System.L...
s444564421
p00468
C++
// AOJ 0545 #include<cstdio> #include<vector> #define rep(i,a) for( int i = 0; i != (a); ++i ) #define repi(i,a,b) for( int i = (a); i != (b); ++i ) int n, m; std::vector<int> G[500]; bool used[500]; void dfs( int d, int v ) { used[v] = true; if( !d ) return; rep( i, G[v].size() ) dfs( d-1, G[v][i] ); ret...
a.cc: In function 'int main()': a.cc:28:17: error: 'memset' was not declared in this scope 28 | memset( used, false, sizeof( used ) ); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<vec...
s705983835
p00468
C++
#include<iostream> using namespace std; int n,m; int tTot(int* N,int b){//印をつけた人 int c; for(int i=0;i<m;i++){ if(N[i]==1){ if(i==b)c=1; } } if(c==1)return 1; else return 0; } int main(){ int N[500]={0};//招待された生徒に印をつける int a[1000],b[1000];//リストの情報 int count=0; while(true){ cin>>n>>m;//nが1から始めるので、...
a.cc: In function 'int main()': a.cc:26:16: error: lvalue required as left operand of assignment 26 | if(n==0&&m=0)break; | ~~~~^~~ a.cc:53:2: error: expected '}' at end of input 53 | } | ^ a.cc:19:11: note: to match this '{' 19 | int main(){ | ^
s868779645
p00468
C++
#include<iostream> using namespace std; int n,m; int tTot(int* N,int b){//印をつけた人 int c; for(int i=0;i<m;i++){ if(N[i]==1){ if(i==b)c=1; } } if(c==1)return 1; else return 0; } int main(){ int N[500]={0};//招待された生徒に印をつける int a[1000],b[1000];//リストの情報 int count=0; while(true){ cin>>n>>m;//nが1から始めるので、...
a.cc: In function 'int main()': a.cc:26:16: error: lvalue required as left operand of assignment 26 | if(n==0&&m=0)break; | ~~~~^~~
s538894744
p00468
C++
#include<iostream> using namespace std; int tTot(int* N,int b,int m;){//印をつけた人 int c; for(int i=0;i<m;i++){ if(N[i]==1){ if(i==b)c=1; } } if(c==1)return 1; else return 0; } int main(){ int n,m; int N[500]={0};//招待された生徒に印をつける int a[1000],b[1000];//リストの情報 int count=0; while(true){ cin>>n>>m;//nが1...
a.cc:5:28: error: expected ')' before ';' token 5 | int tTot(int* N,int b,int m;){//印をつけた人 | ~ ^ | ) a.cc:5:29: error: expected unqualified-id before ')' token 5 | int tTot(int* N,int b,int m;){//印をつけた人 | ^
s734243882
p00468
C++
int count=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
s167270346
p00468
C++
#include <cstdio> #include <iostream> #include <queue> using namespace std; int main() { int n, m; while(cin >> n && cin >> m && n && m) { int fl[500], flfl[500][500], cnt = 0; queue<int> que; memset(fl, 0, sizeof(fl)); memset(flfl, 0, sizeof(flfl)); for(int i=0;i < m;++i) { ...
a.cc: In function 'int main()': a.cc:12:9: error: 'memset' was not declared in this scope 12 | memset(fl, 0, sizeof(fl)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <queue> +++ |+#include <cstrin...
s434413429
p00468
C++
#include <iostream> #include <algorithm> #include <set> using namespace std; int main() { multiset<int> s, sb; int mem,count = 0,table[500][500],n; multiset<int>::iterator spos; memset(table, 0, sizeof(table)); while (cin >> mem >> n) { if (mem == 0 && n == 0)break; for (int i = 0; i < n; i++){ int a, b; ...
a.cc: In function 'int main()': a.cc:10:9: error: 'memset' was not declared in this scope 10 | memset(table, 0, sizeof(table)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include <set> +++ |+#include <cs...
s528388302
p00468
C++
#include <iostream> #include <vector> using namespace std; int main(){ for(int b = 0;;b++){ int stun,listn; int a = 0; cin >> stun >> listn; if(stun == 0 && listn == 0)break; vector<int> fl1(listn); vector<int> fl2(listn); vector<int> fre1(0),fre2(0); for(int n = 0;n<listn;n++){ ...
a.cc: In function 'int main()': a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'short'? 24 | sort(fre1.begin(),fre1.end(),greater<int>()); | ^~~~ | short a.cc:37:18: error: 'unique' was not declared in this scope 37 | fre2.erase(unique(fre2.begin(), fre2.end())...
s804978880
p00468
C++
#include<cstdio> #include<cmath> #include<iostream> #include<algorithm> using namespace std; int main(){ int tomo[1000]={0,1,0,0,0,0,0,0,0}; int lis[502][502]={0}; int N,M; cin>>N>>M; for(int i=0;i<M;i++){ int a,b; cin>>a>>b; lis[a][b]=1,lis[b][a]=1; } for(int i=1;i<=...
a.cc: In function 'int main()': a.cc:19:9: error: expected primary-expression before '}' token 19 | } | ^
s111785105
p00468
C++
class unionfind{ public: class node{ public: int o,r,n; }; node* d; void init(int n){ d = new node[n]; for(int i = 0; i < n; i++){ d[i].o = i; d[i].r = 0; d[i].n = 1; } } void find(int n){ if(d[n].o == n){ return n; } return d[n].o = find(d[n].o); } void union(int a,int b){ a = find(a); b = find(b); if(a != b){ if(d[a]...
a.cc:22:11: error: expected identifier before '(' token 22 | void union(int a,int b){ | ^ a.cc:22:12: error: expected unqualified-id before 'int' 22 | void union(int a,int b){ | ^~~ a.cc:22:12: error: expected ')' before 'int' 22 | void union(int a,int b){ | ~^~...
s032037251
p00468
C++
#include <stdio.h> class unionfind{ public: class node{ public: int o,r,n; }; node* d; void init(int n){ d = new node[n]; for(int i = 0; i < n; i++){ d[i].o = i; d[i].r = 0; d[i].n = 1; } } int find(int n){ if(d[n].o == n){ return n; } return d[n].o = find(d[n].o); } void union(int a,int b){ a = find(a); b = find(b); ...
a.cc:24:11: error: expected identifier before '(' token 24 | void union(int a,int b){ | ^ a.cc:24:12: error: expected unqualified-id before 'int' 24 | void union(int a,int b){ | ^~~ a.cc:24:12: error: expected ')' before 'int' 24 | void union(int a,int b){ | ~^~...
s062908390
p00468
C++
#include <stdio.h> #include <vector> using namespace std; vector<int> sei[100000]; bool s1[100000]; bool s2[100000]; int main(){ while(1){ int n,m; scanf("%d%d",&n,&m); if(n == 0){ return 0; } for(int i = 0; i < m; i++){ int a,b; scanf("%d%d",&a,&b); a--; b--; sei[a].push_back(b); sei[b].pus_back(a); } for(int i = ...
a.cc: In function 'int main()': a.cc:24:8: error: 'class std::vector<int>' has no member named 'pus_back'; did you mean 'push_back'? 24 | sei[b].pus_back(a); | ^~~~~~~~ | push_back
s624976521
p00468
C++
#include <stdio.h> #include <vector> using namespace std; vector<int> sei[100000]; bool s1[100000]; bool s2[100000]; int main(){ while(1){ int n,m; scanf("%d%d",&n,&m); if(n == 0){ return 0; } for(int i = 0; i < m; i++){ int a,b; scanf("%d%d",&a,&b); a--; b--; sei[a].push_back(b); sei[b].pus_back(a); } for(int i = ...
a.cc: In function 'int main()': a.cc:24:8: error: 'class std::vector<int>' has no member named 'pus_back'; did you mean 'push_back'? 24 | sei[b].pus_back(a); | ^~~~~~~~ | push_back
s907083410
p00468
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin >> n >> m, n){ vector<int> g(n); for(int i=0;i<n;i++){ int a,b; cin >> a >> b; a--; b--; g[a].push_back(b); g[b].push_back(a); } set<int> invite; for(int v : g[0]){ invite.insert(v);...
a.cc: In function 'int main()': a.cc:12:12: error: request for member 'push_back' in 'g.std::vector<int>::operator[](((std::vector<int>::size_type)a))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} 12 | g[a].push_back(b); | ^~~~~~~~~ ...
s201030818
p00468
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin >> n >> m, n){ vecto< vector<int> > g(n); for(int i=0;i<n;i++){ int a,b; cin >> a >> b; a--; b--; g[a].push_back(b); g[b].push_back(a); } set<int> invite; for(int v : g[0]){ invite.i...
a.cc: In function 'int main()': a.cc:7:5: error: 'vecto' was not declared in this scope 7 | vecto< vector<int> > g(n); | ^~~~~ a.cc:7:24: error: expected primary-expression before '>' token 7 | vecto< vector<int> > g(n); | ^ a.cc:7:26: error: 'g' was not declared i...
s850560096
p00468
C++
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; while(cin >> n >> m, n){ vecto< vector<int> > g(n); for(int i=0;i<m;i++){ int a,b; cin >> a >> b; a--; b--; g[a].push_back(b); g[b].push_back(a); } set<int> invite; for(int v : g[0]){ invite.i...
a.cc: In function 'int main()': a.cc:7:5: error: 'vecto' was not declared in this scope 7 | vecto< vector<int> > g(n); | ^~~~~ a.cc:7:24: error: expected primary-expression before '>' token 7 | vecto< vector<int> > g(n); | ^ a.cc:7:26: error: 'g' was not declared i...
s343179610
p00468
C++
ll
a.cc:1:1: error: 'll' does not name a type 1 | ll | ^~
s753564242
p00468
C++
#include<bits/stdc++.h> using namespace std; int main(){ int ni,m,f1,f2,ans=0,ans2=0; int f[1000][1000],fr[510]; while(1){ cin >> ni >> m; fill(f[0],f[ni+1]+ni+1,0); fill(m,m+ni+1,0); if(ni==0&&m==0)break; for(int i=0;i<m;i++){ cin >> f1 >> f2; if(f1>f2){ int z=f1; ...
In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_F...
s547118856
p00468
C++
import java.io.InputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.NoSuchElementException; import java.math.BigInteger; public class Main{ static PrintWriter out...
a.cc:1:1: error: 'import' does not name a type 1 | import java.io.InputStream; | ^~~~~~ 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.IOException; | ^~~~~~ a.cc:2:1: note: C++20 'import' only available with '-fmodu...
s223219175
p00468
C++
#include "bits/stdc++.h" using namespace std; #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define REP(i, n) for (int i = 0; i < (n); i++) #define sz(obj) ((int)(obj).size()) int main() { int n, m; while (cin >> n >> m, n + m){ int a, b, ff[n] = {0}, cnt = 0; bool friends[n][n]; REP(i, n){ ...
a.cc: In function 'int main()': a.cc:20:43: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17 20 | friends[min(a, b) - 1][max(a, b) - 1]++; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
s222920142
p00468
C++
#include<bits/stdc++.h> #define range(i,a,b) for(int i = (a); i < (b); i++) #define rep(i,b) range(i,0,b) #define pb(a) push_back(a) #define all(a) (a).begin(), (a).end() #define debug(x) cout << "debug " << x << endl; using namespace std; #define N 505 #define INF 999999 int M[N][N]; int dis[N]; //????????¨?...
a.cc: In function 'int main()': a.cc:42:12: error: too many arguments to function 'void bfs(int)' 42 | bfs(1, n); | ~~~^~~~~~ a.cc:15:6: note: declared here 15 | void bfs(int n){ | ^~~
s220773954
p00468
C++
#include<iostream> #include<algorithm> #include<vector> using namespace std; vector<int> v[500]; int n,m; int p[500]; void solve(int num){ for(int i = 0;i<v[num].size();i++){ p[v[num][i]] = 1; // cout<<v[num][i]<<endl; } } int main(){ while(cin>>n,cin>>m){ if(n==0&&m==0) break; for(i...
a.cc: In function 'int main()': a.cc:33:5: error: 'memset' was not declared in this scope 33 | memset(p,0,sizeof(p)); | ^~~~~~ a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 3 | #include<vector> +++ |+#include <cstring> 4 |
s858158787
p00468
C++
#include<stdio.h> int a[10000],b[10000]; int main(void) { int n,k,i,,c,x[501]; while(1){ c=0; scanf("%d",&n); scanf("%d",&k); if(n==0&&k==0){ break; } for(i=0;i<=n;i++){ a[i]=0; b[i]=0; x[i]=0; } x[1]=1; for(i=0;i<k;i++){ scanf("%d %d",&a[i],&b[i]); if(a[i]==1){ x[b[i]]=1; c...
a.cc: In function 'int main()': a.cc:5:11: error: expected unqualified-id before ',' token 5 | int n,k,i,,c,x[501]; | ^
s565792438
p00468
C++
#include <stdio.h> #include <string> int n, m, a[11234], b[11234]; int my_friends[11234], their_friends[11234]; int tmp = 0, ans = 0; bool cancel = false; int main(void) { scanf("%d%d", &n, &m); for (int i = 0; i < m; ++i) { scanf("%d%d", &a[i], &b[i]); } memset(my_friends, -1, sizeof(my_friends)); memset(their...
a.cc: In function 'int main()': a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(my_friends, -1, sizeof(my_friends)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <string> +++ ...
s688899322
p00468
C++
#include <stdio.h> #include <string> int n, m, a[11234], b[11234]; int my_friends[11234], their_friends[11234]; int tmp = 0, ans = 0; bool cancel = false; int main(void) { scanf("%d%d", &n, &m); for (int i = 0; i < m; ++i) { scanf("%d%d", &a[i], &b[i]); } memset(my_friends, -1, sizeof(my_friends)); memset(their...
a.cc: In function 'int main()': a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(my_friends, -1, sizeof(my_friends)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <string> +++ ...
s651452026
p00468
C++
#include <stdio.h> #include <string> int n, m, a[11234], b[11234]; int my_friends[11234], their_friends[11234]; int tmp = 0, ans = 0; bool cancel = false; int main(void) { scanf("%d%d", &n, &m); for (int i = 0; i < m; ++i) { scanf("%d%d", &a[i], &b[i]); } memset(my_friends, -1, sizeof(my_friends)); memset(their...
a.cc: In function 'int main()': a.cc:13:9: error: 'memset' was not declared in this scope 13 | memset(my_friends, -1, sizeof(my_friends)); | ^~~~~~ a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>' 2 | #include <string> +++ ...
s792288554
p00468
C++
#include<iostream> #include<vector> using namespace std; int main() { int n, m; while (cin >> n >> m){ if (n == 0 && m == 0)return 0; vector<pair<int, int>>l; vector<int>k; vector<int>linst; cin >> n >> m; for (int i = 0; i < m; i++) { pair<int, int>p; cin >> p.first >> p.second; if (p.first == 1...
a.cc: In function 'int main()': a.cc:26:33: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 26 | if (find(k.begin(), k.end(), l[i].first) != k.end()) { | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file...
s034471797
p00468
C++
#include<iostream> #include<vector> using namespace std; int main() { int n, m; while (cin >> n >> m){ if (n == 0 && m == 0)return 0; vector<pair<int, int>>l; vector<int>k; vector<int>linst; cin >> n >> m; for (int i = 0; i < m; i++) { pair<int, int>p; cin >> p.first >> p.second; if (p.first == 1...
a.cc: In function 'int main()': a.cc:26:33: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 26 | if (find(k.begin(), k.end(), l[i].first) != k.end()) { | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file...
s266833627
p00468
C++
#include<iostream> #include<vector> using namespace std; int main() { int n, m; while (cin >> n >> m){ if (n == 0 && m == 0)return 0; vector<pair<int, int>>l; vector<int>k; vector<int>linst; cin >> n >> m; for (int i = 0; i < m; i++) { pair<int, int>p; cin >> p.first >> p.second; if (p.first == 1...
a.cc: In function 'int main()': a.cc:26:33: error: no matching function for call to 'find(std::vector<int>::iterator, std::vector<int>::iterator, int&)' 26 | if (find(k.begin(), k.end(), l[i].first) != k.end()) { | ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file...
s295456808
p00468
C++
#include <stdio.h> int main(){ int mf=0,mff=0,n,list,a[500],b[500],j,x=0,z[500],total,k,g[1000],y=0,q,m,kool[500]; while(1){ mf=0; mff=0; scanf("%d",&n); scanf("%d",&list); if(n==0&&list==0){break;} for(j=0;j<list;j++){ scanf("%d %d",&a[j],&b[j]); if(a[j]==1){ z[...
a.cc: In function 'int main()': a.cc:22:45: error: ISO C++ forbids comparison between pointer and integer [-fpermissive] 22 | if(a[j]!=1&&b[j]==z[m]&&kool!=1){ | ~~~~^~~ a.cc:25:50: error: ISO C++ forbids comparison between pointer and integer [-fpermissi...
s955428537
p00468
C++
#include <bits/stdc++.h> using namespace std; bool mem[500][500]; bool lis[500]; int n,m,kazu; int main(){ while(1){ kazu=0; fill(lis,lis+500,0); for(int i=0;i<500;i++){ fill(mem,mem+500,0); } cin>>n; cin>>m; if(n+m==0)break; int a,b; ...
In file included from /usr/include/c++/14/algorithm:60, from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51, from a.cc:1: /usr/include/c++/14/bits/stl_algobase.h: In instantiation of 'typename __gnu_cxx::__enable_if<std::__is_scalar<_Tp>::__value, void>::__type std::__fill_a1(_F...