criyle/codenet-compile-errors huggingface dataset:
Language: 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<int, int> P;
typedef pair<int, P> PP;
 
int n,m;
int mas[1000],x[1000];
 
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
 
    while(true) {
	cin>>n>>m;
	if(n==0&&m==0) break;
	REP(i,1000) max[i]=x[i]=0;
	REP(i,n) {
		cin>>mas[i];
	}
	int pos=0;
	REP(i,m) {
		cin>>x[i];
	}
	REP(i,m) {
		pos+=x[i]+mas[pos+x[i]];
		if(pos>=n-1) {
			cout<<i+1<<endl;
			return 0;
		}
	}
    }
 
	return 0;
}



Compiler output:
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;
      |                        ^
Language: 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++){
			cin >> me[i];
		}
		
		for(i=0;;i++){
			temp += me[i]+ban[temp];
			cont++;
			if(temp >= n){
				break;
			}
		}
		
		cout <<cont << endl;
	}
}

		

Compiler output:
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' was not declared in this scope
   27 |                         temp += me[i]+ban[temp];
      |                                       ^~~
Language: 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=t=f=1;i<=n+m;i++){
			std::cin>>s[i];
			if(i>n){
				t+=s[i];
				t+=s[t];
				if(t>=n&f==1){
					printf("%d\n",i-n);
					f=0;
				}
			}
		}
	}*/
	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,!f=0){
					std::cout<<i-n<<std::endl;
					f=0;
				}
			}
		}
	}
}

Compiler output:
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){
      |                                                             ^~
Language: 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;
}

Compiler output:
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(){
      |           ^
Language: 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);
}

Compiler output:
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(){
Language: 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);}

Compiler output:
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: error: 'printf' 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:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    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);}
Language: 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++;}

Compiler output:
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: 'scanf' was not declared in this scope
    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:1:131: error: 'printf' was not declared in this scope
    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:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    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++;}
Language: 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);
	
}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(i){
      |     ^
Language: 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);
	
}

Compiler output:
a.cc:1:5: error: expected constructor, destructor, or type conversion before '(' token
    1 | main(i){
      |     ^
Language: 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);}

Compiler output:
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);}
      |     ^
Language: 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);
	
}

Compiler output:
a.cc:2:5: error: expected constructor, destructor, or type conversion before '(' token
    2 | main(i){
      |     ^
Language: 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;
}

Compiler output:
a.cc:1:9: fatal error: csdio: No such file or directory
    1 | #include<csdio>
      |         ^~~~~~~
compilation terminated.
Language: 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 << i << endl;
        break;
      }
     p+=s[p];

     if(p>=x){
        cout << i << endl;
        break;
      }
 }     
 
return 0;
}         

Compiler output:
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 | {
      | ^
Language: 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;
		i = 0;
		ans = 0;
		while (prog < n){
			prog += dd[i];
			j = prog
			prog += pd[j];
			
			i++;
			ans++;
		}
		
		printf("%d\n", ans);
	}
	
	return (0);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:33: error: expected ';' before 'prog'
   31 |                         j = prog
      |                                 ^
      |                                 ;
   32 |                         prog += pd[j];
      |                         ~~~~
Language: 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());
			int m = Integer.parseInt(scan.next());
			if(n==0) break;
			V[] ver = new V[n];
			for (int i = 0; i < n; i++) ver[i] = new V();
			boolean[] used = new boolean[n];

			for (int i = 0; i < m; i++) {
				int a = Integer.parseInt(scan.next())-1;
				int b = Integer.parseInt(scan.next())-1;
				ver[a].to.add(b);
				ver[b].to.add(a);
			}

			Stack<int[]> stk = new Stack<int[]>();
			stk.push(new int[]{0,0});
			used[0]=true;
			int ans = 0;
			while(!stk.isEmpty()){
				int[] p = stk.pop();
				int num = p[0],deep = p[1];
				ans++;
				if(deep!=2) for (Integer i : ver[num].to) {
					if(!used[i]){
						used[i]=true;
						stk.push(new int[]{i,deep+1});
					}
				}
			}
			out.println(ans-1);
		}
		out.flush();
	}
}

class V{
	HashSet<Integer> to = new HashSet<Integer>();
}

Compiler output:
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
Language: 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] != 10000 )
			continue;
		cost[now.second] = now.first;
		
		node *no = &f[now.second];				
		for( int i = 0;i < no->size;i++ ){
			que.push( P(now.first+1,no->et[i]) );
		}
	}
}

int main(){
	int N,M,a,b,i;
	int ans;
	while(1){
		cin >> N >> M;
		if( !N )break;
		
		f = new node[500];
		ans = 0;		
		for( i = 0;i < N;i++ ){
			cost[i] = 10000;
		}
		
		for( i = 0;i < M;i++ ){
			cin >> a >> b;
			a--;b--;
			f[a].et.push_back(b);
			f[b].et.push_back(a);
			f[a].size++;
			f[b].size++;
		}
		BFS( 0 );
		
		for( i = 1;i < N;i++ ){
			if( cost[i] <= 2 )
				ans++;
		}
		cout << ans << endl;
		
		delete[] f;
	}
	return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: 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(i=2;i<=n;i++){
			if(kankei[1][i]==1){
				gouh[i]=1;
				for(j=1;j<=n;j++){
					if(kankei[i][j]==1) gouh[j]=1;
				}
			}
		}
		sasou=0;
		for(i=2;i<=n;i++){
			if(gouh[i]==1) sasou++;
		}
		printf("%d\n",sasou);
	}
	return 0;
}

Compiler output:
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
Language: 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 18
23 90
18 69
10 23
77 97
52 93
22 83
73 89
96 100
47 74
60 75
29 38
68 86
29 75
6 21
16 37
22 23
44 60
78 87
28 92
57 58
38 71
31 98
68 79
15 22
88 90
21 74
12 89
60 79
2 4
18 21
45 48
62 77
48 98
42 70
7 54
35 54
49 97
31 94
13 74
8 61
39 47
80 90
29 58
1 95
38 57
32 77
24 39
4 34
34 41
21 98
21 38
29 69
13 25
6 13
33 51
23 72
19 38
18 66
63 78
9 97
59 72
34 36
7 12
27 45
16 19
37 47
88 91
77 95
23 87
6 93
66 93
41 67
61 94
44 100
33 55
4 70
65 86
38 64
17 71
67 90
48 95
17 68
45 53
79 82
41 60
19 74
11 88
7 38
13 16
11 56
47 76
25 85
76 99
19 77
70 89
30 32
1 87
18 26
67 81
47 54
22 99
89 96
16 60
28 69
69 99
18 45
86 94
11 68
88 89
41 61
35 53
8 43
34 71
32 67
12 77
13 36
21 41
25 93
21 32
45 67
58 98
77 99
34 90
50 54
73 100
25 83
16 35
45 86
31 88
31 74
48 63
25 88
17 61
29 70
59 62
58 81
17 65
18 62
71 76
6 98
68 81
40 62
24 28
21 96
43 57
23 47
22 44
41 54
67 76
1 99
1 18
7 27
6 43
52 58
50 59
18 38
22 25
17 46
47 75
85 96
7 52
83 89
5 38
9 58
27 33
33 54
65 96
7 63
38 52
12 16
6 82
30 69
28 52
34 50
2 97
63 68
58 75
28 73
8 85
9 47
1 3
52 77
7 60
39 70
12 86
38 98
40 41
23 78
47 63
32 63
12 92
43 92
8 20
47 69
36 59
2 21
13 43
44 56
40 80
53 84
65 72
77 81
24 91
9 91
12 30
31 96
2 77
44 79
40 69
27 98
4 25
19 92
77 96
66 75
22 85
80 100
17 90
28 70
15 47
68 74
14 43
19 60
82 93
22 31
6 97
12 32
34 35
31 72
79 89
29 49
76 86
45 94
24 43
23 68
38 76
25 76
13 17
31 49
72 75
5 19
7 66
62 87
62 71
29 54
43 46
35 83
32 78
9 64
87 97
4 32
69 70
52 99
5 60
94 96
38 74
48 96
78 92
21 42
19 64
22 40
8 88
19 84
11 77
58 99
16 77
43 59
27 59
1 28
70 78
14 27
71 95
1 24
53 89
6 20
48 67
74 99
41 96
24 29
34 66
13 23
4 68
51 80
18 29
55 58
47 92
17 93
3 98
3 22
11 55
22 62
13 39
34 72
30 34
3 23
1 63
62 85
47 100
9 74
10 78
60 76
41 97
55 86
29 91
31 60
46 82
34 98
53 90
43 75
14 54
37 55
26 66
36 74
10 22
15 91
14 62
66 78
52 68
56 80
18 68
8 12
32 86
9 70
95 97
25 52
31 75
6 59
17 78
7 93
9 76
14 39
24 47
25 73
27 77
24 85
9 53
38 63
31 99
21 66
66 76
33 85
20 84
40 96
33 83
14 35
36 53
40 65
13 14
22 79
34 76
1 84
2 59
12 23
23 28
22 46
54 67
55 57
69 72
1 100
74 87
20 33
24 48
6 70
8 94
32 100
1 65
74 91
27 81
23 99
7 11
7 86
27 52
22 77
6 42
16 97
15 19
62 96
28 31
10 63
40 84
33 91
79 90
13 87
44 72
19 71
51 55
1 62
70 74
20 89
28 48
27 35
8 73
39 95
41 83
28 75
45 54
73 81
27 90
30 77
20 46
42 65
5 66
60 98
7 64
7 57
31 32
26 54
4 20
61 68
7 74
60 94
37 70
14 89
46 67
58 93
37 60
11 33
25 71
7 15
16 67
14 75
8 56
36 81
13 63
35 51
76 89
5 87
19 59
5 56
9 14
33 81
17 56
9 63
62 94
25 87
13 46
15 96
39 92
2 20
58 67
20 78
66 73
23 81
55 84
37 87
22 61
17 44

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 100
      | ^~~
Language: 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++;
			}
		}
		for(i=0;i<k;i++){
			if(x[a[i]]==1&&x[b[i]]==0){
				x[b[i]]=3;
				c++;
			}
			if(x[b[i]]==1&&x[a[i]]==0){
				x[a[i]]=3;
				c++;
			}
		}
		printf("%d\n",c);
		}
return 0;
}

Compiler output:
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 only once for each function it appears in
main.c:16:25: error: 'x' undeclared (first use in this function)
   16 |                         x[i]=0;
      |                         ^
Language: 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 && flag[b[i]] == 1)
			flag[a[i]] = 2;
	
	for(i = 2; i <= m; i++){
	if(flag[i])cnt++;
	}
	
	printf("%d\n",cnt);
	
	return 0;
}

Compiler output:
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 '}' token
   29 | }
      | ^
main.c:29:1: error: expected declaration or statement at end of input
Language: 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]] == 1 && flag[b[i]] == 0){
			flag[b[i]] = 2;
		}
		if(flag[a[i]] == 0 && flag[b[i]] == 1){
			flag[a[i]] = 2;
		}
	}
	
	for(i = 2; i <= m; i++){
	if(flag[i])cnt++;
	}
	
	printf("%d\n",cnt);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:25: error: expected expression before '{' token
    8 |                 flag[i]={0};cnt=0;
      |                         ^
Language: 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]] == 1 && flag[b[i]] == 0){
				flag[b[i]] = 2;
			}
			if(flag[a[i]] == 0 && flag[b[i]] == 1){
				flag[a[i]] = 2;
			}
		}
	
		for(i = 2; i <= m; i++){
			if(flag[i])cnt++;
		}

		printf("%d\n",cnt);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:33: error: expected expression before '{' token
    9 |                         flag[i]={0};
      |                                 ^
Language: 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;
	}
	}
	for(i=0;i<m;i++){
	if(f[a[i]]==1 && f[b[i]]==0){
		f[b[i]]=2;
		z=z+1;
	}
	if(f[a[i]]==0 && f[b[i]]==1){
		f[a[i]]=2;
		z=z+1;
	}
	}
scanf("%d",&n);
}
	printf("%d\n",z);
	return 0;
}

Compiler output:
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 | }
      | ^
Language: 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<m;i++){
	if(f[a[i]]==1 && f[b[i]]==0){
		f[b[i]]=2;
		z=z+1;
	}
	if(f[a[i]]==0 && f[b[i]]==1){
		f[a[i]]=2;
		z=z+1;
	}
	}
scanf("%d",&n);
}
	printf("%d\n",z);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: expected ';' before ':' token
    9 |         a[i]=0:
      |               ^
      |               ;
Language: 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<m;i++){
	if(f[a[i]]==1 && f[b[i]]==0){
		f[b[i]]=2;
		z=z+1;
	}
	if(f[a[i]]==0 && f[b[i]]==1){
		f[a[i]]=2;
		z=z+1;
	}
	}
}
scanf("%d",&n);
}
	printf("%d\n",z);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: expected ';' before ':' token
    9 |         a[i]=0:
      |               ^
      |               ;
Language: 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;
	}
	}
	for(i=0;i<m;i++){
	if(f[a[i]]==1 && f[b[i]]==0){
		f[b[i]]=2;
		z=z+1;
	}
	if(f[a[i]]==0 && f[b[i]]==1){
		f[a[i]]=2;
		z=z+1;
	}
	}
}
scanf("%d",&n);
}
	printf("%d\n",z);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:15: error: expected ';' before ':' token
    9 |         a[i]=0:
      |               ^
      |               ;
Language: 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_friends, -1, sizeof(their_friends));
	for (int i = 0; i < m; ++i) {
		if (a[i] == 1) { my_friends[b[i] - 1] = b[i]; tmp++; }
	}
	ans = tmp;
	for (int i = 0; i < m; ++i) {
		for (int j = 0; j <= tmp; ++j) {
			if (a[i] == my_friends[j]) {
				for (int k = 0; k < n; ++k) {
					if (b[i] == my_friends[k] || b[i] == their_friends[k]) {
						cancel = true;
						break;
					}
				}
				if (cancel == false) { their_friends[b[i] - 1] = b[i]; ans++; }
				cancel = false;
			}
		}
	}

	printf("%d\n", ans);
	return 0;
}

Compiler output:
main.c:2:10: fatal error: string: No such file or directory
    2 | #include <string>
      |          ^~~~~~~~
compilation terminated.
Language: 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++;
			}
		}
		for (i = 0;i < m;i++) {
			for (j = 0;j < invite;j++) {
				if (L[i][0] == F[j]) {
					for (q = 0;q < invite;q++) {
						if (F[q] == L[i][2]) {
							break;
						}
						else invite++;
					}
				}
			}
		}
		printf("%d\n", invite);
	}
	return 0;
}

Compiler output:
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];
      |             ^
Language: 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)student[b[i]]=2;
		if(student[b[i]]==1&&student[a[i]]=0)student[a[i]]=2;
	}
	
	for(i=2;i<=n;i++){
		if(student[i]==1||student[i]==2)ans++;
	}
	
	printf("%d\n",ans);
	return 0;
}

Compiler output:
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 |                 if(student[b[i]]==1&&student[a[i]]=0)student[a[i]]=2;
      |                                                   ^
Language: 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
#define B_mai b-1
#define KIMOCHI if ((p I == 1) && (f I [j] == 1 || f[j] I == 1)){ans[j] = 1;}
#define Ni for (i = 0; i < n; i++){
#define plus ++
#define I [i]
#define J [j]
#define FO for(i = 1; i < n; i plus){for (j = 1; j < n; j plus){
#define answer sum += ans I;
#define ZERO 0
#define ONE 1
str
MUGEN
scanf(input, &n, &m);
YAJU_OWATA
Ni
p I = ZERO;
ans I = ZERO;
for (j = ZERO; j < 510; j plus){
f I J = ZERO;
}}
for (i = ZERO; i < m; i plus){
scanf(input, &a, &b);
f[A_mai][B_mai] = ONE;
if (a == ONE){
p[B_mai] = ONE;
ans[B_mai] = ONE;
}}
FO
KIMOCHI
}}
Ni
answer
}
output
END


Compiler output:
/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): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/cc517mHZ.o
main.c:(.text+0x1bb): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc517mHZ.o
main.c:(.text+0x21a): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/cc517mHZ.o
main.c:(.text+0x2a1): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc517mHZ.o
main.c:(.text+0x311): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc517mHZ.o
collect2: error: ld returned 1 exit status
Language: 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
#define B_mai b-1
#define KIMOCHI if ((p I == 1) && (f I [j] == 1 || f[j] I == 1)){ans[j] = 1;}
#define Ni for (i = 0; i < n; i++){
#define plus ++
#define I [i]
#define J [j]
#define FO for(i = 1; i < n; i plus){for (j = 1; j < n; j plus){
#define answer sum += ans I;
#define ZERO 0
#define ONE 1
str
MUGEN
scanf(input, &n, &m);
YAJU_OWATA
Ni
p I = ZERO;
ans I = ZERO;
for (j = ZERO; j < 510; j plus){
f I J = ZERO;
}}
for (i = ZERO; i < m; i plus){
scanf(input, &a, &b);
f[A_mai][B_mai] = ONE;
if (a == ONE){
p[B_mai] = ONE;
ans[B_mai] = ONE;
}}
FO
KIMOCHI
}}
Ni
answer
}
output
END


Compiler output:
/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): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/cc1UqMNv.o
main.c:(.text+0x1bb): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc1UqMNv.o
main.c:(.text+0x21a): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/cc1UqMNv.o
main.c:(.text+0x2a1): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc1UqMNv.o
main.c:(.text+0x311): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cc1UqMNv.o
collect2: error: ld returned 1 exit status
Language: 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) sum++;}
printf("%d\n",sum);return 0;}

Compiler output:
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 of 'scanf'
  +++ |+#include <stdio.h>
    1 |   int main(){
main.c:3:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    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:3:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 | printf("%d\n",sum);return 0;}
      | ^~~~~~
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:1: error: expected declaration or statement at end of input
Language: 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);}return 0;}

Compiler output:
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]++;}}}for(i=2;i<=n;i++){if(num[i]!=0) sum++;}printf("%d\n",sum);}return 0;}
      | ^~~~~
main.c:1:319: error: expected identifier or '(' before 'return'
    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]++;}}}for(i=2;i<=n;i++){if(num[i]!=0) sum++;}printf("%d\n",sum);}return 0;}
      |                                                                                                                                                                                                                                                                                                                               ^~~~~~
main.c:1:328: error: expected identifier or '(' before '}' token
    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]++;}}}for(i=2;i<=n;i++){if(num[i]!=0) sum++;}printf("%d\n",sum);}return 0;}
      |                                                                                                                                                                                                                                                                                                                                        ^
Language: 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);};

Compiler output:
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]++;}}}for(i=2;i<=n;i++){if(num[i]!=0)sum++;}printf("%d\n",sum);};
      | ^~~~~
Language: 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++;
		}
	}
	cout<<cnt<<endl;

	int sihyou=j;
//友達の友達
	for(i=0;i<b;i++){
		k=0;
		for(j=0;j<=sihyou;j++){

			if(cc[j]==a1[i]&&a2[i]!=1||cc[j]==a2[i]&&a1[i]!=1){
				if(cc[j]==a1[i]){
					if(a1[i]!=1){
						for(h=0;h<sihyou;h++){
							if(a2[i]!=cc[h])
								cntmark2++;
						}

							if(cntmark2==sihyou)
						cnt++;
			
					}
				}else{
					if(a2[i]!=1){
						for(h=0;h<sihyou;h++){
							if(a1[i]!=cc[h])
								cntmark2++;
						}
			
							if(cntmark2==sihyou)
						cnt++;
					
					}
					cntmark2=0;
					k++;

				}
			}
			if(k==1) break;
		}
	}

	cout<<cnt<<endl;
	return 0;

Compiler output:
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(){
      |           ^
Language: 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 43
22 33
23 39
46 50
24 47
10 25
29 38
18 36
25 29
6 21
22 23
10 44
28 37
28 42
7 8
21 38
31 48
18 29
15 22
38 40
21 24
10 29
2 4
18 21
45 48
12 27
20 42
4 7
4 35
47 49
31 44
13 24
8 11
39 47
30 40
8 29
1 45
7 38
27 32
24 39
4 34
34 41
21 48
19 29
13 25
6 13
1 33
19 38
16 18
13 28
9 47
9 22
34 36
7 12
27 45
16 19
37 47
38 41
23 37
6 43
17 41
11 44
44 50
5 33
4 20
15 36
14 38
17 21
17 40
17 18
3 45
29 32
10 41
19 24
11 38
13 16
6 11
26 47
25 35
26 49
19 27
20 39
30 32
1 37
18 26
17 31
4 47
22 49
39 46
10 16
19 28
19 49
18 45
36 44
11 18
38 39
11 41
3 35
8 43
21 34
17 32
13 36
21 41
25 43
21 32
17 45
8 48
27 49
34 40
4 50
23 50
25 33
16 35
36 45
31 38
24 31
13 48
25 38
11 17
20 29
9 12
8 31
15 17
12 18
21 26
6 48
18 31
12 40
24 28
21 46
7 43
23 47
22 44
4 41
17 26
1 49
1 18
7 27
2 8
9 50
18 38
22 25
17 46
25 47
35 46

Compiler output:
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 50
      | ^~
Language: 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;

            bool[,] friend = new bool[n + 1, n + 1];
            for (int i = 0; i < m; i++)
            {
                string[] input = Console.ReadLine().Split();
                int a = int.Parse(input[0]);
                int b = int.Parse(input[1]);

                friend[a, b] = true;
                friend[b, a] = true;
            }

            bool[] friendfriend = new bool[n + 1];
            for (int i = 0; i < n + 1; i++)
            {
                if (friend[1, i] == true)
                {
                    friendfriend[i] = true;
                    for (int j = 2; j < n + 1; j++)
                    {
                        if (friend[i, j] == true)
                            friendfriend[j] = true;
                    }
                }
            }

            int answer = 0;
            for (int i = 2; i < n + 1; i++)
            {
                if (friendfriend[i] == true)
                    answer++;
            }
            Console.WriteLine(answer);
        }
    }
}

Compiler output:
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.Linq;
      |       ^~~~~~
a.cc:4:7: error: expected nested-name-specifier before 'System'
    4 | using System.Text;
      |       ^~~~~~
a.cc:6:1: error: 'partial' does not name a type
    6 | partial class Program
      | ^~~~~~~
Language: 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] );
	
	return;
}

int main()
{
	while( scanf( "%d%d", &n, &m ), n|m )
	{
		memset( used, false, sizeof( used ) );
		rep( i, 500 )
			G[i].clear();

		rep( i, m )
		{
			int a, b;
			scanf( "%d%d", &a, &b );
			--a; --b;
			G[a].push_back( b );
			G[b].push_back( a );
		}

		dfs( 2, 0 );

		int ans = 0;
		repi( i, 1, n )
			ans += used[i];

		printf( "%d\n", ans );
	}

	return 0;
}

Compiler output:
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<vector>
  +++ |+#include <cstring>
    4 | #define rep(i,a) for( int i = 0; i != (a); ++i )
Language: 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ひいて0から始める。
	if(n==0&&m=0)break;
	for(int i=0;i<m;i++){
	int ak,bk;
	cin>>ak>>bk;
	a[i]=ak-1;b[i]=bk-1;
	}
	
	for(int i=0;i<m;i++){
	if(a[i]==0){//aが番０だったら
	N[b[i]]=1;//bに印をつける
	}
}	
	//上まではＯＫ
	for(int i=0;i<m;i++){
		if(tTot(N,a[i])==1){//a[i]は印を塚た人か否か１
		N[b[i]]=1;
		cout<<i<<endl;
		}
	}
	for(int i=0;i<m;i++){
	if(N[i]==1)count++;
	}
	cout<<count<<endl;
	
	
	
return 0;
}

Compiler output:
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(){
      |           ^
Language: 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ひいて0から始める。
	if(n==0&&m=0)break;
	for(int i=0;i<m;i++){
	int ak,bk;
	cin>>ak>>bk;
	a[i]=ak-1;b[i]=bk-1;
	}
	
	for(int i=0;i<m;i++){
	if(a[i]==0){//aが番０だったら
	N[b[i]]=1;//bに印をつける
	}
}	
	//上まではＯＫ
	for(int i=0;i<m;i++){
		if(tTot(N,a[i])==1){//a[i]は印を塚た人か否か１
		N[b[i]]=1;
		cout<<i<<endl;
		}
	}
	for(int i=0;i<m;i++){
	if(N[i]==1)count++;
	}
	cout<<count<<endl;
	}
	
	
return 0;
}

Compiler output:
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;
      |            ~~~~^~~
Language: 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ひいて0から始める。
	if(n==0&&m==0)break;
	for(int i=0;i<m;i++){
	int ak,bk;
	cin>>ak>>bk;
	a[i]=ak-1;b[i]=bk-1;
	}
	
	for(int i=0;i<m;i++){
	if(a[i]==0){//aが番０だったら
	N[b[i]]=1;//bに印をつける
	}
}	
	//上まではＯＫ
	for(int i=0;i<m;i++){
		if(tTot(N,a[i],m)==1){//a[i]は印を塚た人か否か１
		N[b[i]]=1;
		cout<<i<<endl;
		}
	}
	for(int i=0;i<m;i++){
	if(N[i]==1)count++;
	}
	cout<<count<<endl;
	}
	
	
return 0;
}

Compiler output:
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;){//印をつけた人
      |                             ^
Language: 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) {
            int a, b;
            scanf("%d\n%d", &a, &b);

            if (a == 1) fl[b-1] = 1;
            else if (b == 1) fl[a-1] = 1;
            else flfl[a-1][b-1] = 1, flfl[b-1][a-1] = 1;
        }

        int flag = 1;

        for(int i=0;i < n;++i) {
            if (fl[i]) {
                flfl[i][0] = 0;
                que.push(i);
                flag = 0;
                ++cnt;
            }
        }

        if (flag) {
            printf("%d\n", cnt);
        } else {
            while(que.size()) {
                int i = que.front();
                for(int j=0;j < n;++j) {
                    if (flfl[i][j] && fl[j] != 1) {
                        flfl[i][j] = 0;
                        flfl[j][i] = 0;
                        ++cnt;
                    }
                }
                que.pop();
            }

            printf("%d\n", cnt);
        }
    }
    return 0;
}

Compiler output:
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 <cstring>
    4 | using namespace std;
Language: 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;
			cin >> a >> b;
			table[a][b] = 1;
			table[b][a] = 1;
		}
		for (int i = 1; i <= mem; i++){
			if (table[1][i] == 1)
				s.insert(i);
		}
		for (int i = 1; i <= mem; i++){
			spos = s.find(i);
			if (spos != s.end()){
				for (int a = 1; a <= mem; a++){
					if (table[i][a] == 1)
						sb.insert(a);
				}
			}
		}
		for (spos = s.begin(); spos != s.end(); ++spos)
			sb.insert(*spos);
		for (int i = 2; i <= mem; i++)	{
			spos = sb.find(i);
			if (spos != sb.end())
				count++;
		}
		cout << count << endl;
	}
}

Compiler output:
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 <cstring>
    4 | using namespace std;
Language: 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++){
      cin >> fl1[n] >> fl2[n];
      if(fl1[n] == 1){
        fre1.push_back(fl2[n]);
        a = 1;
      }else if(fl2[n] == 1){
        fre1.push_back(fl1[n]);
        a = 1;
      }
    }
    sort(fre1.begin(),fre1.end(),greater<int>());
    for(int n = 0;n<fre1.size();n++){
      for(int g = 0;g<listn;g++){
        if(fre1[n] == fl1[g]){
          fre2.push_back(fl2[g]);
        }else if(fre1[n] == fl2[g]){
          fre2.push_back(fl1[g]);
        }
      }
    }
    if(a != 0){
      fre2.insert(fre2.end(),fre1.begin(),fre1.end());
      sort(fre2.begin(), fre2.end());
      fre2.erase(unique(fre2.begin(), fre2.end()), fre2.end());
      cout << fre2.size() - 1 << endl;
    }else{
      cout << 0 << endl;
    }
  }
  return 0;
}

Compiler output:
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()), fre2.end());
      |                  ^~~~~~
Language: 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<=N;i++){
        if(tomo[i]==1){
            for(int j=1;j<=N;j++)
        }
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:9: error: expected primary-expression before '}' token
   19 |         }
      |         ^