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

#include<stdio.h>

int main()
{
  int N, M;
  scanf("%d %d", N, M);
  
  int **mat = malloc(sizeof(int *) * N);
  for (int i=0; i < N;i++) mat[i] = malloc(sizeof(int) * M);
  
  for(int i = 0; i < N; i++)
  {
    int K = getchar();
    for( int j = 0; j < K; j++ )
    {
      int l = getchar();
      printf("%d %d", l, j);
    }
  }
  
  for (int i=0;i<N;i++) free(mat[i]);
  free(mat);
  
  retrun 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |   int **mat = malloc(sizeof(int *) * N);
      |               ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:15: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |   int **mat = malloc(sizeof(int *) * N);
      |               ^~~~~~
main.c:8:15: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:21:25: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   21 |   for (int i=0;i<N;i++) free(mat[i]);
      |                         ^~~~
main.c:21:25: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:21:25: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:21:25: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:22:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   22 |   free(mat);
      |   ^~~~
main.c:22:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:24:3: error: 'retrun' undeclared (first use in this function)
   24 |   retrun 0;
      |   ^~~~~~
main.c:24:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:24:9: error: expected ';' before numeric constant
   24 |   retrun 0;
      |         ^~
      |         ;
Language: C

#include<stdio.h>

int main()
{
  int N, M;
  scanf("%d %d", N, M);
  
  int **mat = malloc(sizeof(int *) * N);
  for (int i=0; i < N;i++) mat[i] = malloc(sizeof(int) * M);
  
  for(int i = 0; i < N; i++)
  {
    int K = getchar();
    for( int j = 0; j < K; j++ )
    {
      printf("%d %d", getchar(), j);
    }
  }
  
  for (int i=0;i<N;i++) free(mat[i]);
  free(mat);
  
  retrun 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |   int **mat = malloc(sizeof(int *) * N);
      |               ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:15: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |   int **mat = malloc(sizeof(int *) * N);
      |               ^~~~~~
main.c:8:15: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:20:25: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   20 |   for (int i=0;i<N;i++) free(mat[i]);
      |                         ^~~~
main.c:20:25: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:20:25: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:20:25: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:21:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
   21 |   free(mat);
      |   ^~~~
main.c:21:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:23:3: error: 'retrun' undeclared (first use in this function)
   23 |   retrun 0;
      |   ^~~~~~
main.c:23:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:23:9: error: expected ';' before numeric constant
   23 |   retrun 0;
      |         ^~
      |         ;
Language: C

#include<stdio.h>
 
int main(void){
int a,b;
int c = 0;
int i[30];
int r;
 int count = 0;
  scanf("%d",&a);
  scanf("%d",&b);
	while(c == \0){
      scanf("%d",&c);
		if(c == 0){continue;}
      for(int j = 0;j<c;j++){
      scanf("%d",&r);
      i[r]++;
      }
    }
  for(int k =0;k<30;k++){
    if(i[k] == a){
      count++;
    }
  }
  printf("%d",count);
	
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:20: error: stray '\' in program
   11 |         while(c == \0){
      |                    ^
Language: C

#include<stdio.h>

int main()
{
  int N, M;
  scanf("%d %d", N, M);
  
  int **mat = malloc(sizeof(int *) * N);
  for (i=0;i<n;i++) mat[i] = malloc(sizeof(int) * M);
  
  for(int i = 0; i < N; i++)
  {
    int K = getchar();
    for( int j = 0; j < K; j++ )
    {
      printf("%d %d", getchar(), j);
    }
  }
}

Compiler output:
main.c: In function 'main':
main.c:8:15: error: implicit declaration of function 'malloc' [-Wimplicit-function-declaration]
    8 |   int **mat = malloc(sizeof(int *) * N);
      |               ^~~~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'malloc'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | 
main.c:8:15: warning: incompatible implicit declaration of built-in function 'malloc' [-Wbuiltin-declaration-mismatch]
    8 |   int **mat = malloc(sizeof(int *) * N);
      |               ^~~~~~
main.c:8:15: note: include '<stdlib.h>' or provide a declaration of 'malloc'
main.c:9:8: error: 'i' undeclared (first use in this function)
    9 |   for (i=0;i<n;i++) mat[i] = malloc(sizeof(int) * M);
      |        ^
main.c:9:8: note: each undeclared identifier is reported only once for each function it appears in
main.c:9:14: error: 'n' undeclared (first use in this function)
    9 |   for (i=0;i<n;i++) mat[i] = malloc(sizeof(int) * M);
      |              ^
Language: C++

#include<iostream>

using namespace std;

int main() {
	int N, M;
	int A[30];
	int K[30];
	int sum = 0, answer = 0;
	int i, j;
	cin >> N >> M;
	for (i = 1;i < N + 1;++i) {
		for (j = 1;j < K[i] + 1;++j)cin >> K[i] >> A[i][j];
	}
	for (i = 1;i < N + 1;++i) {
		for (j = 1;j < K[i] + 1;++j)
			for (int k = 0;k < N;++k)
			{
				if (A[i][j] == A[i + k][j])++sum;
			}
		if (sum == N)++answer;
		cout << answer << endl;
		return 0;
	}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:64: error: invalid types 'int[int]' for array subscript
   13 |                 for (j = 1;j < K[i] + 1;++j)cin >> K[i] >> A[i][j];
      |                                                                ^
a.cc:19:41: error: invalid types 'int[int]' for array subscript
   19 |                                 if (A[i][j] == A[i + k][j])++sum;
      |                                         ^
a.cc:19:56: error: invalid types 'int[int]' for array subscript
   19 |                                 if (A[i][j] == A[i + k][j])++sum;
      |                                                        ^
a.cc:24:10: error: expected '}' at end of input
   24 |         }
      |          ^
a.cc:5:12: note: to match this '{'
    5 | int main() {
      |            ^
Language: C

#include<stdio.h>
 
int main(void){
int a,b;
int c = 0;
int i[30];
int r;
 int count = 0;
  scanf("%d",&a);
  scanf("%d",&b);
	while(c == null){
      scanf("%d",&c);
		if(c == 0){continue;}
      for(int j = 0;j<c;j++){
      scanf("%d",&r);
      i[r]++;
      }
    }
  for(int k =0;k<30;k++){
    if(i[k] == a){
      count++;
    }
  }
  printf("%d",count);
	
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:11:20: error: 'null' undeclared (first use in this function)
   11 |         while(c == null){
      |                    ^~~~
main.c:11:20: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>

using namespace std;

int main(){
	int N,M;
  	int A[30];
	int K[30];
  	int sum=0,answer=0;
  	cin>>N>>M;
  	for(int i=1;i<N+1;++i){
    	cin>>K[i]>>for(int j=1;j<K[i]+1;++j)A[i][j];
    }
  	for(i=1;i<N+1;++i){
    	for (j=1;j<K[i]+1;++j)
          	for(int k=0;k<N;++k)
            {if(A[i][j]==A[i+k][j])++sum; 
            	}
      	if(sum==N)++answer;
      	cout<<answer<<endl;
      	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:20: error: expected primary-expression before 'for'
   12 |         cin>>K[i]>>for(int j=1;j<K[i]+1;++j)A[i][j];
      |                    ^~~
a.cc:12:32: error: 'j' was not declared in this scope
   12 |         cin>>K[i]>>for(int j=1;j<K[i]+1;++j)A[i][j];
      |                                ^
a.cc:14:13: error: 'i' was not declared in this scope
   14 |         for(i=1;i<N+1;++i){
      |             ^
a.cc:15:14: error: 'j' was not declared in this scope
   15 |         for (j=1;j<K[i]+1;++j)
      |              ^
a.cc:22:2: error: expected '}' at end of input
   22 | }
      |  ^
a.cc:5:11: note: to match this '{'
    5 | int main(){
      |           ^
Language: C++

#include <iostream>

int main(){

	int n, m, flag;
	int count=0;
	int k[30], a[30][30];

	std::cin>> n, m;

	for(int i=0;i<30;i++){
		for(int j=0;j<30;j++){
			a[i][j]=0;
		}
	}

	for(int i=0;i<n;i++){
		std::cin>> k[i];
		for(int j=0;j<k[i];j++){
			std::cin>> a[i][j];
		}
	}

	for(int l=1;l<=m;l++){
		flag=0;
		for(int i=0;i<n;i++){
			flag=0;
			for(int j=0;j<k[i];j++){
				if(a[i][j]==l) flag=1;
			}
			if(flag==0) break;
		}
		if(flag==1) count++;
		if(i==0) count=1;
	}

	std::cout<< count << "\n";

}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:20: error: 'i' was not declared in this scope
   34 |                 if(i==0) count=1;
      |                    ^
Language: C++

#include<iostream>
#include<sstream>
#include<vector>
#include<iterator>
using namespace std;

int main(void)
{
	int N, M;
	cin >> N >> M;

	vector<int> cnt(M, 0);
	for(int i=0; i<N; i++){
		int K;
		cin >> K;

		int a;
		for(int j=0; j<K; j++){
			cin >> a;

			a--;
			cnt[a]++;
		}
	}

	int ans = count(cnt.begin(), cnt.end(), N);
	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: 'count' was not declared in this scope; did you mean 'cnt'?
   26 |         int ans = count(cnt.begin(), cnt.end(), N);
      |                   ^~~~~
      |                   cnt
Language: C

#include<stdio.h>
int main(void){
    int N,M,K[30],A[30][30];
    int i,j,cou[30],all=0;
    scanf("%d %d",&N,&M);
    for(i=0;i<N;i++){
        scanf("%d",&K[i]);
        for(j=0;j<K[i];j++){
            scanf("%d",&A[i][j]);
        }
    }

    
    
        for(int m=0;m<K[0];m++){
            for(i=1;i<N;i++){
                for(j=0;j<K[i];j++){
                    if(A[0][m]==A[i][j]){
                       cou[m]++; 
                    }
                }
            }
        }
    for(i=0;i<m[0];i++){
        if(cou[i]==N-1){
            all++;
        }
    }
if(N==1){
    printf("%d",K[0]);
}else{
    printf("%d",all);
}
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:24:15: error: 'm' undeclared (first use in this function)
   24 |     for(i=0;i<m[0];i++){
      |               ^
main.c:24:15: note: each undeclared identifier is reported only once for each function it appears in
Language: Java

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int[] N = new int[30];
    int l = 0;
    while(sc.hasNextLine()){
      N[Integer.parseInt(sc.next())] += 1;
      print();
      l++;
    }
    List<Integer> X = new ArrayList();
    for(int i=0;i<30;i++)if(N[i]==l)X.add(i);
    for(int j:X)System.out.print(j);
  }
}

Compiler output:
Main.java:10: error: cannot find symbol
      print();
      ^
  symbol:   method print()
  location: class Main
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C

#include<stdio.h>
int main(){
  int n,m;
  scanf("%d",&n);
  scanf("%d",&m);
  int q[n];
  for(int i=0;i<n;i++){
    scanf("%d",q[i]);
  }
  int a[n],count[m];
  for(int i=0;i<n;i++){
    for(int j=0;j<q[j];j++){
      scanf("%d",&a[j]);
      for(int l=0;l<m;l++){
        if(a[j]==l)
          count[l]++;
      }
    }
  }
  int ans=0;
  for(int i=0;i<m;i++){
    if(count[a]==m)
      ans++;
  }
  printf("%d",ans);
}
          

Compiler output:
main.c: In function 'main':
main.c:22:13: error: array subscript is not an integer
   22 |     if(count[a]==m)
      |             ^
Language: C++

int main(){
  int N,M;
  cin>>N>>M;
  int array[N];
  int arra[M];
  int a[M];
    for(int k=0; k<M; k++){
    arra[M]=0;}
    for(int i=0; i<N; i++){
    cin>>array[N];
      for(int j=0; j<array[N]; j++){
      	cin>>a[j];
        arra[a[j]]=arra[a[j]]+1;
      }
    }
  int r;
  for (int u=0; u<M; u++){
  if (arra[u]==N){ r=r+1;}
  }
  cout<< r <<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:3: error: 'cin' was not declared in this scope
    3 |   cin>>N>>M;
      |   ^~~
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout<< r <<endl;
      |   ^~~~
a.cc:20:14: error: 'endl' was not declared in this scope
   20 |   cout<< r <<endl;
      |              ^~~~
Language: C++

#include <iostream>

using namespace std;

int main(int argc, char ** argv){
  int N,M,K,idx;
  cin >> N >> M;
  int * like = new int like[M];
  for(int i = 0; i < M; i++){
    like[i] = 0;
  }
  
  for(int i = 0; i < N; i++){
    cin >> K;
    for(int j = 0; j < K; j++){
      cin >> idx;
      like[idx-1] += 1;
    }
  }
  
  int cnt = 0;
  for(int i = 0; i < M; i++){
    if(like[i] == N) cnt++;
  }
  
  cout << cnt;
  
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:8:24: error: expected ',' or ';' before 'like'
    8 |   int * like = new int like[M];
      |                        ^~~~
Language: C++

include <iostream>
using namespace std;

int main()
{
  	int N, M;
	cin >> N >> M;

	int *ms = new int[M];
	for (int i = 0; i < M; ++i)ms[i] = 0;

	for (int i = 0; i < N; ++i)
	{
		int Ki;
		cin >> Ki;
		for (int j = 0; j < Ki; ++j)
		{
			int likeNum;
			cin >> likeNum;
			++ms[likeNum - 1];
		}
	}

	int ret = 0;
	for (int i = 0; i < M; ++i)
		if (ms[i] == N)++ret;

	cout << ret << endl;

	delete[] ms;

  return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope
    7 |         cin >> N >> M;
      |         ^~~
a.cc:28:9: error: 'cout' was not declared in this scope
   28 |         cout << ret << endl;
      |         ^~~~
a.cc:28:24: error: 'endl' was not declared in this scope
   28 |         cout << ret << endl;
      |                        ^~~~
Language: C++

#include<iostream>
#include<vector>
using namespace std;
int main(){
    long N,M;
    cin>>N>>M;
    long K[N];
    cin>>K[0];
    vector<long> vec1(K[0]);
    for (int i=0;i<K[0];++i){
        cin>>vec1[i];
    }
    for(int j=1;j<N;++j){
        cin>>K[j];
        long m=0;
        vector<long> vec2(K[0]);
        for (int i=0;i<K[j];++i){
            long a;
            cin>>a;
            if(find(vec1.begin(),vec1.end(),a)!=vec1.end()){
                vec2[m]=a;
                ++m;
                
            }
        }
        vec1=vec2;
        if(vec1.empty()==true){
            break;
            cout<<"OK"<<endl;
        }
    }
    if(vec1.empty()!=true) {
        for (int j = 0; j < K[0]; ++j) {
            if (vec1[j] == 0) {
                vec1.erase(vec1.begin() + j);
            }
        }
    }
    long ans;
    vec1.empty()==true ? ans=0:ans=vec1.size();
    cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:20: error: no matching function for call to 'find(std::vector<long int>::iterator, std::vector<long int>::iterator, long int&)'
   20 |             if(find(vec1.begin(),vec1.end(),a)!=vec1.end()){
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/bits/locale_facets.h:48,
                 from /usr/include/c++/14/bits/basic_ios.h:37,
                 from /usr/include/c++/14/ios:46,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note: candidate: 'template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(istreambuf_iterator<_CharT>, istreambuf_iterator<_CharT>, const _CharT2&)'
  435 |     find(istreambuf_iterator<_CharT> __first,
      |     ^~~~
/usr/include/c++/14/bits/streambuf_iterator.h:435:5: note:   template argument deduction/substitution failed:
a.cc:20:20: note:   '__gnu_cxx::__normal_iterator<long int*, std::vector<long int> >' is not derived from 'std::istreambuf_iterator<_CharT>'
   20 |             if(find(vec1.begin(),vec1.end(),a)!=vec1.end()){
      |                ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>

int main(){
	
	int m, n, a[30], b[30], i, j, k, count, l, o, d;
	char c[200];
  
	scanf("%d %d", &n, &m);
	for(i=0;i<n;i++){
    	scanf("%s", c);
      	k=atoi(c);
    	for(j=0, count=0;count<k;j++){
    		if(c[j]==' '){
              a[count]=atoi(c+i);
              ++count
            }	
		if(i==0){
        	for(j=0;j<k;j++) b[j]=a[j];
          	o=k;
        	countinue;
        }
    	for(j=0;a[j]!=0;j++){
        	for(l=0;b[l]!=0;l++){
            	if(a[j]==b[l]) break;
            }
          if(b[l]==0) a[j]=0;
        }
        for(j=0, d=0;j<count;j++){
        	if(a[j]!=0){
              b[d]=a[j];
              d++;
            }
        }    
          count=d;
          for(;d<o;++d) b[d]=0;
          o=d;
        }
      printf("%d", count);
      
      return 0;
    }
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: expected ';' before '}' token
   16 |               ++count
      |                      ^
      |                      ;
   17 |             }
      |             ~         
a.cc:21:17: error: 'countinue' was not declared in this scope
   21 |                 countinue;
      |                 ^~~~~~~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  int array[N];
  int arra[M];
  int a[M];
    for(int k=0; k<M; k++){
    arra[M]=0;}
    for(int i=0; i<N; i++){
    cin>>array[N];
      for(int j=0; j<array[N]; j++){
      	cin>>a[j];
        arra[a[j]]=arra[a[j]]+1
      }
    }
  int r;
  for (int u=0; u<M; u++){
  if (arra[u]==N){ r++}
  }
  cout<< r <<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:32: error: expected ';' before '}' token
   15 |         arra[a[j]]=arra[a[j]]+1
      |                                ^
      |                                ;
   16 |       }
      |       ~                         
a.cc:20:23: error: expected ';' before '}' token
   20 |   if (arra[u]==N){ r++}
      |                       ^
      |                       ;
Language: C++

#include<iostream>
using namespace std;

int main(void){
  int n, m, k, a, ans[30];
  cin>>n>>m;
  for (int i=0; i<m; i++) ans[i]=0;
  for(int i=0; i<n;i++){
    cin>>k;
    for (int j=0; j<k; j++){
      cin>>a;
      ans[a-1]++;
    }
  }
  int y=0;
  for (int i=0; i<m; i++) {
    if (a[i]==n) y++;
  }
  cout<<y<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: invalid types 'int[int]' for array subscript
   17 |     if (a[i]==n) y++;
      |          ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  int array[N];
  int arra[M];
  int a[M];
    for(int k=0; k<M; k++){
    arra[M]=0;}
    for(int i=0; i<N; i++){
    cin>>array[N];
      for(int j=0; j<array[N]; j++){
      	cin>>a[M];
        arra[a[M]]++
      }
    }
  int r;
  for (int u=0; u<M; u++){
  if (arra[u]==N){ r++}
  }
  cout<< r <<endl;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
   15 |         arra[a[M]]++
      |                     ^
      |                     ;
   16 |       }
      |       ~              
a.cc:20:23: error: expected ';' before '}' token
   20 |   if (arra[u]==N){ r++}
      |                       ^
      |                       ;
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  int n, m;
  cin >> n >> m;

  vector<int> v(m,0);
  int k, a;
  for (int i = 0; i < n; i++) {
    cin >> k;
    for (int j = 0; j < k; j++) {
      cin >> a;
      v.at(a-1)++;
    }
  }

  sort(v.begin(), v.end());
  ans = 0;
  for (int i = m-1; i >= 0; i--) {
    if (v.at(i) == n) {
      ans++;
    }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   19 |   ans = 0;
      |   ^~~
      |   abs
a.cc:25:2: error: expected '}' at end of input
   25 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

#include <iostream>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  int array[N];
  int arra[M];
  int a[M];
    for(int k=0; k<M; k++){
    arra[M]=0;}
    for(int i=0; i<N; i++){
    cin>>array[N];
      for(int j=0; j<array[N]; j++){
      	cin>>a[M];
        arra[a[M]]++
      }
    }
  int r;
  for (int u=0; u<M; u++){
  if (arra[u]==N){ r++}
  }
  cout<< r <<endl;
return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:21: error: expected ';' before '}' token
   15 |         arra[a[M]]++
      |                     ^
      |                     ;
   16 |       }
      |       ~              
a.cc:20:23: error: expected ';' before '}' token
   20 |   if (arra[u]==N){ r++}
      |                       ^
      |                       ;
Language: C++

#include <iostream>
using namespace std;
 
int main(){
  int n,m;
  cin >> n >> m;
  
  int k[n];
  
  int a[n];
  
  for(int i=0;i<n;i++){
    cin >> k[i];
    int a[i][k[i]];
    for(int j=0;j<k[i];j++){
      cin >> a[i][k[j]];
    }
  }
  
  int shurui=0;
  int hukumare=0;
  
  for(int l=1;l<=m;l++){
    for(int o=1;o<=n;o++){
      for(int p=0;p<k[o-1];p++){
        if(l=a[o-1][p])hukumare++;
      }
    }
    if(hukumare==n)shurui++;
    hukumare=0;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:20: error: invalid types 'int[int]' for array subscript
   26 |         if(l=a[o-1][p])hukumare++;
      |                    ^
Language: C++



N,M = input().split()
N = int(N) 
all_foods_bags = [input().split() for i in range(N)] 


for i, foods_bags in enumerate(all_foods_bags):
    foods_bags.pop(0)
    all_foods_bags[i] = foods_bags

 
for i, foods_bags in enumerate(all_foods_bags):
    if i == 0:
        original_food_set = set(foods_bags)
    
    else:
        original_food_set = original_food_set & set(foods_bags)

print(len(original_food_set))

Compiler output:
a.cc:3:1: error: 'N' does not name a type
    3 | N,M = input().split()
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main (void) {
    int N, M;
    vector<int> favorite;

    cin >> N >> M;

    favorite.resize(N);
    favorite.fill(0);
    for (int i = 0; i < N; i++) {
        int K;
        cin >> K;
        for (int j = 0; j < N; j++) {
            int A;
            cin >> A;
            favorite[A]++;
        }
    }

    int ans = 0;
    for (int i = 0; i < N; i++) {
        if (favorite[i] == N) ans++;
    }

    cout << ans << endl;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:14: error: 'class std::vector<int>' has no member named 'fill'
   11 |     favorite.fill(0);
      |              ^~~~
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n,m;
  cin >> n >> m;
  
  int k[n];
  
  for(int i=0;i<n;i++){
    cin >> k[i];
    int a[i][k[i]];
    for(int j=0;j<k[i];j++){
      cin >> a[i][k[j]];
    }
  }
  
  int shurui=0;
  int hukumare=0;
  
  for(int l=1;l<=m;l++){
    for(int o=1;o<=n;o++){
      for(int p=0;p<k[o-1];p++){
        if(l=a[o-1][p])hukumare++;
      }
    }
    if(hukumare==n)shurui++;
    hukumare=0;
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:24:14: error: 'a' was not declared in this scope
   24 |         if(l=a[o-1][p])hukumare++;
      |              ^
Language: C++


    }
  }
  lld ans = 0;
  for(lld i = 0; i < M; i++) {
    if(foods[i] == N) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc:2:5: error: expected declaration before '}' token
    2 |     }
      |     ^
a.cc:3:3: error: expected declaration before '}' token
    3 |   }
      |   ^
a.cc:4:3: error: 'lld' does not name a type
    4 |   lld ans = 0;
      |   ^~~
a.cc:5:3: error: expected unqualified-id before 'for'
    5 |   for(lld i = 0; i < M; i++) {
      |   ^~~
a.cc:5:18: error: 'i' does not name a type
    5 |   for(lld i = 0; i < M; i++) {
      |                  ^
a.cc:5:25: error: 'i' does not name a type
    5 |   for(lld i = 0; i < M; i++) {
      |                         ^
a.cc:10:3: error: 'cout' does not name a type
   10 |   cout << ans << endl;
      |   ^~~~
a.cc:11:3: error: expected unqualified-id before 'return'
   11 |   return 0;
      |   ^~~~~~
a.cc:12:1: error: expected declaration before '}' token
   12 | }
      | ^
Language: C++

#include<iostream>
#include<alrorithm>
using namespace std;
int main(){
  int n,m,k,ans=0;
  int a[33];
  bool isa[33];
  for(int i=0; i<33; i++){
    isa[i]=false;
  }
  
  cin>>n>>m;
  cin>>k;
  for(int i=0; i<k; i++){
    cin>>a;
    isa[a]=true;
  }
  for(int i=1; i<n; i++){
    cin>>k;
    for(int j=0; j<k; j++){
      cin >> a[j];
    }
    sort(a,a+k);
    for(int j=0,h=0; j<k; j++){
      for(int g=h; g<a[j]; g++){
        isa[g]=false;
      }
      if(isa[a[j]]){
        h=a[j]+1;
      }else{
        h=a[j];
      }
      if(j==k-1){
        for(int g=h; g<=m; g++){
          isa[g]=false;
        }
      }
    }
  }
  for(int i=1; i<=m; i++){
    if(isa[i])ans++;
  }
  cout<<ans<<endl;
  return 0;
}
        

Compiler output:
a.cc:2:9: fatal error: alrorithm: No such file or directory
    2 | #include<alrorithm>
      |         ^~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>

using namespace std;

void main()
{
  int n,m;
  cin >> n >> m;
  vector<int> K(n);
  vector<int> memo(m,0);
  for(int i=0; i<n; i++)
  {
    cin >> K[i];
    for(int j=0; j<K[i]; j++)
    {
      int a;
      cin >> a;
      memo[a]++;
    }
  }
  int count = 0;
  for(int i=0; i<m; i++)
  {
    if(memo[i] == n)
    {
      count++;
    }
  }
  cout << count << endl;
  
  return 0;
}


Compiler output:
a.cc:6:1: error: '::main' must return 'int'
    6 | void main()
      | ^~~~
Language: C

#include <stdio.h>

#define MAX 30

int N;
int M;
int K[MAX];
int A[MAX][MAX];

void input(void) {
    int i, j;
    scanf("%d%d", &N. &M);
    for (i=0;i<N;i++) {
        scanf("%d", K[i]);
        for (j=0; j<K[i]; j++){
            scanf("%d", A[i][j]);
        }
    }
}

int process(void){
    int i, j, k;
    int sum, count;

    sum = 0;
    for (i=1; i<=M; i++){
        count = 0;
        for (j=0; j<N; j++) {
            for (k=0; k<K[j]; k++) {
                if (A[i][j]==i) {
                    count++;
                }
            }
        }
        if (count==N) {
            sum++;
        }
    }
    return sum;
}



int main(void) {
    input();
    printf("%d", process());
    return 0;
}

Compiler output:
main.c: In function 'input':
main.c:12:23: error: expected identifier before '&' token
   12 |     scanf("%d%d", &N. &M);
      |                       ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N,M;
  cin >> N >> M;
  int K[N+10]=0;
  int A[N+10][30]=0;
  for(int i=1; i<=N; ++i){
    cin >> K[i];
    for(int j=1; j<=K[i]; ++j){
      cin >> A[i][j];
    }
  }
  int count[N+10]=0;
  for(int i=1; i<=N; ++i){
    for(int j=1; j<=K[i]; ++j){
      count[A[i][j]] +=1;
    }
  }
  int ans=0;
  for(int i=1; i<=M; ++i){
    if(count[i]==N) ans += 1;
  }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: array must be initialized with a brace-enclosed initializer
    7 |   int K[N+10]=0;
      |               ^
a.cc:8:19: error: array must be initialized with a brace-enclosed initializer
    8 |   int A[N+10][30]=0;
      |                   ^
a.cc:15:19: error: array must be initialized with a brace-enclosed initializer
   15 |   int count[N+10]=0;
      |                   ^
Language: Java

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.Arrays;

public class FoodsLovedByEveryone {
    
    public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] p = br.readLine().split("[\\s]+");
		int n = Integer.parseInt(p[0]);
		int m = Integer.parseInt(p[1]);
		int[] c = new int[m];
		for (int i=0;i<n;i++) {
	    	int[] ka = Arrays.stream(br.readLine().split("[\\s]+"))
				.mapToInt(Integer::parseInt).sorted().toArray();
	    	for (int j=1;j<ka.length;j++) c[ka[j]-1]++;
		}
		int ans = 0;
		for (int i=0;i<m;i++) if (c[i] == n) ans++;
		System.out.println(ans);
    }

}

Compiler output:
Main.java:6: error: class FoodsLovedByEveryone is public, should be declared in a file named FoodsLovedByEveryone.java
public class FoodsLovedByEveryone {
       ^
1 error
Language: C++

N, M = map(int, input().split())
tab = []
for i in range(N):
    tab.append([int(x) for x in input().split()])

set_ = [set(tab[i][1:]) for i in range(N)]
for i in range(N):
    if i==0:
        new_set = set_[i]
    if i == N:
        break
    new_set = new_set & set_[i]

print(len(new_set))
    

Compiler output:
a.cc:1:1: error: 'N' does not name a type
    1 | N, M = map(int, input().split())
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
  // ここにプログラム
  int n, m;
  cin >> n >> m;
  vector<int> menu(m, 0);
  int k, tem;
  for(int i = 0; i < n; i++) {
    cin >> k;
    int j = 0;
    while(true) {
      if(j < k) {
        cin >> tem;
        menu.at(tem - 1)++;
        j++;
      }
      else {
        break;
      }
    }
  }
  ans = 0;
  for(int i = 0; i < m; i++) {
    if(menu.at(i) == n) {
      ans++;
    }
  }
  cout <<ans << endl;

  
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   24 |   ans = 0;
      |   ^~~
      |   abs
Language: C++

//encoding:utf-8
#include <iostream> //c++
#include<time.h> //時間にかんして
#include<stack> //スタックに関して　最新のデータから捨てる
#include<queue> //キューに関して　最古のデータから捨てる
#include<math.h>
#include<vector>
#include<algorithm> //sort とかにいる

#define ll long long
using namespace std;

int n,m;
int N_MAX=30,M_MAX=30;
int k;
int a[31][31];
int memo[31];


int main(){
  cin>>n>>m;
  memset(a,0,sizeof(a));
  memset(memo,0,sizeof(memo));
  for(int i=0;i<n;i++){
    cin>>k;
    for(int j=0;j<k;j++){
      cin>>a[i][j];
    }
  }
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      if(a[i][j]!=0){
        memo[a[i][j]]++;
      }
    }
  }
  int ans=0;
  for(int i=0;i<31;i++){
    if(memo[i]==n){
      ans++;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:3: error: 'memset' was not declared in this scope
   22 |   memset(a,0,sizeof(a));
      |   ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<algorithm> //sort とかにいる
  +++ |+#include <cstring>
    9 |
Language: C++

#include <iostream>
using namespace std;

int main()
{
    int N,M;//人数N,種類M
    cin >> N >> M;

    int food[100];
    memset(food, 0, sizeof(food));
    int tmp,f_tmp;

    for (int i=0; i<N; i++){
        cin >> tmp;
        for (int j=0; j<tmp; j++){
            cin >> f_tmp;
            food[f_tmp]++;
        }
    }
    int count=0;
    for (int i=0; i<100; i++){
        if(food[i]==N){
            count++;
        }
    }
    cout << count;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'memset' was not declared in this scope
   10 |     memset(food, 0, sizeof(food));
      |     ^~~~~~
a.cc:2:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | using namespace std;
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)


int N,M;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	cin >> N >> M;


	vector<vector<int>> A;

	vector<bool> f(M,true);

	REP(i,N){
		int k
		cin >> k;

		vector<bool> b(M,false);
		REP(j,k){
			int temp;
			cin >> temp;
			b[temp - 1] = true;
		}

		REP(j,M){
			if(!b[j]){
				f[j] = false;
			}
		}


	}

	int ans = 0;
	REP(i,M){
		if(f[i]) ans++;
	}

	cout << ans << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: expected initializer before 'cin'
   22 |                 cin >> k;
      |                 ^~~
a.cc:25:23: error: 'k' was not declared in this scope
   25 |                 REP(j,k){
      |                       ^
a.cc:3:37: note: in definition of macro 'FOR'
    3 | #define FOR(i,a,b) for(int i=(a);i<(b);++i)
      |                                     ^
a.cc:25:17: note: in expansion of macro 'REP'
   25 |                 REP(j,k){
      |                 ^~~
Language: C++

#include<iostream>
#include <string>
#include<algorithm>
#include <set>
#include <cmath>
using namespace std;

int main(void) {
	ios::sync_with_stdio(false);
	int N, M, i, j, K, re;
	cin >> N >> M;
	int A_count[M],A[M];
	for (i = 0; i < M; i++) {
		A_count[i] = 0;
	}
	for (i = 0; i < N; i++) {
		cin >> K;
		for (j = 0; j < K; j++) {
			cin >> A[j];
			A_count[A[j] - 1] += 1;
			
		}
	}
	k = 0;
	for (i = 0; i < M; i++) {
		if (A_count[i] == M) re += 1;
	}
	cout << re;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:9: error: 'k' was not declared in this scope
   24 |         k = 0;
      |         ^
Language: C++

// need
#include <iostream>
#include <algorithm>
// data structure
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
//#include <deque>
#include <valarray>
#include <unordered_map>
#include <array>
// stream
//#include <istream>
#include <sstream>
//#include <ostream>
#include <fstream>
// etc
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
//#include <chrono>
#include <random>
#include <numeric>
using namespace std;
 
int main()
{
  int n,m,tmp,tmp2;
  int count = 0;
  cin >> n >> m;
  int a[m];
  for(int i = 0; i < n; i++){
	cin >> tmp;
    for(int j = 0; j < tmp; j++){
      cin >> tmp2;
      a[tmp2-1]++;
    }
  }

  for(int i = 0; i < m; i++){
    if(a[i] == n)
      count++;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:50:4: error: expected '}' at end of input
   50 |   }
      |    ^
a.cc:34:1: note: to match this '{'
   34 | {
      | ^
Language: C++

#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;

#define ll long long
#define pb push_back

int main(){

	int N, M;
	int arr[35];
	for(int i = 0; i < 35; i ++){
		arr[i] = 0;
	}

	cin >> N >> M;
	for(int i = 0; i < N; i ++){
		int m;
		cin >> m;
		for(int j = 0; j < m; j ++){
			int a;
			cin >> a;
			arr[a]++;
		}
	}
	int ans = 0;
	for(int i = 1; i <= M; i ++){
		if(a[i] == N)ans++;
	}
	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:34:20: error: 'a' was not declared in this scope
   34 |                 if(a[i] == N)ans++;
      |                    ^
Language: C++

/*
ID: seekho
PROG: friday
LANG: C++14                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!

// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(998244353)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long

//////////////////////
// const int N = 100005;

int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);

    int n,m;
    cin >> n >> m;

    vectpr<int> cnt(m,0);

    int in1;
    rep(i,n) {
        cin >> in1;
        int te;
        while(in1--) {
            cin >> te;te--;
            cnt[te]++;
        }
    }
    int cc = 0;
    rep(i,m) {
        if(cnt[i] == n) cc++;
    }
    cout << cc << "\n";
}

Compiler output:
a.cc: In function 'int32_t main()':
a.cc:57:5: error: 'vectpr' was not declared in this scope
   57 |     vectpr<int> cnt(m,0);
      |     ^~~~~~
a.cc:43:13: error: expected primary-expression before 'long'
   43 | #define int long long
      |             ^~~~
a.cc:57:12: note: in expansion of macro 'int'
   57 |     vectpr<int> cnt(m,0);
      |            ^~~
a.cc:65:13: error: 'cnt' was not declared in this scope; did you mean 'int'?
   65 |             cnt[te]++;
      |             ^~~
      |             int
a.cc:70:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   70 |         if(cnt[i] == n) cc++;
      |            ^~~
      |            int
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <math.h>
#include <array>
#include <list>
#include <set>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vp;
set<char> st;
string s;
int n,m,k;
int food[35];
int ans=0;
int main(int argc,char const* argv[])
{
  cin >> n >> m;
  memset(food,0,sizeof(food));
  for(int i=0;i<n;i++)
    {
      cin >> k;
      for(int j=0;j<k;j++)
	{
	  int a;
	  cin >> a;
	  a--;
	  food[a]++;
	}
    }
  for(int i=0;i<m;i++)
    {
      if(food[i]==n)
	{
	  ans++;
	}
    }
  cout << ans << endl;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:27:3: error: 'memset' was not declared in this scope
   27 |   memset(food,0,sizeof(food));
      |   ^~~~~~
a.cc:11:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   10 | #include <list>
  +++ |+#include <cstring>
   11 | #include <set>
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  int ans=0;
  for(int i=0;i<=n;i++)
    cin>>a[i];
  ans=__gcd(ans,a[i]);
    cout<<ans<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: 'i' was not declared in this scope
   11 |   ans=__gcd(ans,a[i]);
      |                   ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (long long i = 0; i < (long long) (n); i++)
#define Rep(i,n,m) for (long long i = n; i < (long long) (m); i++)
using ll=long long;
using vi = vector<int>;
using vll = vector<ll>;

const int mod = 1000000007;
// const int mod = 998244353;

int main(){
    long long n;
    cin>>n;
    vll vec(n);
    rep(i,n){cin>>vec(i-1);}
    sort(vec.begin(), vec.end());
    vll v2(0);
    rep(i,n-1){
      Rep(j,i+1,n){
      ll k;
      k=vec(j)%vec(i);
      v2.push_back(k);
    }
    }
    sort(v2.begin(),v2.end());
    ll o;=0
rep(i,v2.size()){
  if(v2.(i)!=0){o=v2.(i);break;}
}
if (o==0){cout<<vec(0);}
else{cout<<o;}



}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:22: error: no match for call to '(vll {aka std::vector<long long int>}) (long long int)'
   16 |     rep(i,n){cin>>vec(i-1);}
      |                   ~~~^~~~~
a.cc:22:12: error: no match for call to '(vll {aka std::vector<long long int>}) (long long int&)'
   22 |       k=vec(j)%vec(i);
      |         ~~~^~~
a.cc:22:19: error: no match for call to '(vll {aka std::vector<long long int>}) (long long int&)'
   22 |       k=vec(j)%vec(i);
      |                ~~~^~~
a.cc:27:10: error: expected primary-expression before '=' token
   27 |     ll o;=0
      |          ^
a.cc:28:5: error: 'i' was not declared in this scope
   28 | rep(i,v2.size()){
      |     ^
a.cc:3:40: note: in definition of macro 'rep'
    3 | #define rep(i,n) for (long long i = 0; i < (long long) (n); i++)
      |                                        ^
a.cc:31:20: error: no match for call to '(vll {aka std::vector<long long int>}) (int)'
   31 | if (o==0){cout<<vec(0);}
      |                 ~~~^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
  cin >>n;
  
  vector<long int> a(n);
  long int ans;
  cin >>a.at(0);
  for(i=1;i<n;++i)
  {
  cin >> a.at(i); 
  ans=gcd(a.at(i-1),a.at(i));
  }
  cout << ans;
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:7: error: 'i' was not declared in this scope
   11 |   for(i=1;i<n;++i)
      |       ^
Language: C

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}

int main()
{
    ll N;
    cin >> N;
    vector<ll> A(N,0);
    for(ll i=0;i<N;i++)
    {
        cin>>A[i];
    }
    ll res=A[0];
    for(ll i=0;i<N;i++)
    {
        res=GCD(A[i],res);
    }
    cout<<res; 
    return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

ll gcd(ll a, ll b) {
    if(a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}



int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; i++) cin >> A[i];
    ll Y = 1e10;
    for(int i=0; i<N-1; i++) {
        Y = min(Y, gcd(A[i], A[i+1]));
    }
    cout << Y << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: no matching function for call to 'min(ll&, std::common_type_t<int, int>)'
   23 |         Y = min(Y, gcd(A[i], A[i+1]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:23:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::common_type_t<int, int>' {aka 'int'})
   23 |         Y = min(Y, gcd(A[i], A[i+1]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:23:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |         Y = min(Y, gcd(A[i], A[i+1]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;

ll gcd(ll a, ll b) {
    if(a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}



int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; i++) cin >> A[i];
    ll Y = INF;
    for(int i=0; i<N-1; i++) {
        Y = min(Y, gcd(A[i], A[i+1]));
    }
    cout << Y << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:16: error: no matching function for call to 'min(ll&, std::common_type_t<int, int>)'
   23 |         Y = min(Y, gcd(A[i], A[i+1]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:23:16: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'std::common_type_t<int, int>' {aka 'int'})
   23 |         Y = min(Y, gcd(A[i], A[i+1]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:23:16: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   23 |         Y = min(Y, gcd(A[i], A[i+1]));
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~