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

#define N 101
 
int G[N][N],way[N],chi[N],n;
 
void Fsearch(int x, int y){
  int i;
  way[x] = y;
  for(i=1;i<=chi[x];i++)
    if(y+1<way[G[x][i]]) FSearch(G[x][i], y + 1);
}
 
int main(){
  int i,j,m;
 
  scanf("%d",&n);
 
  for(i=1;i<=n;i++){
    way[i]=N;
    scanf("%d",&m);
    scanf("%d",&chi[m]);
 
    for(j=1;j<=chi[m];j++){
	 scanf("%d",&G[m][j]);
    }
  }
 
  Fsearch(1,0);
 
  for(i=1;i<=n;i++)
    if(way[i]==N)way[i]=-1;
 
  for(i=1;i<=n;i++) printf("%d %d\n",i,way[i]);
 
  return 0;
}

Compiler output:
main.c: In function 'Fsearch':
main.c:9:26: error: implicit declaration of function 'FSearch'; did you mean 'Fsearch'? [-Wimplicit-function-declaration]
    9 |     if(y+1<way[G[x][i]]) FSearch(G[x][i], y + 1);
      |                          ^~~~~~~
      |                          Fsearch
main.c: In function 'main':
main.c:15:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   15 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #define N 101
main.c:15:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   15 |   scanf("%d",&n);
      |   ^~~~~
main.c:15:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:32:21: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   32 |   for(i=1;i<=n;i++) printf("%d %d\n",i,way[i]);
      |                     ^~~~~~
main.c:32:21: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:32:21: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:32:21: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include<stdio.h>
#include<stdlib.h>
typedef struct list{
  int u, k, *v;
}T_list;
typedef struct graph{
  int d, f;
}T_graph;
int n;
T_list *lst;
T_graph *grp;
int que[100];
int p, q;
void bfs(int);
int main(){
  scanf("%d", &n);
  lst = (T_list *)malloc(sizeof(T_list) * n);
  grp = (T_graph *)malloc(sizeof(T_graph) * n);
  int i, j;
  for(i = n - 1; i >= 0; i--)
    grp[i].d = -1;
  for(i = 0; i < n; i++){
    scanf("%d %d", &lst[i].u, &lst[i].k);
    if(lst[i].k){
      lst[i].v = (int *)malloc(sizeof(int) * lst[i].k);
      for(j = 0; j < lst[i].k; j++){
    scanf("%d", &lst[i].v[j]);
  
      }
  
    }
  }
  grp[0].d = 0;
  p, q = 0;
  que[q] = 0;
  q++;
  for(p = 0; p < n; p++)
      bfs(que[p]);
  for(i = 0; i < n; i++){
    if(lst[i].k)
      free(lst[i].v);
    printf("%d %d\n", i + 1, grp[i].d);
  }
  free(grp), free(lst);
  return 0;
}
 
void bfs(int v){
  
  int i;
  for(i = 0; i < lst[v].k; i++){
    if(!(grp[lst[v].v[i] - 1].d + 1)){
      grp[lst[v].v[i] - 1].d = grp[v].d + 1;
      que[++q] = lst[v].v[i] - 1;
     
    }
  }

Compiler output:
main.c: In function 'bfs':
main.c:57:3: error: expected declaration or statement at end of input
   57 |   }
      |   ^
Language: C

#include<stdio.h>

#define N 100
#define L 100000000
#define white 0
#define gray 1
#define black 2

typedef struct{
  int data[N];
  int head;
  int tail;
}queue;

queue Q;

int n,d[N] = {L};
int g[N][N] = {0};
int color[N] = {white};

void bfs(int);
void enqueue(int);
int dequeue(void);

int main(){
  int i,j,u,k,v;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%d %d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d",&v);
      g[u-1][v-1] = 1;
    }
  }
  for(i=0;i<n;i++)
    d[i] = L;

  bfs(0);

  for(i=0;i<n;i++){
    if(d[i] == L)printf("%d %d\n",i+1,-1);
    else printf("%d %d\n",i+1,d[i]);
  }
  return 0;
}

void bfs(s){
  int v,u;

  d[s] = 0;
  color[s] = gray;
  Q.head = Q.tail = 0;
  enqueue(s);

  while(Q.tail < n){
    u = dequeue();
    if(u == INF)break;
    for(v=0;v<n;v++){
      if(g[u][v] == 0)continue;
      if(color[v] == white){
    d[v] = d[u] + 1;
    color[v] = gray;
    enqueue(v);
      }
    }
    color[u] = black;
  }
}

void enqueue(int s){

  if(Q.tail >= n)return;

  Q.data[Q.tail] = s;
  Q.tail++;
}

int dequeue(){
  int s;

  if(Q.head == Q.tail)return INF;

  s = Q.data[Q.head];
  Q.head++;

  return s;
}

Compiler output:
main.c: In function 'bfs':
main.c:49:6: error: type of 's' defaults to 'int' [-Wimplicit-int]
   49 | void bfs(s){
      |      ^~~
main.c:59:13: error: 'INF' undeclared (first use in this function)
   59 |     if(u == INF)break;
      |             ^~~
main.c:59:13: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'dequeue':
main.c:83:30: error: 'INF' undeclared (first use in this function)
   83 |   if(Q.head == Q.tail)return INF;
      |                              ^~~
Language: C

#include<stdio.h>
 
#define Max 101
#define WHITE 0
#define GRAY 1
#define BRACK 2
 
int n, head, tail,;
int d[Max], m[Max][Max], p[Max], color[Max];


void bfc(int s){
   int i,j;
   for(i = 0 ; i < n ; i++){
     color[i] = WHITE;
     d[i] = -1;
   }
   color[s] = GRAY;
   d[s] = 0;

   enqueue(s);

   while(head != tail){
     i = dequeue();
     for(j = 0;j < n;j++){
       if(color[j] == WHITE && m[i][j] == 1){
         color[j] = GRAY;
         d[j] = d[i] + 1;
         enqueue(j);
       }
     }
     color[i] = BRACK;
   }
}


void enqueue(int x){
   p[tail] = x;
   tail++;
}




int dequeue(void){
   int x;
   x = p[head];
   head++;
   return x;  
}


 
int main(){
    int i, j, v, k, u;
 
    scanf("%d",&n);

    for(i = 0 ; i < n ; i++){
        for(j = 0 ; j < n ; j++){
            m[i][j] = 0;
        }
    }
 
    for(i = 0 ; i < n ; i++){
        scanf("%d%d",&u,&k);
        u--;
        for(j = 0 ; j < k ; j++){
            scanf("%d",&v);
            v--;
            m[u][v] = 1;
        }
    }
 
    bfc(0);
 
    for(i = 0 ; i < n ; i++)
        printf("%d %d\n",i+1,d[i]);
 
 
    return 0;
}
 
 
 
 
 
 

Compiler output:
main.c:8:19: error: expected identifier or '(' before ';' token
    8 | int n, head, tail,;
      |                   ^
main.c: In function 'bfc':
main.c:21:4: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
   21 |    enqueue(s);
      |    ^~~~~~~
main.c:24:10: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
   24 |      i = dequeue();
      |          ^~~~~~~
main.c: At top level:
main.c:37:6: warning: conflicting types for 'enqueue'; have 'void(int)'
   37 | void enqueue(int x){
      |      ^~~~~~~
main.c:21:4: note: previous implicit declaration of 'enqueue' with type 'void(int)'
   21 |    enqueue(s);
      |    ^~~~~~~
Language: C

#include<stdio.h>
 
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
 
int n, head, tail,;
int d[Max], m[Max][Max], p[Max], color[Max];


void bfc(int s){
   int i, j;

   for(i = 0 ; i < n ; i++){
     color[i] = WHITE;
     d[i] = -1;
   }
   color[s] = GRAY;
   d[s] = 0;

   enqueue(s);

   while(head != tail){
     i = dequeue();
     for(j = 0 ; j < n ; j++){
       if(color[j] == WHITE && m[i][j] == 1){
         color[j] = GRAY;
         d[j] = d[i] + 1;
         enqueue(j);
       }
     }
     color[i] = BLACK;
   }
}


void enqueue(int x){
   p[tail] = x;
   tail++;
}


int dequeue(void){
   int x;

   x = p[head];
   head++;
   return x;  
}


 
int main(){

    int i, j, v, k, u;
 
    scanf("%d",&n);

    for(i = 0 ; i < n ; i++)
        for(j = 0 ; j < n ; j++){
            m[i][j] = 0;
        
 
    for(i = 0 ; i < n ; i++){
        scanf("%d%d",&u,&k);
        u--;
        for(j = 0 ; j < k ; j++){
            scanf("%d",&v);
            v--;
            m[u][v] = 1;
        }
    }
 
    bfc(0);
 
    for(i = 0 ; i < n ; i++)
        printf("%d %d\n", i+1, d[i]);
 
 
    return 0;
}
 
 
 
 
 
 

Compiler output:
main.c:8:19: error: expected identifier or '(' before ';' token
    8 | int n, head, tail,;
      |                   ^
main.c: In function 'bfc':
main.c:22:4: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
   22 |    enqueue(s);
      |    ^~~~~~~
main.c:25:10: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
   25 |      i = dequeue();
      |          ^~~~~~~
main.c: At top level:
main.c:38:6: warning: conflicting types for 'enqueue'; have 'void(int)'
   38 | void enqueue(int x){
      |      ^~~~~~~
main.c:22:4: note: previous implicit declaration of 'enqueue' with type 'void(int)'
   22 |    enqueue(s);
      |    ^~~~~~~
main.c: In function 'main':
main.c:82:1: error: expected declaration or statement at end of input
   82 | }
      | ^
Language: C

#include<stdio.h>
 
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
 
int n, head, tail;
int d[Max], m[Max][Max], p[Max], color[Max];


void bfc(int s){
   int i, j;

   for(i = 0 ; i < n ; i++){
     color[i] = WHITE;
     d[i] = -1;
   }
   color[s] = GRAY;
   d[s] = 0;

   enqueue(s);

   while(head != tail){
     i = dequeue();
     for(j = 0 ; j < n ; j++){
       if(color[j] == WHITE && m[i][j] == 1){
         color[j] = GRAY;
         d[j] = d[i] + 1;
         enqueue(j);
       }
     }
     color[i] = BLACK;
   }
}


void enqueue(int x){
   p[tail] = x;
   tail++;
}


int dequeue(void){
   int x;

   x = p[head];
   head++;
   return x;  
}


 
int main(){

    int i, j, v, k, u;
 
    scanf("%d",&n);

    for(i = 0 ; i < n ; i++)
        for(j = 0 ; j < n ; j++){
            m[i][j] = 0;
        
 
    for(i = 0 ; i < n ; i++){
        scanf("%d%d",&u,&k);
        u--;
        for(j = 0 ; j < k ; j++){
            scanf("%d",&v);
            v--;
            m[u][v] = 1;
        }
    }
 
    bfc(0);
 
    for(i = 0 ; i < n ; i++)
        printf("%d %d\n", i+1, d[i]);
 
 
    return 0;
}
 
 
 
 
 
 

Compiler output:
main.c: In function 'bfc':
main.c:22:4: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
   22 |    enqueue(s);
      |    ^~~~~~~
main.c:25:10: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
   25 |      i = dequeue();
      |          ^~~~~~~
main.c: At top level:
main.c:38:6: warning: conflicting types for 'enqueue'; have 'void(int)'
   38 | void enqueue(int x){
      |      ^~~~~~~
main.c:22:4: note: previous implicit declaration of 'enqueue' with type 'void(int)'
   22 |    enqueue(s);
      |    ^~~~~~~
main.c: In function 'main':
main.c:82:1: error: expected declaration or statement at end of input
   82 | }
      | ^
Language: C

#include<stdio.h>
 
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
  
int n, head, tail;
int d[N], m[Max], p[Max], color[Max];

void bfc(int s){
 int i,j; 

  for(i = 0;i < n;i++){
    color[i] = WHITE;
    d[i] = -1;
  }
  color[s] = GRAY;
  d[s] = 0;
  enqueue(s);
  while(head != tail){
    i = dequeue();
    for(j = 0 ; j < n ; j++){
      if(color[j] == WHITE && m[i][j] == 1){
        color[j] = GRAY;
        d[j] = d[i] + 1;
        enqueue(j);
      }
    }
    color[i] = BLACK;
  }
}


void enqueue(int x){
    p[tail] = x;
    tail++;
}

 
int dequeue(void){
    int x;

    x = p[head];
    head++;
    return x;  
}

int main(){
    int i, j, v, k, u;
 
    scanf("%d",&n);
    for(i = 0;i < n;i++)
        for(j = 0;j < n;j++)
            m[i][j] = 0;
        
    
 
    for(i = 0;i < n;i++){
        scanf("%d%d",&u,&k);
        u--;
        for(j = 0;j < k;j++){
            scanf("%d",&v);
            v--;
            m[u][v] = 1;
        }
    }
 
    bfc(0);
 
    for(i = 0;i < n;i++)
      printf("%d %d\n",i+1,d[i]);
 
    return 0;
}

Compiler output:
main.c:9:7: error: 'N' undeclared here (not in a function)
    9 | int d[N], m[Max], p[Max], color[Max];
      |       ^
main.c: In function 'bfc':
main.c:20:3: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
   20 |   enqueue(s);
      |   ^~~~~~~
main.c:22:9: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
   22 |     i = dequeue();
      |         ^~~~~~~
main.c:24:35: error: subscripted value is neither array nor pointer nor vector
   24 |       if(color[j] == WHITE && m[i][j] == 1){
      |                                   ^
main.c: At top level:
main.c:35:6: warning: conflicting types for 'enqueue'; have 'void(int)'
   35 | void enqueue(int x){
      |      ^~~~~~~
main.c:20:3: note: previous implicit declaration of 'enqueue' with type 'void(int)'
   20 |   enqueue(s);
      |   ^~~~~~~
main.c: In function 'main':
main.c:55:17: error: subscripted value is neither array nor pointer nor vector
   55 |             m[i][j] = 0;
      |                 ^
main.c:65:17: error: subscripted value is neither array nor pointer nor vector
   65 |             m[u][v] = 1;
      |                 ^
Language: C

#include<stdio.h>
 
#define Max 101
#define WHITE 0
#define GRAY 1
#define BLACK 2
  
int n, head, tail;
int d[N], M[Max], p[Max], color[Max];

void bfc(int s){
 int i,j; 

  for(i = 0;i < n;i++){
    color[i] = WHITE;
    d[i] = -1;
  }
  color[s] = GRAY;
  d[s] = 0;
  enqueue(s);
  while(head != tail){
    i = dequeue();
    for(j = 0 ; j < n ; j++){
      if(color[j] == WHITE && M[i][j] == 1){
        color[j] = GRAY;
        d[j] = d[i] + 1;
        enqueue(j);
      }
    }
    color[i] = BLACK;
  }
}


void enqueue(int x){
    p[tail] = x;
    tail++;
}

 
int dequeue(void){
    int x;

    x = p[head];
    head++;
    return x;  
}

int main(){
    int i, j, v, k, u;
 
    scanf("%d",&n);
    for(i = 0;i < n;i++)
        for(j = 0;j < n;j++)
            M[i][j] = 0;  
 
    for(i = 0;i < n;i++){
        scanf("%d%d",&u,&k);
        u--;
        for(j = 0;j < k;j++){
            scanf("%d",&v);
            v--;
            M[u][v] = 1;
        }
    }
 
    bfc(0);
 
    for(i = 0;i < n;i++)
      printf("%d %d\n",i+1,d[i]);
 
    return 0;
}

Compiler output:
main.c:9:7: error: 'N' undeclared here (not in a function)
    9 | int d[N], M[Max], p[Max], color[Max];
      |       ^
main.c: In function 'bfc':
main.c:20:3: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
   20 |   enqueue(s);
      |   ^~~~~~~
main.c:22:9: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
   22 |     i = dequeue();
      |         ^~~~~~~
main.c:24:35: error: subscripted value is neither array nor pointer nor vector
   24 |       if(color[j] == WHITE && M[i][j] == 1){
      |                                   ^
main.c: At top level:
main.c:35:6: warning: conflicting types for 'enqueue'; have 'void(int)'
   35 | void enqueue(int x){
      |      ^~~~~~~
main.c:20:3: note: previous implicit declaration of 'enqueue' with type 'void(int)'
   20 |   enqueue(s);
      |   ^~~~~~~
main.c: In function 'main':
main.c:55:17: error: subscripted value is neither array nor pointer nor vector
   55 |             M[i][j] = 0;
      |                 ^
main.c:63:17: error: subscripted value is neither array nor pointer nor vector
   63 |             M[u][v] = 1;
      |                 ^
Language: C

#include<stdio.h>
 
typedef struct{
    int num;
    int depth;
}node;
 
int head=0;
int tail=0;
node queue[100];
 
int graph[100][100]={0};
 
int isEmpty(void){
    if(head==tail){
        return 1;
    }else{
        return 0;
    }
}
 
void e(node n){
    queue[(head++)%100]=n;
}
 
node d(void){
    return queue[(tail++)%100];
     
}
 
void init(int d[],int n){
    int i;
    d[0]=0;
    for(i=1;i<n;i++){
        d[i]=-1;
    }
}
 
int main(void){
    int n;
    int u,k,v;
    int i,j;
    int d[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&u,&k);
        for(j=0;j<k;j++){
            scanf("%d",&v);
            graph[u-1][v-1]=1;
        }
    }
    init(d,n);
    node tmp;
    node next;
    tmp.num=0;
    tmp.depth=0;
    enqueue(tmp);
    while(!isEmpty()){
        tmp=dequeue();
        for(i=0;i<n;i++){
            if(graph[tmp.num][i]&&d[i]==-1){
                d[i]=tmp.depth+1;
                next.num=i;
                next.depth=d[i];
                enqueue(next);
            }
        }
    }
    for(i=0;i<n;i++){
        printf("%d %d\n",i+1,d[i]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:57:5: error: implicit declaration of function 'enqueue' [-Wimplicit-function-declaration]
   57 |     enqueue(tmp);
      |     ^~~~~~~
main.c:59:13: error: implicit declaration of function 'dequeue' [-Wimplicit-function-declaration]
   59 |         tmp=dequeue();
      |             ^~~~~~~
main.c:59:13: error: incompatible types when assigning to type 'node' from type 'int'
Language: C

#include<stdio.h>
 
typedef struct{
    int num;
    int depth;
}node;
 
int head=0;
int tail=0;
node queue[100];
 
int graph[100][100]={0};
 
int isEmpty(void){
    if(head==tail){
        return 1;
    }else{
        return 0;
    }
}
 
void e(node n){
    queue[(head++)%100]=n;
}
 
node d(void){
    return queue[(tail++)%100];
     
}
 
void init(int d[],int n){
    int i;
    d[0]=0;
    for(i=1;i<n;i++){
        d[i]=-1;
    }
}
 
int main(void){
    int n;
    int u,k,v;
    int i,j;
    int d[100];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d %d",&u,&k);
        for(j=0;j<k;j++){
            scanf("%d",&v);
            graph[u-1][v-1]=1;
        }
    }
    init(d,n);
    node tmp;
    node next;
    tmp.num=0;
    tmp.depth=0;
    e(tmp);
    while(!isEmpty()){
        tmp=d();
        for(i=0;i<n;i++){
            if(graph[tmp.num][i]&&d[i]==-1){
                d[i]=tmp.depth+1;
                next.num=i;
                next.depth=d[i];
                e(next);
            }
        }
    }
    for(i=0;i<n;i++){
        printf("%d %d\n",i+1,d[i]);
    }
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:59:13: error: called object 'd' is not a function or function pointer
   59 |         tmp=d();
      |             ^
main.c:43:9: note: declared here
   43 |     int d[100];
      |         ^
Language: C

#include<stdio.h>
#define N 101
 
int v[N][N], d[N], k[N]
int n;
 
void Distance(int a, int b)
{
  int i;
  d[a] = b;
  for (i = 0; i < k[a]; i++){
    if (b + 1 < d[v[a][i]])
        Distance(v[a][i], b + 1);
  }
}
 
int main()
{
  int i, j, p;
 
  scanf("%d", &n);

  for (i = 1; i <= n; i++) {
    A[i] = 100000000;
    scanf("%d", &u);
    scanf("%d", &k[u]);
    for(j = 1; j <= k[u]; j++){
      scanf("%d", &v[u][j]);
  }
 
  Distance(1, 0);
 
  for (i = 1; i <= n; i++) {
     if (d[i] == 100000000)
         d[i] = -1;
  }
 
  for (i = 1; i <= n; i++)
     printf("%d %d\n", i+1, d[i]);
 
  return 0;
}

Compiler output:
main.c:5:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'int'
    5 | int n;
      | ^~~
main.c: In function 'Distance':
main.c:11:19: error: 'k' undeclared (first use in this function)
   11 |   for (i = 0; i < k[a]; i++){
      |                   ^
main.c:11:19: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'main':
main.c:21:16: error: 'n' undeclared (first use in this function)
   21 |   scanf("%d", &n);
      |                ^
main.c:24:5: error: 'A' undeclared (first use in this function)
   24 |     A[i] = 100000000;
      |     ^
main.c:25:18: error: 'u' undeclared (first use in this function)
   25 |     scanf("%d", &u);
      |                  ^
main.c:26:18: error: 'k' undeclared (first use in this function)
   26 |     scanf("%d", &k[u]);
      |                  ^
main.c:42:1: error: expected declaration or statement at end of input
   42 | }
      | ^
Language: C

#iclude <stdio.h>
int main() {

int n, i, b, c, a[1000][1000], h[1000][2];

scanf ("%d",&n);

for (i = 0; i < n; i++) {
for (b = 0; b < n; b++) {

scanf ("%d" &a[i][b]);

}
}

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

h[i][0] = i + 1;
}



for (i = 0; i < n; i++)
printf ( "%d %d\n",h[i][1], h[i][2])



return 0;
}

Compiler output:
main.c:1:2: error: invalid preprocessing directive #iclude; did you mean #include?
    1 | #iclude <stdio.h>
      |  ^~~~~~
      |  include
main.c: In function 'main':
main.c:6:1: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    6 | scanf ("%d",&n);
      | ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | #iclude <stdio.h>
main.c:6:1: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    6 | scanf ("%d",&n);
      | ^~~~~
main.c:6:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:11:13: error: invalid operands to binary & (have 'char *' and 'int')
   11 | scanf ("%d" &a[i][b]);
      |        ~~~~ ^~~~~~~~
      |        |         |
      |        char *    int
main.c:24:1: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   24 | printf ( "%d %d\n",h[i][1], h[i][2])
      | ^~~~~~
main.c:24:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:1: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:24:1: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:24:37: error: expected ';' before 'return'
   24 | printf ( "%d %d\n",h[i][1], h[i][2])
      |                                     ^
      |                                     ;
......
   28 | return 0;
      | ~~~~~~
Language: C

#include<stdio.h>

int main(void) {
	int n, a[100][100] = {0}, kyori[100] = {0}, homon1[100] = {0}, homon2[100] = {0}, u, k, v, i, j, m;
	
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &u);
		scanf("%d", &k);
		for (j = 0; j < k; j++)
		{
			scanf("%d", &v);
			a[u - 1][v - 1] = 1;
		}
	}
	
	kyori[0] = 0;
	kyo = 0
	homon1[0] = 1;
	for (m = 0; m < n; m++)
	{
		for (i = 0; i < n; i++)
		{
			if (homon1[i] == 1 && homon2[i] == 0 && kyori[i] == kyo)
			{
				for (j = 0; j < n; j++)
				{
					if (a[i][j] == 1 && homon1[j] == 0)
					{
						kyori[j] = kyori[i] + 1;
						homon1[j] = 1;
					}
				}
				homon2[i] = 1;
			}
		}
		kyo++;
	}
	
	for (i = 0; i < n; i++)
	{
		if (i != 0 && kyori[i] == 0) kyori[i] = -1;
		printf("%d %d\n", i + 1, kyori[i]);
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:19:9: error: 'kyo' undeclared (first use in this function)
   19 |         kyo = 0
      |         ^~~
main.c:19:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:19:16: error: expected ';' before 'homon1'
   19 |         kyo = 0
      |                ^
      |                ;
   20 |         homon1[0] = 1;
      |         ~~~~~~
Language: C

#include<stdio.h>

int main()
{
  int n, h, i, j, k, l, m, z, flag, Q[100], Z[100];
  int G[100][100];
  scanf("%d", &n);
  
  for(i = 0; i < 100; i++ ) {
    Z[i] = -1;
    Q[[i] = 0;
  }
  
  for( i = 0; i < n; i++){
    scanf("%d", &G[i][0]);
    scanf("%d", &G[i][1]);
    for( j = 2; j < 2 + G[i][1]; j++){
      scanf("%d", &G[i][j]);
    }
  }
  
  m = 0; 
  h = 0; 
  Q[h] = 1;
  z = 0;
  Z[1] = z;
  z++;
  for( i = 0; i < n; i++){
    flag = 0;
    k = Q[m];
    l = G[k - 1][1];
    
    for( j = 0; j < l; j++){
      if( Z[ G[k - 1][2 + j] ] == -1 ){
        h++;
        Q[h] = G[k - 1][2 + j];
        Z[ G[k - 1][2 + j] ] = z;
        flag = 1;
      }
    }
    if( flag == 1 ) z++;
    m++;
    if( Q[m] == 0 ) i = i + n;
  }
  
  for(i = 1; i <= n ; i++){
    printf("%d %d\n", i, Z[i] );
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:7: error: expected expression before '[' token
   11 |     Q[[i] = 0;
      |       ^
main.c:11:15: error: expected ';' before '}' token
   11 |     Q[[i] = 0;
      |               ^
      |               ;
   12 |   }
      |   ~
Language: C

#include <stdio.h>
#define N 101
??
int G[N][N], X[N], Y[N], n;
??
void find(int x, int y){
????????int i;
????????X[x] = y;
????????for(i=1; i<=Y[x]; i++)
????????if(y+1 < X[G[x][i]]) find(G[x][i], y+1);
}
??
int main(){
????????int i, j, m;
??????????
????????scanf("%d", &n);
??????????
????????for(i=1; i<=n; i++){
????????????????X[i] = 100000000;
????????????????scanf("%d", &m);
????????????????scanf("%d", &Y[m]);
??????????????????
????????????????for(j=1; j<=Y[m]; j++)
????????????????scanf("%d", &G[m][j]);
????????}
??????????
????????find(1, 0);
??????????
????????for(i=1; i<=n; i++)
????????if(X[i] == 100000000)?? X[i] = -1;
??????????
????????for(i=1; i<=n; i++)
????????printf("%d %d\n", i, X[i]);
??????????
????????return 0;
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??
      | ^
main.c:5:1: error: expected identifier or '(' before '?' token
    5 | ??
      | ^
main.c:12:1: error: expected identifier or '(' before '?' token
   12 | ??
      | ^
Language: C

#include<iostream>
#include<queue>
using namespace std;

static const int INFTY = (1<<29);
int M[100][100];
int d[100];
int n;

void dfs(int s){
    int u;
    queue<int> q;

    q.push(s);
    for(int i=0;i<n;i++) d[i]=INFTY;
    d[s]=0;

    while( !q.empty() ){
	u=q.front(); q.pop();
	for(int v=0;v<n;v++){
	    if(M[u][v]==0) continue;
	    if(d[v]!=INFTY) continue;
	    d[v]=d[u]+1;
	    q.push(v);
	}
    }

    for(int i=0;i<n;i++){
	cout << i+1 << " " << ((d[i]==INFTY) ? (-1):d[i]) << endl;
    }
    
}

int main(void){
    int u,k,v;

    cin >> n;
 
    for(int i=0;i<n;i++){
	cin >> u >> k;
	u--;
	for(int j=0;j<k;j++){
	    cin >> v;
	    v--;	
	    M[u][v]=1;
	}
    }

    dfs(0);

    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 INF 2147483647

void bfs(int);
void enqueue(int);
int dequeue();

int n,head,tail,Q[100],color[100],d[100],A[100][100];

int main(){
  int i,j,u,k,v;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++){
    for(j=0;j<n;j++) A[i][j]=0;
  }
  
  for(i=0;i<n;i++){
    scanf("%d%d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d",&v);
      A[u-1][v-1]=1;
    }
  }
  bfs(0);

  for(i=0;i<n;i++){
    if(d[i]=INF) d[i]=-1;
    rintf("%d %d\n",i+1,d[i]);
  }

  return 0;
}

void bfs(int s){
  int i,u;

  for(i=0;i<n;i++){
    color[i]=0;
    d[i]=INF;
  }

  color[s]=1;
  d[s]=0;
  enqueue(s);

  while(head!=tail){
    u=dequeue();

    for(i=0;i<n;i++){
      if(A[u][i]==1&&color[i]==0){
	color[i]=1;
	d[i]=d[u]+1;
	enqueue(i);
      }
    }
    color[u]=2;
  }
}

void enqueue(int x){
  Q[tail]=x;
  if(tail+1==100) tail=0;
  else tail++;
}

int dequeue(){
  int x;

  x=Q[head];
  if(head+1==100) head=0;
  else head++;

  return x;
}

Compiler output:
main.c: In function 'main':
main.c:30:5: error: implicit declaration of function 'rintf' [-Wimplicit-function-declaration]
   30 |     rintf("%d %d\n",i+1,d[i]);
      |     ^~~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'rintf'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | #define INF 2147483647
main.c:30:5: warning: incompatible implicit declaration of built-in function 'rintf' [-Wbuiltin-declaration-mismatch]
   30 |     rintf("%d %d\n",i+1,d[i]);
      |     ^~~~~
main.c:30:5: note: include '<math.h>' or provide a declaration of 'rintf'
main.c:30:11: error: incompatible type for argument 1 of 'rintf'
   30 |     rintf("%d %d\n",i+1,d[i]);
      |           ^~~~~~~~~
      |           |
      |           char *
main.c:30:11: note: expected 'float' but argument is of type 'char *'
main.c:30:5: error: too many arguments to function 'rintf'
   30 |     rintf("%d %d\n",i+1,d[i]);
      |     ^~~~~
Language: C

#include <stdio.h>
#define N 101
#define WHITE 0
#define GRAY 1
#define BLACK 2

int A[N][N], color[N];
int d[N], Q[N+1];
int n, q1 = 0, q2 = 0;

void bfs(void);

int main() {
  int u, v, k, i, j;

  scanf("%d", &n);
  for(i = 1; i <= n; i++) {
    Q[i] = -1;
    for(j = 1; j <= n; j++) {
      A[i][j] = 0;
    }
  }
  Q[n+1] = -1;

  for(i = 1; i <= n; i++) {
    scanf("%d", &u);
    scanf("%d", &k);
    for(j = 1; j <= k; j++) {
      scanf("%d", &v);
      A[u][v] = 1;
    }
  }

  bfs();

  for(i = 1; i <= n; i++) {
    printf("%d %d\n", i, d[i]);
  }

  return 0;
}


void bfs() {
  int i, u;
  for(i = 1; i <= n; i++) {
    color[i] = WHITE;
    d[i] = -1;
  }
  color[1] = GRAY;
  d[1] = 0;
  Q[q1] = 1;
  q1++;
  while(q1 != q2) {
    u = Q[q2];
    q2++;
    for(i = 1; i<= n; i++) {
      if(A[u][i] == 1) {
        if(color[i] == WHITE) {
          color[i] = GRAY;a
          d[i] = d[u] + 1;
          Q[q1] = i;
          q1++;
        }
      }
    }
    color[u] = BLACK;
  }
}

Compiler output:
main.c: In function 'bfs':
main.c:60:27: error: unknown type name 'a'
   60 |           color[i] = GRAY;a
      |                           ^
main.c:61:18: error: variable-sized object may not be initialized except with an empty initializer
   61 |           d[i] = d[u] + 1;
      |                  ^
Language: C

#include<stdio.h>
#define N 100
#define INFTY 10000000;

int n;
int M[N][N];
int color[N], d[N], f[N];
int tt;
int Q[N*2];
int head, tail;

void init();
void enqueue(int);
int empty();
int dequeue();
void bfs(int);




int main(){

  int  u, k, v;
  int i, j; 

  scanf("%d", &n);

  for ( i = 0; i <n; i++ ){
    for ( j = 0; j <n; j++ ){
      M[i][j] = 0;
    }
  }
  
  for ( i = 0; i < n; i++ ){
    
    scanf("%d %d", &u, &k);
    u--;

    for ( j = 0; j < k; j++ ){

      scanf("%d", &v);
      v--;
      M[u][v] = 1;

    }
  }
  
  bfs(0);

  return 0;
}


void init(){
  head = tail = 1;
}

void enqueue(int x){
  Q[tail++] = x;
}

int empty(){
  return head == tail;
}

int dequeue(){
  int x = Q[head++];
  return x;
}

void bfs(int s){
  
  int i, u, v;

  init();
  enqueue(s);

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

  d[s] = 0;

  while(!empty()){

    u = dequeue();

    for ( v = 0; v < n; v++ ){
      if ( M[u][v] == 0 ) continue;
      if ( d[v] != INFTY ) continue;
      d[v] = d[u] + 1;
      enqueue(v);

    }
  }
  for ( i = 0; i < n; i++ ){
    printf("%d %d\n", i+1,((d[i]==INFTY)?(-1):d[i]));
  }
}

Compiler output:
main.c: In function 'bfs':
main.c:3:23: error: expected ')' before ';' token
    3 | #define INFTY 10000000;
      |                       ^
main.c:90:20: note: in expansion of macro 'INFTY'
   90 |       if ( d[v] != INFTY ) continue;
      |                    ^~~~~
main.c:90:10: note: to match this '('
   90 |       if ( d[v] != INFTY ) continue;
      |          ^
main.c:3:23: error: expected ')' before ';' token
    3 | #define INFTY 10000000;
      |                       ^
main.c:97:35: note: in expansion of macro 'INFTY'
   97 |     printf("%d %d\n", i+1,((d[i]==INFTY)?(-1):d[i]));
      |                                   ^~~~~
main.c:97:28: note: to match this '('
   97 |     printf("%d %d\n", i+1,((d[i]==INFTY)?(-1):d[i]));
      |                            ^
Language: C

#include <stdio.h>

#define WHITE 1
#define GRAY 0
#define BLACK -1
#define INF 100000000
#define N 100

void bfs(int);
void enqueue(int);
int dequeue(void);

int Q[N+1],d[N+1],c[N+1],ts,n,S[N+1][N+1],k[N+1];
int head, tail;

int main()
{
  int i,j,u,min;

  scanf("%d",&n);

  head = 0;
  tail = 1;

  for(i=0;i<n;i++){
    scanf("%d",&u);
    scanf("%d",&k[u]);

    for(j=0;j<k[u];j++){
      scanf("%d",&S[u][j]);
    }
  }

  bfs(1);
  for(i=1;i<=n;i++)  {
    if(d[i]==INF) d[i]=-1;
    printf("%d %d\n",i,d[i]);
  }

  return 0;
}

void bfs(int s){
  int i,u,v;
  for (u=1;u<=n;u++){
    color[u] = WHITE;
    d[u] = INF;
  }
  color[s] = GRAY;
  d[s] = 0;

  enqueue(s);

  while(head!=tail){
    u = dequeue();
    for(i=0;i<k[u];i++){
      v=vv[u][i];
      if (color[v] == WHITE){
    color[v] = GRAY;
    d[v] = d[u] + 1;
    enqueue(v);
      }
      color[u] = BLACK;
    }
  }
}

void enqueue(int x){ /* ?????\??????????°????????´? x ????????? */
  Q[tail] = x;
  if (tail + 1 == n) tail = 0;
  else tail++;
}

int dequeue(void){ /* ?????\??????????????????????´???????????????? */
  int x;
  x = Q[head];
  if (head + 1 == n) head = 0;
  else head++;
  return x;
}

Compiler output:
main.c: In function 'bfs':
main.c:46:5: error: 'color' undeclared (first use in this function)
   46 |     color[u] = WHITE;
      |     ^~~~~
main.c:46:5: note: each undeclared identifier is reported only once for each function it appears in
main.c:57:9: error: 'vv' undeclared (first use in this function); did you mean 'v'?
   57 |       v=vv[u][i];
      |         ^~
      |         v
Language: C

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


typedef int data_t;

data_t S[MAX];
int stack_num;

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

int push(data_t push_data)
{
    if (stack_num < MAX) {
        S[stack_num] = push_data;
        stack_num ++;
        return 1;
    } else {
        return 0;
    }
}



void bfs(int r,int c){
  int u,i,v;
  
  S.push(r);
  color[r]=c;
  while(!S){
    u = 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,id=1;
  for(i=0;i<n;i++) color[i] = NIL;
  for(u=0;u<n;u++){
    if(color[u]==NIL) bfs(u,id++);
  }
}

int main(){
  int i,s,t,m,q;
  scanf("%d%d",&n,&m);
  for(i=0;i<m;i++){
    scanf("%d%d",&s,&t);
    G[s].push_back(t);
    G[t].push_back(s);
  }

  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: In function 'bfs':
main.c:31:4: error: request for member 'push' in something not a structure or union
   31 |   S.push(r);
      |    ^
main.c:34:10: error: request for member 'pop' in something not a structure or union
   34 |     u = S.pop();
      |          ^
main.c:35:19: error: request for member 'size' in something not a structure or union
   35 |     for(i=0;i<G[u].size();i++){
      |                   ^
main.c:40:10: error: request for member 'push' in something not a structure or union
   40 |         S.push(v);
      |          ^
main.c: In function 'main':
main.c:59:9: error: request for member 'push_back' in something not a structure or union
   59 |     G[s].push_back(t);
      |         ^
main.c:60:9: error: request for member 'push_back' in something not a structure or union
   60 |     G[t].push_back(s);
      |         ^
Language: C

include <stdio.h>

#define WHITE 1
#define GRAY 0
#define BLACK -1
#define INF 100000000
#define N 100

void bfs(int);
void enqueue(int);
int dequeue(void);

int Q[N+1],d[N+1],c[N+1],ts,n,S[N+1][N+1],K[N+1];
int head, tail;

int main()
{
  int i,j,u,min;

  scanf("%d",&n);
  head = 0;
  tail = 1;

  for(i=0;i<n;i++){
    scanf("%d",&u);
    scanf("%d",&K[u]);

    for(j=0;j<K[u];j++){
      scanf("%d",&S[u][j]);
    }
  }

  bfs(1);
  for(i=1;i<=n;i++)  {
    if(d[i]==INF) d[i]=-1;
    printf("%d %d\n",i,d[i]);
  }

  return 0;
}

void bfs(int s){
  int i,u,v;
  for (u=1;u<=n;u++){
    c[u] = WHITE;
    d[u] = INF;
  }
  c[s] = GRAY;
  d[s] = 0;

  enqueue(s);

  while(head!=tail){
    u = dequeue();
    for(i=0;i<K[u];i++){
      v=S[u][i];
      if (c[v] == WHITE){
         c[v] = GRAY;
         d[v] = d[u] + 1;
         enqueue(v);
      }
      c[u] = BLACK;
    }
  }
}

void enqueue(int x){
  Q[tail] = x;
  if (tail + 1 == n) tail = 0;
  else tail++;
}

int dequeue(void){
  int x;
  x = Q[head];
  if (head + 1 == n) head = 0;
  else head++;
  return x;
}

Compiler output:
main.c:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include <stdio.h>
      |         ^
main.c: In function 'main':
main.c:20:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   20 |   scanf("%d",&n);
      |   ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | include <stdio.h>
main.c:20:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   20 |   scanf("%d",&n);
      |   ^~~~~
main.c:20:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:33:3: error: implicit declaration of function 'bfs' [-Wimplicit-function-declaration]
   33 |   bfs(1);
      |   ^~~
main.c:36:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   36 |     printf("%d %d\n",i,d[i]);
      |     ^~~~~~
main.c:36:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:36:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:36:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: At top level:
main.c:42:6: warning: conflicting types for 'bfs'; have 'void(int)'
   42 | void bfs(int s){
      |      ^~~
main.c:33:3: note: previous implicit declaration of 'bfs' with type 'void(int)'
   33 |   bfs(1);
      |   ^~~
Language: C

#include<stdio.h>
int G[101][101];
int d[101];
int n;
int Que[1000];
int head=0, tail=0;
void enqueue(int q){
  Que[head]=q;
  head++;
}  
int dequeue(){
  tail++;
  return Que[tail-1];
} 
int size(){
  return head-tail;
}

void bfs(int i){
  int j;
  for(j=0;j<n;j++){
    if(G[i][j]==1 && d[j]==-1){
      d[j]=d[i]+1;
      enqueue(j);
    }
  }
}  
int main(){ 
  int i,j,v,k,u;
  scanf("%d",&n);
  for(i=0;i<MAX;i++) d[i]=-1;
  for(i=0;i<n;i++){
    scanf("%d",&u);
    scanf("%d",&k);
    for(j=0;j<k;j++){
      scanf("%d",&v);
      G[u-1][v-1]=1;
    } 
  }
  d[0]=0;
  bfs(0);
  while(size()!=0) bfs(dequeue());
   
  for(i=0;i<n;i++) printf("%d %d\n",i+1,d[i]);
   
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:31:13: error: 'MAX' undeclared (first use in this function)
   31 |   for(i=0;i<MAX;i++) d[i]=-1;
      |             ^~~
main.c:31:13: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

#define MAX 1000
#define N 10000

int graph[MAX][MAX];
int d[MAX];
int n;

int Q[N];
int max=0,min=0;

void enQ(int q){
  Q[max]=q;
  max++;
}

void deQ(){
  min++;
  return Q[min-1];
}

int size(){
  return max-min;
}

void bfs(int i){
  int j;
  for(j=0;j<n;j++){
    if(graph[i][j]==1&&d[j]=NULL){
      d[j]=d[i]+1;
      enQ(j);
    }
  }
}

int main(){
  int i,j,a,b,c;

  scanf("%d",&n);

  for(i=0;i<MAX;i++) d[i]=NULL;
  for(i=0;i<n;i++){
    scanf("%d",&a);
    scanf("%d",&b);
    for(j=0;j<b;j++){
      scanf("%d",&c);
      graph[a-1][c-1];
    }
  }
  d[0]=0;
  bfs(0);

  while(size()!=0) bfs(deQ());

  for(i=0;i<n;i++) printf("%d %d",i+1,d[i]);

  return 0;
}

Compiler output:
main.c: In function 'deQ':
main.c:20:11: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   20 |   return Q[min-1];
      |          ~^~~~~~~
main.c:18:6: note: declared here
   18 | void deQ(){
      |      ^~~
main.c: In function 'bfs':
main.c:30:28: error: lvalue required as left operand of assignment
   30 |     if(graph[i][j]==1&&d[j]=NULL){
      |                            ^
main.c: In function 'main':
main.c:42:26: error: assignment to 'int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
   42 |   for(i=0;i<MAX;i++) d[i]=NULL;
      |                          ^
main.c:54:24: error: invalid use of void expression
   54 |   while(size()!=0) bfs(deQ());
      |                        ^~~~~
Language: C

#define INF (1<<21)
#define MAXSIZE 100
int n,A[N][N];
int dis[N];
int Q[MAXSIZE];
int head = 0; 
int tail = 1; 

void enqueue(int x)
{
  Q[tail++] = x;
  printf("%d\n",Q[tail-1]);
}

int deq() {
  int s;
  s = Q[head++];
  return s;

}
int empty()
{
  return (head == tail);
}
void bfs(int t)
{
  int i,j;
  enqueue(t);
  for(i=0;i<n;i++)dis[i]=INF;
  dis[t]=0;
  int a;
  while(!empty())
    {
      a=deq();
      for(j=0;j<n;j++)
	{
	  if(A[a][j]==0)continue;
	  if(dis[j]!=INF)continue;
	  dis[j]=dis[a]+1;
	  enqueue(j);
	}
    }
  for(i=0;i<n;i++)
    {
      printf("%d %d\n",i+1,((dis[i]==INF)?(-1):dis[i]));
    }
}
int main()
{
  int i,j,p,k,pnum;
  
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      for(j=0;j<n;j++)
	{
	  A[i][j]=0;
	}
    }
  for(i=0;i<n;i++)
    {
      scanf("%d %d",&p,&k);
      p--;
      for(j=0;j<k;j++)
	{
	  scanf("%d",&pnum);
	  pnum--;
	  A[p][pnum]=1;
	}
    }
  bfs(0);
  return 0;
}

Compiler output:
main.c:3:9: error: 'N' undeclared here (not in a function)
    3 | int n,A[N][N];
      |         ^
main.c: In function 'enqueue':
main.c:12:3: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   12 |   printf("%d\n",Q[tail-1]);
      |   ^~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'printf'
  +++ |+#include <stdio.h>
    1 | #define INF (1<<21)
main.c:12:3: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   12 |   printf("%d\n",Q[tail-1]);
      |   ^~~~~~
main.c:12:3: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'bfs':
main.c:45:7: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
   45 |       printf("%d %d\n",i+1,((dis[i]==INF)?(-1):dis[i]));
      |       ^~~~~~
main.c:45:7: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c: In function 'main':
main.c:52:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   52 |   scanf("%d",&n);
      |   ^~~~~
main.c:52:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:52:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:52:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
Language: C

#include<stdio.h>
 
#define MAX 1000
#define N 100
 
int G[MAX][MAX];
int d[MAX],Q[N];
int n;
int max=0,
int min=0;
 
void en(int q){
  Q[max] = q;
  max++;
}
 
int de(){
  min++;
  return Q[min-1];
}
 
int size(){
  return max-min;
}
 
void bfs(int i){
  int a;
  for(a = 0; a < n; a++){
    if(G[i][a] == 1 && d[a] == -1){
      d[a] = d[i]+1;
      en(a);
    }
  }
}
 
int main(){
  int i,j,u,k,c;
 
  scanf("%d",&n);
 
  for(i=0;i<MAX;i++){
    d[i]=-1;
  }

  for(i=0;i<n;i++){
    scanf("%d",&u);
    scanf("%d",&k);
    for(j=0;j<k;j++){
      scanf("%d",&c);
      G[u-1][c-1]=1;
    }
  }
  d[0]=0;
  bfs(0);
 
  while(size()!=0){
    bfs(de());
  }
 
  for(i=0;i<n;i++){
    printf("%d ",i+1);
    printf("%d\n",d[i]);
  }
 
  return 0;
}

Compiler output:
main.c:10:1: error: expected identifier or '(' before 'int'
   10 | int min=0;
      | ^~~
main.c: In function 'de':
main.c:18:3: error: 'min' undeclared (first use in this function)
   18 |   min++;
      |   ^~~
main.c:18:3: note: each undeclared identifier is reported only once for each function it appears in
main.c: In function 'size':
main.c:23:14: error: 'min' undeclared (first use in this function)
   23 |   return max-min;
      |              ^~~
Language: C

#include <stdio.h>
??
#define WHITE 1
#define GRAY 0
#define BLACK -1
#define INF 100000000
#define N 100
??
void bfs(int);
void enqueue(int);
int dequeue(void);
??
int Q[N+1],d[N+1],c[N+1],ts,n,S[N+1][N+1],k[N+1];
int head, tail;
??
int main()
{
????int i,j,u,min;
??
????scanf("%d",&n);
??
????head = 0;
????tail = 1;
??
????for(i=0;i<n;i++){
????????scanf("%d",&u);
????????scanf("%d",&k[u]);
??
????????for(j=0;j<k[u];j++){
????????????scanf("%d",&S[u][j]);
????????}
????}
??
????bfs(1);
????for(i=1;i<=n;i++)?? {
????????if(d[i]==INF) d[i]=-1;
????????printf("%d %d\n",i,d[i]);
????}
??
????return 0;
}
??
void bfs(int s){
????int i,u,v;
????for (u=1;u<=n;u++){
????????c[u] = WHITE;
????????d[u] = INF;
????}
????c[s] = GRAY;
????d[s] = 0;
??
????enqueue(s);
??
????while(head!=tail){
????????u = dequeue();
????????for(i=0;i<k[u];i++){
????????????v=S[u][i];
????????????if (c[v] == WHITE){
????????c[v] = GRAY;
????????d[v] = d[u] + 1;
????????enqueue(v);
????????????}
????????????c[u] = BLACK;
????????}
????}
}
??
void enqueue(int x){
????Q[tail] = x;
????if (tail + 1 == n) tail = 0;
????else tail++;
}
??
int dequeue(void){
????int x;
????x = Q[head];
????if (head + 1 == n) head = 0;
????else head++;
????return x;
}

Compiler output:
main.c:2:1: error: expected identifier or '(' before '?' token
    2 | ??
      | ^
main.c:12:1: error: expected identifier or '(' before '?' token
   12 | ??
      | ^
main.c:15:1: error: expected identifier or '(' before '?' token
   15 | ??
      | ^
main.c:42:1: error: expected identifier or '(' before '?' token
   42 | ??
      | ^
main.c:67:1: error: expected identifier or '(' before '?' token
   67 | ??
      | ^
main.c:73:1: error: expected identifier or '(' before '?' token
   73 | ??
      | ^
Language: C

#include <stdio.h>
#define INF 100000001
#define N 100
??
void matrixChainOrder(int);
int min(int, int);
??
int n,k,i,j,q,l;
int p[N],m[N][N];
??
int main(){
??
????scanf("%d",&n);
??
????for(i=1;i<=n;i++){
????????scanf("%d%d",&p[i-1],&p[i]);
????}
??
????matrixChainOrder(n);
??
????printf("%d\n",m[1][n]);
??
????return 0;
}
??
void matrixChainOrder(int n){
??
??
????for(i=1; i<=n; i++){
????????m[i][i] = 0;
????}
??
????for(l=2; l<=n; l++){
????????for(i=1; i<=n-l+1; i++){
????????????j=i+l-1;
????????????m[i][j] = INF;
????????????for(k=i;k<=j-1;k++){
????????q= m[i][k] + m[k+1][j] + p[i-1] * p[k] * p[j];
????????m[i][j] = min(m[i][j], q);
????????????}
????????}
????}
}
??
int min(int x, int y){
????if(x < y) return x;
????else if(x > y) return y;
????else if(x == y) return x;
}

Compiler output:
main.c:4:1: error: expected identifier or '(' before '?' token
    4 | ??
      | ^
main.c:7:1: error: expected identifier or '(' before '?' token
    7 | ??
      | ^
main.c:10:1: error: expected identifier or '(' before '?' token
   10 | ??
      | ^
main.c:25:1: error: expected identifier or '(' before '?' token
   25 | ??
      | ^
main.c:44:1: error: expected identifier or '(' before '?' token
   44 | ??
      | ^
Language: C

#include<stdio.h>
#include<math.h>
??????????
typedef struct
{
????double x;
????double y;
}koch;
??????
void fractal(int, koch, koch);
????????
int main()
{?????? 
????koch p1, p2;
????int n;
??????????
????p1.x = 0;
????p2.x = 100;
????p1.y = 0;
????p2.y = 0;
??????????
????scanf("%d", &n);
??????????
????printf("%f %f\n", p1.x, p1.y);
????fractal(n, p1, p2);
????printf("%f %f\n", p2.x, p2.y);
??????????
????return 0;
}
??????
void fractal(int n, koch p1, koch p2)
{???? 
????if(n == 0) return;
????koch s, t, u;
??????????
????s.x = (p2.x-p1.x)/3+p1.x;
????s.y = (p2.y-p1.y)/3+p1.y;
????t.x = 2*(p2.x-p1.x)/3+p1.x;
????t.y = 2*(p2.y-p1.y)/3+p1.y;
????u.x = (t.x-s.x)/2-sqrt(3)/2*(t.y-s.y)+s.x;
????u.y = (t.y-s.y)/2+sqrt(3)/2*(t.x-s.x)+s.y;
??????????
????fractal(n-1, p1, s);
????printf("%f %f\n", s.x, s.y);
??????????????
????fractal(n-1, s,u);
????printf("%f %f\n", u.x, u.y);
??????????????
????fractal(n-1, u, t);
????printf("%f %f\n", t.x, t.y);
??????????
????fractal(n-1, t, p2);
}

Compiler output:
main.c:3:1: error: expected identifier or '(' before '?' token
    3 | ??????????
      | ^
main.c:8:2: warning: data definition has no type or storage class
    8 | }koch;
      |  ^~~~
main.c:8:2: error: type defaults to 'int' in declaration of 'koch' [-Wimplicit-int]
main.c:9:1: error: expected identifier or '(' before '?' token
    9 | ??????
      | ^
main.c:11:1: error: expected identifier or '(' before '?' token
   11 | ????????
      | ^
main.c:30:1: error: expected identifier or '(' before '?' token
   30 | ??????
      | ^