criyle/codenet-compile-errors huggingface dataset:
Language: C

#include<stdio.h>
#define MAX 10000000
#define NIL -1

int G[MAX][MAX];
int n, color[MAX], N[1000000000], top=0;


void push(int x) {
  N[++top]=x;
}

int pop() {
  top--;
  return N[top+1];
}

int isEmpty() {
  return top==0;
}

void dfs(int r, int c) {
  int i, v, u;
  push(r);
  color[r]=c;
  while (! isEmpty()) {
    u=N[top];
    pop();
    for (i=0; i<n; i++) {
      if (G[u][i]==0) continue;
        v=i;
      if (color[v]==NIL) {
        color[v]=c;
        push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  scanf("%d %d", &n, &m);

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    scanf("%d %d", &s, &t);
    G[s][t]=1;
    G[t][s]=1;
  }
  assignColor();

  scanf("%d", &q);

  for (i=0; i<q; i++) {
    scanf("%d %d", &s, &t);
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
/tmp/ccBy9Ciw.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x18): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccBy9Ciw.o
/tmp/ccBy9Ciw.o: in function `pop':
main.c:(.text+0x3c): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x4b): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0x5f): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccBy9Ciw.o
/tmp/ccBy9Ciw.o: in function `isEmpty':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccBy9Ciw.o
/tmp/ccBy9Ciw.o: in function `dfs':
main.c:(.text+0xa4): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccBy9Ciw.o
main.c:(.text+0xb5): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 10000000
#define NIL -1

int G[MAX][MAX];
int n, color[MAX], N[1000000000], top=0;


void push(int x) {
  N[++top]=x;
}

int pop() {
  top--;
  return N[top+1];
}

int isEmpty() {
  return top==0;
}

void dfs(int r, int c) {
  int i, v, u;
  push(r);
  color[r]=c;
  while (! isEmpty()) {
    u=N[top];
    pop();
    for (i=0; i<n; i++) {
      if (G[u][i]==0) continue;
        v=i;
      if (color[v]==NIL) {
        color[v]=c;
        push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  scanf("%d %d", &n, &m);

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    scanf("%d %d", &s, &t);
    G[s][t]=1;
    G[t][s]=1;
  }
  assignColor();

  scanf("%d", &q);

  for (i=0; i<q; i++) {
    scanf("%d %d", &s, &t);
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
/tmp/cc15Q1tO.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x18): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc15Q1tO.o
/tmp/cc15Q1tO.o: in function `pop':
main.c:(.text+0x3c): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x4b): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0x5f): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/cc15Q1tO.o
/tmp/cc15Q1tO.o: in function `isEmpty':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/cc15Q1tO.o
/tmp/cc15Q1tO.o: in function `dfs':
main.c:(.text+0xa4): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc15Q1tO.o
main.c:(.text+0xb5): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 100000000000
#define NIL -1

int G[MAX][MAX];
int n, color[MAX], N[MAX], top=0;


void push(int x) {
  N[++top]=x;
}

int pop() {
  top--;
  return N[top+1];
}

int isEmpty() {
  return top==0;
}

void dfs(int r, int c) {
  int i, v, u;
  push(r);
  color[r]=c;
  while (! isEmpty()) {
    u=N[top];
    pop();
    for (i=0; i<n; i++) {
      if (G[u][i]==0) continue;
        v=i;
      if (color[v]==NIL) {
        color[v]=c;
        push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  scanf("%d %d", &n, &m);

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    scanf("%d %d", &s, &t);
    G[s][t]=1;
    G[t][s]=1;
  }
  assignColor();

  scanf("%d", &q);

  for (i=0; i<q; i++) {
    scanf("%d %d", &s, &t);
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
main.c:6:5: error: size of array 'G' exceeds maximum object size '9223372036854775807'
    6 | int G[MAX][MAX];
      |     ^
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 1000000000
#define NIL -1

int G[MAX][MAX];
int n, color[MAX], N[MAX], top=0;


void push(int x) {
  N[++top]=x;
}

int pop() {
  top--;
  return N[top+1];
}

int isEmpty() {
  return top==0;
}

void dfs(int r, int c) {
  int i, v, u;
  push(r);
  color[r]=c;
  while (! isEmpty()) {
    u=N[top];
    pop();
    for (i=0; i<n; i++) {
      if (G[u][i]==0) continue;
        v=i;
      if (color[v]==NIL) {
        color[v]=c;
        push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  scanf("%d %d", &n, &m);

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    scanf("%d %d", &s, &t);
    G[s][t]=1;
    G[t][s]=1;
  }
  assignColor();

  scanf("%d", &q);

  for (i=0; i<q; i++) {
    scanf("%d %d", &s, &t);
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
/tmp/ccMlnEu7.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x18): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccMlnEu7.o
/tmp/ccMlnEu7.o: in function `pop':
main.c:(.text+0x3c): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x4b): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0x5f): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccMlnEu7.o
/tmp/ccMlnEu7.o: in function `isEmpty':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccMlnEu7.o
/tmp/ccMlnEu7.o: in function `dfs':
main.c:(.text+0xa4): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccMlnEu7.o
main.c:(.text+0xb5): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 10000000000
#define NIL -1

int G[100000][100000];
int n, color[100000], N[MAX], top=0;


void push(int x) {
  N[++top]=x;
}

int pop() {
  top--;
  return N[top+1];
}

int isEmpty() {
  return top==0;
}

void dfs(int r, int c) {
  int i, v, u;
  push(r);
  color[r]=c;
  while (! isEmpty()) {
    u=N[top];
    pop();
    for (i=0; i<n; i++) {
      if (G[u][i]==0) continue;
        v=i;
      if (color[v]==NIL) {
        color[v]=c;
        push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  scanf("%d %d", &n, &m);

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    scanf("%d %d", &s, &t);
    G[s][t]=1;
    G[t][s]=1;
  }
  assignColor();

  scanf("%d", &q);

  for (i=0; i<q; i++) {
    scanf("%d %d", &s, &t);
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  return 0;

}

Compiler output:
/tmp/ccZ6kFat.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x12): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x18): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccZ6kFat.o
/tmp/ccZ6kFat.o: in function `pop':
main.c:(.text+0x3c): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x45): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x4b): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0x5f): relocation truncated to fit: R_X86_64_PC32 against symbol `N' defined in .bss section in /tmp/ccZ6kFat.o
/tmp/ccZ6kFat.o: in function `isEmpty':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `top' defined in .bss section in /tmp/ccZ6kFat.o
/tmp/ccZ6kFat.o: in function `dfs':
main.c:(.text+0xa4): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccZ6kFat.o
main.c:(.text+0xb5): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include<iostream>
#include<vector>
#inlcude<stack>
using namespace std;
#define MAX 100000
#define NIL -1

int G[MAX][MAX];
int n, color[MAX], top=0;
vector<int> G[MAX];


void dfs(int r, int c) {
  stack<int> S;
  int i, v, u;
  S.push(r);
  color[r]=c;
  while (! S.empty()) {
    u=S.top();
    S.pop();
    for (i=0; i<G[u].size(); i++) {
        v=G[u][i];
      if (color[v]==NIL) {
        color[v]=c;
        S.push(v);
      }
    }
  }
}



void assignColor() {
  int i, u;
  int id=1;
  for (i=0; i<n; i++) color[i]=NIL;
  for (u=0; u<n; u++) {
    if (color[u]==NIL)
      dfs(u, id++);
  }
}

int main() {

  int  m, i, j, v, s, t, q;

  cin >> n >> m;

  for (i=0; i<n; i++)
    for (j=0; j<n; j++)
      G[i][j]=0;

  for (i=0; i<m; i++) {
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();

  cin >> q;

  for (i=0; i<q; i++) {
    cin >> s >> t;
    if (color[s]== color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }

  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>
#define M 100000
#define N -1

int n;
int G[M][M] = {N};
int color[M];

void dfs(int r, int c) {
  int s[M] = {N};
  int a = 0, x = 0, m = 0, i;
  
  s[a] = r;
  color[r] = c;
  
  while (x == 0) {
    int u = s[m];
    
    for (i = 0 ; i < n; i++) {
      int v = G[u][i];
      if (color[v] == N) {
        color[v] = c;
        a++;
      }
    }
    if (s[m + 1] == N) {
      x = 1;
    }
  }
}

void assignColor() {
  int id = 1;
  
  for (int i = 0; i < n; i++) {
    color[i] = N;
  }
  
  for (int u = 0; u < n; u++) {
    if (color[u] == N) {
      dfs(u, id++);
    }
  }
}


int main() {
  int s, t, m, q, i, j;
  
  scanf("%d", &n);
  scanf("%d", &m);
  
  for ( i = 0; i < m; i++) {
    scanf("%d", &s);
    scanf("%d", &t);
    
    for (j = 0; j < m; j++) {
      if (G[s][j] != N) {
        G[s][j] = t;
      }
      if (G[t][j] != N) {
        G[t][j] = s;
      }
    }
  }
  
  assignColor();
  
  scanf("%d", &q);
  
  for (i = 0; i < q; i++) {
    scanf("%d", &s);
    scanf("%d", &t);
    if (color[s] == color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }
  
  return 0;
}

Compiler output:
gcc: internal compiler error: File size limit exceeded signal terminated program as
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <file:///usr/share/doc/gcc-14/README.Bugs> for instructions.
Language: C

#include <stdio.h>
#define M 100000

int n;
int G[1000][1000] = {-1};
int color[M];

void dfs(int r, int c) {
  int s[M] = {-1};
  int a = 0, x = 0, m = 0, i;
  
  s[a] = r;
  color[r] = c;
  
  while (x == 0) {
    int u = s[m];
    
    for (i = 0 ; i < n; i++) {
      int v = G[u][i];
      if (color[v] == -1) {
        color[v] = c;
        a++;
      }
    }
    if (s[m + 1] == -1) {
      x = 1;
    }
  }
}

void assignColor() {
  int id = 1;
  
  for (int i = 0; i < n; i++) {
    -color[i] = 1;
  }
  
  for (int u = 0; u < n; u++) {
    if (-color[u] == 1) {
      dfs(u, id++);
    }
  }
}


int main() {
  int s, t, m, q, i, j;
  
  scanf("%d", &n);
  scanf("%d", &m);
  
  for ( i = 0; i < m; i++) {
    scanf("%d", &s);
    scanf("%d", &t);
    
    for (j = 0; j < m; j++) {
      if (G[s][j] != -1) {
        G[s][j] = t;
      }
      if (G[t][j] != -1) {
        G[t][j] = s;
      }
    }
  }
  
  assignColor();
  
  scanf("%d", &q);
  
  for (i = 0; i < q; i++) {
    scanf("%d", &s);
    scanf("%d", &t);
    if (color[s] == color[t]) {
      printf("yes\n");
    } else {
      printf("no\n");
    }
  }
  
  return 0;
}

Compiler output:
main.c: In function 'assignColor':
main.c:35:15: error: lvalue required as left operand of assignment
   35 |     -color[i] = 1;
      |               ^
Language: C

#include <iostream>
#include <vector>
#include <stack>
using namespace std;
static const int MAX = 100000;
static const int NIL = -1;


int n;
vector<int> G[MAX];
int color[MAX];

void dfs(int r, int c) {
	stack<int> S;
	S.push(r);
	color[r] = c;
	while ( !S.empty()) {
		int u = S.top(); S.pop();
		for ( int i = 0; i < G[u].size(); i++) {
			int v = G[u][i];
			if ( color[v] == NIL) {
				color[v] = c;
				S.push(v);
			}
		}
	}
}

void assignColor() {
	int id = 1;
	for ( int i = 0; i < n; i++) color[i] = NIL;
	for ( int u = 0; u < n; u++) {
		if (color[u] == NIL) dfs(u, id++);
	}
}

int main() {
	int s, t, m, q;

	cin >> n >> m;

	for (int i = 0; i < m; i++) {
		cin >> s >> t;
		G[s].push_back(t);
		G[t].push_back(s);
	}

	assignColor();

	cin >> q;

	for (int i = 0; i < q; i++) {
		cin >> s >> t;
		if (color[s] == color[t]) {
			cout << "yes" << endl;
		} else {
			cout << "no" << endl;
		}
	}

	return 0;
}

Compiler output:
main.c:1:10: fatal error: iostream: No such file or directory
    1 | #include <iostream>
      |          ^~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
int e[112345][112345]={};
int sumi[112345]={};
int n,m;

int dfs(int v,int g)
{
  int i;
  int ret=0;
  if(v==g)
    return 1;
  rep(i,n)
    if(e[v][i]==1 && sumi[i]==0)
      {
	sumi[i]=1;
	ret=dfs(i,g);
	if(ret==1)
	  break;
      }
  return ret;
}
int main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  scanf("%d %d",&n,&m);
  rep(i,m)
    {
      scanf("%d %d",&a,&b);
      e[a][b]=1;
      e[b][a]=1;
    }
  scanf("%d",&q);
  rep(i,q)
    {
      scanf("%d %d",&s,&t);
      if(dfs(s,t))
        puts("yes");
      else
	puts("no");
    }    
  return 0;
}

Compiler output:
/tmp/ccxrRvzz.o: in function `dfs':
main.c:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccxrRvzz.o
main.c:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccxrRvzz.o
main.c:(.text+0xb0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccxrRvzz.o
/tmp/ccxrRvzz.o: in function `main':
main.c:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccxrRvzz.o
main.c:(.text+0xda): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccxrRvzz.o
main.c:(.text+0x179): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccxrRvzz.o
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
int e[112345][112345]={};
int sumi[112345]={};
int n,m;
int dfs(int v,int g)
{
  int i;
  int ret=0;
  if(v==g)
    return 1;
  else
    {
      rep(i,n)
	if(e[v][i]==1 && sumi[i]==0)
	  {
	    sumi[i]=1;
	    ret=dfs(i,g);
	    if(ret==1)
	      break;
	  }
      return ret;
    }
}
int main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  scanf("%d %d",&n,&m);
  rep(i,m)
    {
      scanf("%d %d",&a,&b);
      e[a][b]=1;
      e[b][a]=1;
    }
  scanf("%d",&q);
  rep(i,q)
    {
      scanf("%d %d",&s,&t);
      if(dfs(s,t))
        puts("yes");
      else
	puts("no");
    }    
  return 0;
}

Compiler output:
/tmp/ccQs4e8L.o: in function `dfs':
main.c:(.text+0x6c): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccQs4e8L.o
main.c:(.text+0x87): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccQs4e8L.o
main.c:(.text+0xb0): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccQs4e8L.o
/tmp/ccQs4e8L.o: in function `main':
main.c:(.text+0xd0): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccQs4e8L.o
main.c:(.text+0xda): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccQs4e8L.o
main.c:(.text+0x179): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccQs4e8L.o
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
int e[112345][112345]={};
int sumi[112345]={};
int n,m;
int dfs(int v,int g)
{
  int i;
  int ret=0;
  if(v==g)
    ret=1;
  else
    rep(i,n)
      if(e[v][i]==1 && sumi[i]==0)
	{
	  sumi[i]=1;
	  ret=dfs(i,g);
	  if(ret==1)
	    break;
	}
  return ret;
}
int main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  scanf("%d %d",&n,&m);
  rep(i,m)
    {
      scanf("%d %d",&a,&b);
      e[a][b]=1;
      e[b][a]=1;
    }
  scanf("%d",&q);
  rep(i,q)
    {
      scanf("%d %d",&s,&t);
      if(dfs(s,t))
        puts("yes");
      else
	puts("no");
    }    
  return 0;
}

Compiler output:
/tmp/ccph3XGl.o: in function `dfs':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccph3XGl.o
main.c:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccph3XGl.o
main.c:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccph3XGl.o
/tmp/ccph3XGl.o: in function `main':
main.c:(.text+0xd2): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccph3XGl.o
main.c:(.text+0xdc): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccph3XGl.o
main.c:(.text+0x17b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccph3XGl.o
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
int e[112345][112345]={};
int sumi[112345]={};
int n,m;
int dfs(int v,int g)
{
  int i;
  int ret=0;
  if(v==g)
    ret=1;
  else
    for(i=0;i<n;i++)
      if(e[v][i]==1 && sumi[i]==0)
	{
	  sumi[i]=1;
	  ret=dfs(i,g);
	  if(ret==1)
	    break;
	}
  return ret;
}
int main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  scanf("%d %d",&n,&m);
  for(i=0;i<m;i++)
    {
      scanf("%d %d",&a,&b);
      e[a][b]=1;
      e[b][a]=1;
    }
  scanf("%d",&q);
  for(i=0;i<q;i++)
    {
      scanf("%d %d",&s,&t);
      if(dfs(s,t))
        puts("yes");
      else
	puts("no");
    }    
  return 0;
}

Compiler output:
/tmp/ccYLgcBW.o: in function `dfs':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccYLgcBW.o
main.c:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccYLgcBW.o
main.c:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccYLgcBW.o
/tmp/ccYLgcBW.o: in function `main':
main.c:(.text+0xd2): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccYLgcBW.o
main.c:(.text+0xdc): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccYLgcBW.o
main.c:(.text+0x17b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccYLgcBW.o
collect2: error: ld returned 1 exit status
Language: C

#include<stdio.h>
int e[112345][112345]={};
int sumi[112345]={};
int n;
int m;
int dfs(int v,int g)
{
  int i;
  int ret=0;
  if(v==g)
    ret=1;
  else
    for(i=0;i<n;i++)
      if(e[v][i]==1 && sumi[i]==0)
	{
	  sumi[i]=1;
	  ret=dfs(i,g);
	  if(ret==1)
	    break;
	}
  return ret;
}
int main(void)
{
  int i;
  int a,b;
  int q;
  int s,t;
  scanf("%d %d",&n,&m);
  for(i=0;i<m;i++)
    {
      scanf("%d %d",&a,&b);
      e[a][b]=1;
      e[b][a]=1;
    }
  scanf("%d",&q);
  for(i=0;i<q;i++)
    {
      scanf("%d %d",&s,&t);
      if(dfs(s,t))
        puts("yes");
      else
	puts("no");
    }    
  return 0;
}

Compiler output:
/tmp/ccgdc332.o: in function `dfs':
main.c:(.text+0x6e): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccgdc332.o
main.c:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `sumi' defined in .bss section in /tmp/ccgdc332.o
main.c:(.text+0xb2): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccgdc332.o
/tmp/ccgdc332.o: in function `main':
main.c:(.text+0xd2): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccgdc332.o
main.c:(.text+0xdc): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccgdc332.o
main.c:(.text+0x17b): relocation truncated to fit: R_X86_64_PC32 against symbol `m' defined in .bss section in /tmp/ccgdc332.o
collect2: error: ld returned 1 exit status
Language: C

#include<bits/stdc++.h>
using namespace std;
#define MAX 100000
int pa[MAX];
int ra[MAX];
void init(){
  for(int i=0;i<MAX;i++){
    pa[i]=i;
    ra[i]=0;
  }
}
 
int find(int x){
  if(pa[x]==x)return x;
  else return pa[x]=find(pa[x]);
}
 
void unite(int x,int y){
  x=find(x),y=find(y);
  if(x==y)return;
  if(ra[x]<ra[y])swap(x,y);
  pa[y]=x;
  if(ra[x]==ra[y])ra[x]++;
}
 
bool same(int x,int y){
  return (find(x)==find(y));
}
 
int n,m,q,a,b;
int main(){
  init();
  scanf("%d %d",&n,&m);
  for(int i=0;i<m;i++){
    scanf("%d %d",&a,&b);
    unite(a,b);
  }
  scanf("%d",&q);
  for(int i=0;i<q;i++){
    scanf("%d %d",&a,&b);
    cout<<(same(a,b)?"yes":"no")<<endl;
  }
  return 0;
}

Compiler output:
main.c:1:9: fatal error: bits/stdc++.h: No such file or directory
    1 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
Language: C

#include<stdio.h>
#define N 100000;

int G[N] = {0};

void init() {
  int i;
  for(i=0;i<N;++i) G[i]=i;
}

int find(int x) {
  if(x == G[x]) return x;
  return G[x] = find(G[x]);
}

int eq(int a, int b) {
  if(find(a) == find(b)) return 1;
  else return 0;
}

void cone(int a,int b) {
  a = find(a);
  b = find(b);

  if(a == b) return;
  G[b] = a;
}

int main() {
  int i,j,m,v,k,s;
  init();
  scanf("%d %d\n", &s,&m);

  for(i=0;i<m;++i) {
    scanf("%d %d\n", &j,&v);

    scanf("%d\n", &k);

    for(i=0;i<k;i++) {
      scanf("%d %d\n", &j,&v);
      if(eq(j,v)){
        printf("yes\n", );
      }
      else printf("no\n", );
    }
  }
  return 0;
}

Compiler output:
main.c:2:17: error: expected ']' before ';' token
    2 | #define N 100000;
      |                 ^
main.c:4:7: note: in expansion of macro 'N'
    4 | int G[N] = {0};
      |       ^
main.c: In function 'init':
main.c:8:14: error: expected expression before ';' token
    8 |   for(i=0;i<N;++i) G[i]=i;
      |              ^
main.c:8:20: error: 'G' undeclared (first use in this function)
    8 |   for(i=0;i<N;++i) G[i]=i;
      |                    ^
main.c:8:20: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'find':
main.c:12:11: error: 'G' undeclared (first use in this function)
   12 |   if(x == G[x]) return x;
      |           ^
main.c: In function 'cone':
main.c:26:3: error: 'G' undeclared (first use in this function)
   26 |   G[b] = a;
      |   ^
main.c: In function 'main':
main.c:42:25: error: expected expression before ')' token
   42 |         printf("yes\n", );
      |                         ^
main.c:44:27: error: expected expression before ')' token
   44 |       else printf("no\n", );
      |                           ^
Language: C

#include<stdio.h>
#define MAX 100000

int a[MAX][MAX];
int color[MAX],stack[MAX],point=0;
void push(int d) {
  stack[point]=d;
  point++;
  if(color[d]==0){
  color[d]=1;
  }
}
void pop(){
  point--;
}

int search(int s,int t) {
  int i;
  for (i = 0;i<MAX;i++) color[i]=0;
  push(s);
  while(point!=0){
  i=0;
  while(a[s][i]==1){
    i++;
  }
  
int main() {
  int n,m,s,t,p,q,w;
 

  scanf("%d %d",&n,&m);
  for(i = 0; i< m ; i++) {
    scanf("%d %d",&p,%w);
    a[p][w]=1;
  }
  scanf("%d",&q);
  for(i = 0;i < q; i++){
    scanf("%d %d",&s,&t);
    search(s,t);
  }

Compiler output:
main.c: In function 'main':
main.c:33:22: error: expected expression before '%' token
   33 |     scanf("%d %d",&p,%w);
      |                      ^
main.c:40:3: error: expected declaration or statement at end of input
   40 |   }
      |   ^
main.c: In function 'search':
main.c:40:3: error: expected declaration or statement at end of input
main.c:40:3: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>

#define N 10000

int ID[N];

void def(int N){
	int i;
	for(i=0;i<N;i++){
		ID[i]=i;
	}
}
int find(int a){
	if(a==ID[a]){
		return a;
	}
	return ID[a]=find(ID[a]);
}

int Judge(int a, int b){
	if(find(a)==find(b))return 1;
	else return 0;
}

void unite(int a, int b){
	a=find(a);
	b=find(b);
	
	if(a==b)break;
	ID[b]=a;
}

int main(){
	int n,m,q,i,s,t;
	
	scanf("%d %d", &n, &m);
	for(i=0; i<m; i++){
		scanf("%d %d", &s, &t);
		unite(s,t);}
	scanf("%d",&q);
	
	for(i=0; i<q; i++){
		scanf("%d %d", &s, &t);
		if (Judge(s,t) == 1)printf("yes\n");
		else printf("no\n");
	}
	return 0;
}

Compiler output:
main.c:3:11: error: expected ';', ',' or ')' before numeric constant
    3 | #define N 10000
      |           ^~~~~
main.c:7:14: note: in expansion of macro 'N'
    7 | void def(int N){
      |              ^
main.c: In function 'unite':
main.c:29:17: error: break statement not within loop or switch
   29 |         if(a==b)break;
      |                 ^~~~~
Language: C

#define N 100000
#define white -1

int c[N][N], num[N], color[N], n, S[N];


void tansaku_2(int a, int b) {
    int i, t, co, u;
    S[0] = a;
    t = 0;
    co = 1;
    while (t != co) {
        u = S[t];
        for (i = 0; i < num[u]; ++i) {
            if (color[c[u][i]] == white){
                color[c[u][i]] = b;
                S[co++] = c[u][i];
            }
        }
        S[t++] = 0;
    }
}

void tansaku() {
    int i;
    
    for (i = 0; i < n; ++i) {
        if (color[i] == white) {
            color[i] = i;
            tansaku_2(i , i);
        }
    }
}

int main() {
    int m, q, i, a, b;
    
    scanf("%d %d", &n, &m);
    for (i = 0; i < n; ++i) {
        num[i] = 0;
        color[i] = white;
    }
    for (i = 0; i < m; ++i) {
        scanf("%d %d", &a, &b);
        c[a][num[a]] = b;
        num[a]++;
        c[b][num[b]] = a;
        num[b]++;
    }
??? tansaku();
    scanf("%d", &q);
    for (i = 0; i < q; ++i) {
        scanf("%d %d", &a, &b);
        if (color[a] == color[b]) {
            printf("yes\n");
        }
        else{
            printf("no\n");
        }
    }

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:38:5: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   38 |     scanf("%d %d", &n, &m);
      |     ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define N 100000
main.c:38:5: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   38 |     scanf("%d %d", &n, &m);
      |     ^~~~~
main.c:38:5: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:50:1: error: expected expression before '?' token
   50 | ??? tansaku();
      | ^
main.c:55:13: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   55 |             printf("yes\n");
      |             ^~~~~~
main.c:55:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:55:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:55:13: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:58:13: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   58 |             printf("no\n");
      |             ^~~~~~
main.c:58:13: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#define MAX 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
longint color[MAX];
longint memo[MAX];
longint v[MAX][MAX];

int dfs(int u, int t) {
   longint stack[MAX];
   int i = 0;
   int j;
   int judge = 0;
   stack[0] = u;
   color[u] = GRAY;
   while (stack[0] != -1) {
	  u = stack[i];
	  judge = 0;
	  if (memo[u] != 0) {
		 for (j = 0; j < memo[u]; ++j) {
			if (color[v[u][j]] == WHITE) {
			   color[v[u][j]] = GRAY;
			   stack[++i] = v[u][j];
			   if (v[u][j] == t)
				  return 1;
			   judge = 1;
			}
		 }
	  }
	  if (judge == 0) {
		 stack[i] = -1;
		 color[u] = BLACK;
		 --i;
	  }
   }
   return 0;
}

int CC(int v[MAX][MAX], int s, int t, int n) {
   int i;
   for (i = 0; i < n; ++i) {
	  color[i] = WHITE;
   }
   return dfs(s, t);
}

int main() {
   longint ans[MAX];
   int n, m, q, s, t;
   int vs, vt;
   int i;

   scanf("%d %d", &n, &m);
   for (i = 0; i < n; ++i) {
	  memo[i] = 0;
	  v[i][0] = -1;
   }

   for (i = 0; i < m; ++i) {
	  scanf("%d %d", &vs, &vt);
	  v[vs][memo[vs]] = vt;
	  v[vt][memo[vt]] = vs;
	  ++memo[vs];
	  ++memo[vt];
   }

   scanf("%d", &q);
   for (i = 0; i < q; ++i) {
	  scanf("%d %d", &s, &t);
	  ans[i] = CC(v, s, t, n);
   }

   for (i = 0; i < q; ++i) {
	  if (ans[i] == 1)
		 printf("yes\n");
	  else
		 printf("no\n");
   }
   return 0;
}

Compiler output:
main.c:6:1: error: unknown type name 'longint'; did you mean 'long int'?
    6 | longint color[MAX];
      | ^~~~~~~
      | long int
main.c:7:1: error: unknown type name 'longint'; did you mean 'long int'?
    7 | longint memo[MAX];
      | ^~~~~~~
      | long int
main.c:8:1: error: unknown type name 'longint'; did you mean 'long int'?
    8 | longint v[MAX][MAX];
      | ^~~~~~~
      | long int
main.c: In function 'dfs':
main.c:11:4: error: unknown type name 'longint'; did you mean 'long int'?
   11 |    longint stack[MAX];
      |    ^~~~~~~
      |    long int
main.c: In function 'main':
main.c:49:4: error: unknown type name 'longint'; did you mean 'long int'?
   49 |    longint ans[MAX];
      |    ^~~~~~~
      |    long int
Language: C

#include <stdio.h>
#define MAX 100000
#define WHITE 0
#define GRAY 1
#define BLACK 2
long int color[MAX];
long int memo[MAX];
long int v[MAX][MAX];

int dfs(int u, int t) {
   long int stack[MAX];
   int i = 0;
   int j;
   int judge = 0;
   stack[0] = u;
   color[u] = GRAY;
   while (stack[0] != -1) {
	  u = stack[i];
	  judge = 0;
	  if (memo[u] != 0) {
		 for (j = 0; j < memo[u]; ++j) {
			if (color[v[u][j]] == WHITE) {
			   color[v[u][j]] = GRAY;
			   stack[++i] = v[u][j];
			   if (v[u][j] == t)
				  return 1;
			   judge = 1;
			}
		 }
	  }
	  if (judge == 0) {
		 stack[i] = -1;
		 color[u] = BLACK;
		 --i;
	  }
   }
   return 0;
}

int CC(int v[MAX][MAX], int s, int t, int n) {
   int i;
   for (i = 0; i < n; ++i) {
	  color[i] = WHITE;
   }
   return dfs(s, t);
}

int main() {
   long int ans[MAX];
   int n, m, q, s, t;
   int vs, vt;
   int i;

   scanf("%d %d", &n, &m);
   for (i = 0; i < n; ++i) {
	  memo[i] = 0;
	  v[i][0] = -1;
   }

   for (i = 0; i < m; ++i) {
	  scanf("%d %d", &vs, &vt);
	  v[vs][memo[vs]] = vt;
	  v[vt][memo[vt]] = vs;
	  ++memo[vs];
	  ++memo[vt];
   }

   scanf("%d", &q);
   for (i = 0; i < q; ++i) {
	  scanf("%d %d", &s, &t);
	  ans[i] = CC(v, s, t, n);
   }

   for (i = 0; i < q; ++i) {
	  if (ans[i] == 1)
		 printf("yes\n");
	  else
		 printf("no\n");
   }
   return 0;
}

Compiler output:
main.c: In function 'main':
main.c:71:23: error: passing argument 1 of 'CC' from incompatible pointer type [-Wincompatible-pointer-types]
   71 |           ans[i] = CC(v, s, t, n);
      |                       ^
      |                       |
      |                       long int (*)[100000]
main.c:40:12: note: expected 'int (*)[100000]' but argument is of type 'long int (*)[100000]'
   40 | int CC(int v[MAX][MAX], int s, int t, int n) {
      |        ~~~~^~~~~~~~~~~
Language: C

#include<stdio.h>
#define MAX 100000
 
int a[MAX][MAX];
int color[MAX],stack[MAX],point=0;
void push(int d) {
  stack[point]=d;
  point++;
  if(color[d]==0){
  color[d]=1;
  }
}
int pop(int d){
  point--;
  color[d]=2;
  return stack[point];
}
 
int search(int s,int t,int n) {
  int i,flag;
  for (i = 0;i<MAX;i++) color[i]=0;
  do {
  flag=0;
  if(color[s]==0)
  push(s);
  for(i=0;i<n;i++){
	if(a[s][i]==1&&color[i]==0){
		if(i==t) return 1;
	   s=i;
		flag=1;
		break;
	}
  }
  if(flag==0){
	s=pop(s);
  }
  
  }while(point!=0);
  return 0;
 }
  
int main() {
  int i,n,m,s,t,p,q,w,flag=0;
  
 
  scanf("%d %d",&n,&m);
  for(i = 0; i< m ; i++) {
    scanf("%d %d",&p,&w);
    a[p][w]=1;
  }
  scanf("%d",&q);
  for(i = 0;i < q; i++){
    scanf("%d %d",&s,&t);
    flag=search(s,t,n);
	 if(flag==0)
		printf("no\n");
	else
		printf("yes\n");
  }
  return 0;
}

Compiler output:
/tmp/cchANmYS.o: in function `push':
main.c:(.text+0x9): relocation truncated to fit: R_X86_64_PC32 against symbol `point' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x1a): relocation truncated to fit: R_X86_64_PC32 against symbol `stack' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x26): relocation truncated to fit: R_X86_64_PC32 against symbol `point' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x2f): relocation truncated to fit: R_X86_64_PC32 against symbol `point' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x43): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x5e): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cchANmYS.o
/tmp/cchANmYS.o: in function `pop':
main.c:(.text+0x75): relocation truncated to fit: R_X86_64_PC32 against symbol `point' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x7e): relocation truncated to fit: R_X86_64_PC32 against symbol `point' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x92): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0x9f): relocation truncated to fit: R_X86_64_PC32 against symbol `point' defined in .bss section in /tmp/cchANmYS.o
main.c:(.text+0xb0): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C

#include <stdio.h>
#define N 100000

int main(void)
{
 int i,n,m,q,s,t,a[N]={0};

 for(i=0;i<N;i++) a[i]=i;

 scanf("%d %d",&n,&m);

 for(i=0;i<m;i++){

  scanf("%d %d",&s,&t);

  if(a[s]==a[t]) a[t]=s;

 }

 scanf("%d",&q);

 for(i0;i<q;i++){
 
  scanf(%d %d",&s,&t);

  if(a[s]==a[t]) printf("yes\n");
  else printf("no\n");

 }

 return 0;
}

 

Compiler output:
main.c: In function 'main':
main.c:22:6: error: 'i0' undeclared (first use in this function); did you mean 'i'?
   22 |  for(i0;i<q;i++){
      |      ^~
      |      i
main.c:22:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:9: error: expected expression before '%' token
   24 |   scanf(%d %d",&s,&t);
      |         ^
main.c:24:14: warning: missing terminating " character
   24 |   scanf(%d %d",&s,&t);
      |              ^
main.c:24:14: error: missing terminating " character
   24 |   scanf(%d %d",&s,&t);
      |              ^~~~~~~~~
main.c:27:23: error: expected ';' before '}' token
   27 |   else printf("no\n");
      |                       ^
      |                       ;
   28 | 
   29 |  }
      |  ~
Language: C

#include <stdio.h>
#define N 100000

int main(void)
{
 int i,n,m,q,s,t,a[N]={0};

 for(i=0;i<N;i++) a[i]=i;

 scanf("%d %d",&n,&m);

 for(i=0;i<m;i++){

  scanf("%d %d",&s,&t);

  if(a[s]==a[t]) a[t]=s;

 }

 scanf("%d",&q);

 for(i=0;i<q;i++){
 
  scanf(%d %d",&s,&t);

  if(a[s]==a[t]) printf("yes\n");
  else printf("no\n");

 }

 return 0;
}

 

Compiler output:
main.c: In function 'main':
main.c:24:9: error: expected expression before '%' token
   24 |   scanf(%d %d",&s,&t);
      |         ^
main.c:24:14: warning: missing terminating " character
   24 |   scanf(%d %d",&s,&t);
      |              ^
main.c:24:14: error: missing terminating " character
   24 |   scanf(%d %d",&s,&t);
      |              ^~~~~~~~~
main.c:27:23: error: expected ';' before '}' token
   27 |   else printf("no\n");
      |                       ^
      |                       ;
   28 | 
   29 |  }
      |  ~
Language: C

#include <stdio.h>
#define N 100000

int search(int c)
{
	if(c==a[c]) return c;
	
	return a[c]=search(a[c]);
}

int main(void)
{
 int i,n,m,q,s,t,a[N]={0};

 for(i=0;i<N;i++) a[i]=i;

 scanf("%d %d",&n,&m);

 for(i=0;i<m;i++){

  scanf("%d %d",&s,&t);

  if(search(s)==search(t)) a[t]=s;

 }

 scanf("%d",&q);

 for(i=0;i<q;i++){
 
  scanf("%d %d",&s,&t);

  if(search(s)==search(t)) printf("yes\n");
  else printf("no\n");

 }

 return 0;
}

Compiler output:
main.c: In function 'search':
main.c:6:15: error: 'a' undeclared (first use in this function)
    6 |         if(c==a[c]) return c;
      |               ^
main.c:6:15: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int i,j,n,e,M[100][100];

int prim(int n){
  int u,,sum,mincost,d[100].p[100],color[100];
  
  for(i=0;i<n;i++){
    d[i]=(1<<21);
    p[i]=-1;
    color[i]=0;
  }
  
  d[0]=0;
  while(1){
    mincost=(1<<21);
    u=-1;
    for(i=0;i<n;i++){
      if(mincost>d[i]&&color[i]!=2){
        u=i;
        mincost=d[i];
      }
    }
    if(u==-1){
      break;
    }
    color[u]=2;
    for(j=0;j<n;j++){
      if(color[j]!=2&&M[u][j]!=(1<<21)){
        if(d[j]>M[u][j]){
          d[j]=M[u][j];
          p[j][j]=u;
          color[j]=1;
        }
      }
    }
  }
  sum=0;
  for(i=0;i<n;i++){
    if(p[i]!=-1){
      sum+=M[i][p[i]];
    }
  }
  
  return sum;
}

int main(void)
{
  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&e);
      M[i][j]=(e==-1)? (1<<21);
    }
  }
  pritf("%d\n",prin(n));
  return 0;
}

Compiler output:
main.c: In function 'prim':
main.c:6:9: error: expected identifier or '(' before ',' token
    6 |   int u,,sum,mincost,d[100].p[100],color[100];
      |         ^
main.c:9:5: error: 'd' undeclared (first use in this function)
    9 |     d[i]=(1<<21);
      |     ^
main.c:9:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:5: error: 'p' undeclared (first use in this function)
   10 |     p[i]=-1;
      |     ^
main.c:11:5: error: 'color' undeclared (first use in this function)
   11 |     color[i]=0;
      |     ^~~~~
main.c:16:5: error: 'mincost' undeclared (first use in this function)
   16 |     mincost=(1<<21);
      |     ^~~~~~~
main.c:38:3: error: 'sum' undeclared (first use in this function)
   38 |   sum=0;
      |   ^~~
main.c: In function 'main':
main.c:54:31: error: expected ':' before ';' token
   54 |       M[i][j]=(e==-1)? (1<<21);
      |                               ^
      |                               :
main.c:57:3: error: implicit declaration of function 'pritf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   57 |   pritf("%d\n",prin(n));
      |   ^~~~~
      |   printf
main.c:57:16: error: implicit declaration of function 'prin'; did you mean 'prim'? [-Wimplicit-function-declaration]
   57 |   pritf("%d\n",prin(n));
      |                ^~~~
      |                prim
Language: C

#include<stdio.h>
#define Num 100000

int main(){
   int i,x,y,n,m,z;
   int a[Num];

   for(i=0;i<Num;i++){
      a[i] = i;
   }

   scanf("%d %d",&x,&y);

   for(i=0;i<y;i++){
      scanf("%d %d", &n,&m);
      if(search(n) != search(m)){
         a[search(m)] = search(n);
      }
   }

   scanf("%d",&z);

   for(i=0;i<z;i++){
      scanf("%d %d",&n,&m);
      if(search(n) == search(m))
         printf("yes\n");
      else
         printf("no\n");
   }

   return 0;

}

Compiler output:
main.c: In function 'main':
main.c:16:10: error: implicit declaration of function 'search' [-Wimplicit-function-declaration]
   16 |       if(search(n) != search(m)){
      |          ^~~~~~
Language: C

#include<stdio.h>
#define Num 100000

int search(int c){
   if(c == a[c])
      return c;
   return a[c] = search(a[c]);

}


int main(){
   int i,x,y,n,m,z;
   int a[Num];

   for(i=0;i<Num;i++){
      a[i] = i;
   }

   scanf("%d %d",&x,&y);

   for(i=0;i<y;i++){
      scanf("%d %d", &n,&m);
      if(search(n) != search(m)){
         a[search(m)] = search(n);
      }
   }

   scanf("%d",&z);

   for(i=0;i<z;i++){
      scanf("%d %d",&n,&m);
      if(search(n) == search(m))
         printf("yes\n");
      else
         printf("no\n");
   }

   return 0;

}

Compiler output:
main.c: In function 'search':
main.c:5:12: error: 'a' undeclared (first use in this function)
    5 |    if(c == a[c])
      |            ^
main.c:5:12: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
#define Num 100000

int a[Num]

int search(int c){
   if(c == a[c])
      return c;
   return a[c] = search(a[c]);

}


int main(){
   int i,x,y,n,m,z;

   for(i=0;i<Num;i++){
      a[i] = i;
   }

   scanf("%d %d",&x,&y);

   for(i=0;i<y;i++){
      scanf("%d %d", &n,&m);
      if(search(n) != search(m)){
         a[search(m)] = search(n);
      }
   }

   scanf("%d",&z);

   for(i=0;i<z;i++){
      scanf("%d %d",&n,&m);
      if(search(n) == search(m))
         printf("yes\n");
      else
         printf("no\n");
   }

   return 0;

}

Compiler output:
main.c:4:11: error: expected ';' before 'int'
    4 | int a[Num]
      |           ^
      |           ;
    5 | 
    6 | int search(int c){
      | ~~~        
main.c: In function 'search':
main.c:7:12: error: 'a' undeclared (first use in this function)
    7 |    if(c == a[c])
      |            ^
main.c:7:12: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:18:7: error: 'a' undeclared (first use in this function)
   18 |       a[i] = i;
      |       ^
Language: C

#include<stdio.h>
#define   MAX 100000
#define   NIL -1

int n;
int G[MAX], color[MAX]

void dfs(int r, int c)
{
   color[r] = c;
   while ()


void assignColor()
{
   int id = 1;
   for (i=0; i<n; i++)
      color[i] = NIL;
   for (u=0; u<n; u++){
      if (color[u]==NIL)
         dfs(u, id++);
   }
}

int main()
{
   int i;
   int s, t, m, q;

   scanf("%d %d", &n, &m);

   for (i=0; i<m; i++){
      scanf("%d %d", &s, &t);
      G[s]
      G[t]
   }

   assignColor();

   scanf("%d", &q);

   for (i=0; i<n; i++){
      scanf("%d %d", &s, &t);
      if (color[s]==color[t]){
         printf("yes");
      } else {
         printf("no");
      }
   }

   return 0;
}

Compiler output:
main.c:8:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'void'
    8 | void dfs(int r, int c)
      | ^~~~
Language: C

#include<stdio.h>

int main(){

  int m, n, i, s, t;

  scanf("%d %d",&n, &m);
  int A[n][n];

  for ( i = 0; i < n; i++ ) {
    A[i][0] = i;
  }

  for ( i = 0; i < m; i++ ) {
    scanf("%d %d", &s, &t);
    A[s][i+1] = t;

Compiler output:
main.c: In function 'main':
main.c:16:5: error: expected declaration or statement at end of input
   16 |     A[s][i+1] = t;
      |     ^
main.c:16:5: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 100000
int matrix[MAX][MAX], *visit, *queue;
int bfs(int, int, int);
main()
{
        int i, n, m, q, s, t;
        scanf("%d%d", &n, &m);
        visit = (int*)malloc(sizeof(int) * n);
    	queue = (int*)malloc(sizeof(int) * n);
        for (i = 0; i < m; i++) {
                scanf("%d%d", &s, &t);
            matrix[s][t] = matrix[t][s] = 1;
        }
        scanf("%d", &q);
        for (i = 0; i< q; i++) {
                scanf("%d%d", &s, &t);
                if (bfs(s, t, n)) {
                        printf("yes\n");
                } else {
                        printf("no\n");
                }
        }
        free(visit);
        free(queue);
}
int bfs(int s, int t,int size)
{
        int i, pos, head = 0, tail = 0;
        queue[tail++] = s;
        for (i = 0; i < size; i++) {
                visit[i] = 0;
        }
        visit[s] = 1;
        do {
                pos = queue[head++];
                for (i = 0; i < size; i++) {
                        if (matrix[pos][i] && !visit[i]) {
                                if (i == t) return 1;
                                visit[i] = 1;
                                queue[tail++] = i;
                        }
                }
        } while (head != tail);
        return 0;
}


Compiler output:
main.c:6:1: error: return type defaults to 'int' [-Wimplicit-int]
    6 | main()
      | ^~~~