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

# include < bits / stdc ++. h >
using namespace std ;
int main () {
int N , M ; cin >> N >> M ;
vector<int> cnt(M,0);
for (int i = 0; i < N ; ++i ) {
  int K; cin >> K ;
  for ( int j = 0; j < K ; ++j ) {
    int A; cin >> A ; --A ;
    ++ cnt[A];
  }
}
  int ans = 0;
  for (int i = 0; i < M ; ++i) {
    if ( cnt[i] == N ) {
      ++ans ;
    }
  }
  cout << ans << endl ;
}

Compiler output:
a.cc:1:11: 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 ;
int main () {
int N , M ; cin >> N >> M ;
vector <int> cnt (M,0);
for (int i = 0; i < N ; ++i ) {
  int K; cin >> K ;
  for ( int j = 0; j < K ; ++j ) {
    int A; cin >> A ; --A ;
    ++ cnt[A];
  }
}
  int ans = 0;
  for (int i = 0; i < M ; ++i) {
    if ( cnt[i] == N ) {
      ++ans ;
    }
  }
  cout << ans << endl ;
}

Compiler output:
a.cc:1:11: 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 ;
int main () {
int N , M ; cin >> N >> M ;
vector <int> cnt (M , 0);
for ( int i = 0; i < N ; ++ i ) {
  int K; cin >> K ;
  for ( int j = 0; j < K ; ++ j ) {
    int A; cin >> A ; --A ;
    ++ cnt [A];
  }
}
  int ans = 0;
  for ( int i = 0; i < M ; ++ i ) {
    if ( cnt [i] == N ) {
      ++ ans ;
    }
  }
  cout << ans << endl ;
}

Compiler output:
a.cc:1:11: 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 ;
int main () {
int N , M ; cin >> N >> M ;
vector <int > cnt (M , 0);
for ( int i = 0; i < N ; ++ i ) {
  int K; cin >> K ;
  for ( int j = 0; j < K ; ++ j ) {
    int A; cin >> A ; --A ;
    ++ cnt [ A ];
  }
}
  int ans = 0;
  for ( int i = 0; i < M ; ++ i ) {
    if ( cnt [ i ] == N ) {
      ++ ans ;
    }
  }
  cout << ans << endl ;
}

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

#include<algorithm>//sort(all(変数),greater<型名>())　で降順に
#include<cmath>//切り上げceil(値)
#include<deque>
#include<iomanip>//setprecision(数字)
#include<iostream>
#include<list>
#include<map>
#include<numeric> //xとyの最大公約数は__gcd(x,y),xとyの最小公倍数は(x*y)/__gcd
#include<queue>//priority_queue<型名> 変数：優先度付きキュー　最大値の探索が早い
#include<set>
#include<stack>
#include<string>
#include<vector>

#include<bits/stdc++.h>
#include<cstdio>
#include<cstdlib>
#include<limits>
#include<tuple>
#include<utility>
#define rep0(i,n)  for(ll i=0; i<n; i++)
#define rrep0(i,n) for(ll i=n-1; 0<=i; i--)
#define rep1(i,n)  for(ll i=1; i<=n; i++)
#define rrep1(i,n) for(ll i=n; 1<=i; i--)
#define vll vector<ll>
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define INF 1e18
using ll = long long;
using namespace std;

int main(){
  int n,m;  cin >> n >> m;
  vi a(m);
  rep0(i,n){
    ll k;  cin >> k;
    rep0(j,k){
      ll a1;  cin >> a1;  ai--;
      a[a1]++;
    }
  }
  ll ans = 0;
  rep0(i,m){
    if(a[i] == n){
      ans++;
    }
  }
  cout << ans;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:27: error: 'ai' was not declared in this scope; did you mean 'a1'?
   39 |       ll a1;  cin >> a1;  ai--;
      |                           ^~
      |                           a1
Language: C++

#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int a, b ;
  cin >> a >> b ;
  
  if(b%a==0)
    cout << a+b << endl ;
  else
    cout << b-a << endl ;
  
  return 0 ;
}

////////////////////////////
//B

#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int n, m ;
  cin >> n >> m ;
  
  vector<int> kk(n) ;
  for(int i=0;i<n;i++){
    int k ;
    cin >> k ;
  for(int j=0;j<k;j++){
    int a ;
    cin >> a ;
    a-- ;
    ++kk[a] ;
  }
  }
  
  int ans = 0 ;
  
  for (int i = 0; i < m; i++) {
    if (kk[i] == n) {
      ++ans;
    }
  }
  cout << ans << endl;
  

  return 0 ;
}


Compiler output:
a.cc:25:5: error: redefinition of 'int main()'
   25 | int main()
      |     ^~~~
a.cc:5:5: note: 'int main()' previously defined here
    5 | int main()
      |     ^~~~
Language: C++

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

int main() {
    int N, M, K, a, ans = 0;
    cin >> N >> M;
    vector<vector<bool>> S(N, vector<bool>(M, false));
    for (int i = 0; i < N; i++) {
        cin >> K;
        for (int i = 0; i < K; i++) {
            cin >> a;
            S.at(i).at(b - 1) = true;
        }
    }
    for (int i = 0; i < M; i++) {
        for (int j = 0; j < N; j++) {
            if (S.at(j).at(i) == false) {
                continue;
            }
            if (j == N - 1) {
                ans++;
            }
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:24: error: 'b' was not declared in this scope
   12 |             S.at(i).at(b - 1) = true;
      |                        ^
Language: Java

import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();//メニューの数
    int p = 0;
    int q = 0;
    int aa = (1<<m) - 1; //2^m-1
    int bb = 0;
    //System.out.println(aa);

    for(int i=0; i<n; i++){
      int lo = sc.nextInt();
      for(int k=0; k<lo; k++){
        p = sc.nextInt();
        q =  q + (int)Math.pow(2,p);
      }
      if(i==0){
        bb = q & aa;
      }else{
        bb = bb & q;
      }

      q =0;

    }
    Integer.bitCount(bb); //ビットの１をカウント
    System.out.println(Integer.bitCount(bb));

Compiler output:
Main.java:30: error: reached end of file while parsing
    System.out.println(Integer.bitCount(bb));
                                             ^
1 error
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

using namespace std;

int main()
{
  int a, b,
  int arr[30][30];
  int likefood[30];
  int i, j;
  int count = 0;
  
  cin >> a >> b;
  
  for(i = 0; i < a; i++){
    for(j = 0; j < b; j++){
      if(j == 0){
        cin >> arr[i][j];
      }else if(i <= arr[i][0]){
        cin >> arr[i][j];
      }
      likefood[j] = 0;
    }
  }
  
  for(i = 0; i < a; i++){
    for(j = 0; j <= arr[i][0]; j++){
      likefood[arr[i][j]]++;
    }
  }
  
  for(i = 0; i < b; i++){
    if(likefood[i] == a){
      count++;
    }
  }
  cout << count << endl;
  
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: expected unqualified-id before 'int'
   19 |   int arr[30][30];
      |   ^~~
a.cc:29:16: error: 'arr' was not declared in this scope
   29 |         cin >> arr[i][j];
      |                ^~~
a.cc:30:21: error: 'arr' was not declared in this scope
   30 |       }else if(i <= arr[i][0]){
      |                     ^~~
a.cc:38:21: error: 'arr' was not declared in this scope
   38 |     for(j = 0; j <= arr[i][0]; j++){
      |                     ^~~
Language: C++

#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <set>
#include <map>

using namespace std;

int main()
{
  int a, b,
  int arr[30][30];
  int likefood[30];
  int i, j;
  int count = 0;
  
  cin >> a >> b;
  
  for(i = 0; i < a; i++){
    for(j = 0; j < b; j++){
      if(j == 0){
        cin >> arr[i][j];
      }else if(i <= arr[i][0]){
        cin >> arr[i][j];
      }
      likefood[j] = 0;
    }
  }
  
  for(i = 0; i < a; i++){
    for(j = 0; j <= arr[i][0]; j++){
      likefood[arr[i][j]]++;
    }
  }
  
  for(i = 0; i < b; i++){
    if(likefood[i] == a){
      count++;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:3: error: expected unqualified-id before 'int'
   19 |   int arr[30][30];
      |   ^~~
a.cc:29:16: error: 'arr' was not declared in this scope
   29 |         cin >> arr[i][j];
      |                ^~~
a.cc:30:21: error: 'arr' was not declared in this scope
   30 |       }else if(i <= arr[i][0]){
      |                     ^~~
a.cc:38:21: error: 'arr' was not declared in this scope
   38 |     for(j = 0; j <= arr[i][0]; j++){
      |                     ^~~
Language: C++

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

int main()
{
  int a, b,
  int arr[30][30];
  int likefood[30];
  int i, j;
  int count = 0;
  
  cin >> a >> b;
  
  for(i = 0; i < a; i++){
    for(j = 0; j < b; j++){
      if(j == 0){
        cin >> arr[i][j];
      }else if(i <= arr[i][0]){
        cin >> arr[i][j];
      }
      likefood[j] = 0;
    }
  }
  
  for(i = 0; i < a; i++){
    for(j = 0; j <= arr[i][0]; j++){
      likefood[arr[i][j]]++;
    }
  }
  
  for(i = 0; i < b; i++){
    if(likefood[i] == a){
      count++;
    }
  }
  cout << count << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected unqualified-id before 'int'
    8 |   int arr[30][30];
      |   ^~~
a.cc:18:16: error: 'arr' was not declared in this scope
   18 |         cin >> arr[i][j];
      |                ^~~
a.cc:19:21: error: 'arr' was not declared in this scope
   19 |       }else if(i <= arr[i][0]){
      |                     ^~~
a.cc:27:21: error: 'arr' was not declared in this scope
   27 |     for(j = 0; j <= arr[i][0]; j++){
      |                     ^~~
Language: C++

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

int main()
{
  int a, b,
  int arr[30][30];
  int likefood[30];
  int i, j;
  int count = 0;
  
  cin >> a >> b;
  
  for(i = 0; i < a; i++){
    for(j = 0; j < b; j++){
      if(j == 0){
        cin >> arr[i][j];
      }else if(i <= arr[i][0]){
        cin >> arr[i][j];
      }
      likefood[j] = 0;
    }
  }
  
  for(i = 0; i < a; i++){
    for(j = 0; j <= arr[i][0]; j++){
      likefood[arr[i][j]]++;
    }
  }
  
  for(i = 0; i < b; i++){
    if(likefood[i] == a){
      count++;
    }
  }
  
  cout << count << endl;
  
  

      
      
  
  

}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:3: error: expected unqualified-id before 'int'
    8 |   int arr[30][30];
      |   ^~~
a.cc:18:16: error: 'arr' was not declared in this scope
   18 |         cin >> arr[i][j];
      |                ^~~
a.cc:19:21: error: 'arr' was not declared in this scope
   19 |       }else if(i <= arr[i][0]){
      |                     ^~~
a.cc:27:21: error: 'arr' was not declared in this scope
   27 |     for(j = 0; j <= arr[i][0]; j++){
      |                     ^~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int N,M;cin>>N>>M;
  vector<int>cnt(M,0);
  for (int i=0;i<N;++i){
    int K;cin>>K;
    for (int j=0;j<K;++j){
      int A[K];cin>>A[j];--A[j];
      ++cnt[A[j]];
    }
  }
  int ans=0;
  for (int i=0;i<M;++i){
    if (cnt[i]==N)++ans
  }
  cout<<ans<<endl;
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:16:24: error: expected ';' before '}' token
   16 |     if (cnt[i]==N)++ans
      |                        ^
      |                        ;
   17 |   }
      |   ~
Language: C++

#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using Graph = vector < vector<int>>;
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;
 
}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
 
	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
 
int main() {
	int N, M;
	cin >> N >> M;
	int s[31][32];
	for (int i = 0; i < N; i++) {
		int k = 0;
		cin >> k;
		for (int j = 0; j < k; j++) {
			int b;
			cin >> b;
			s[i][b] = 1;
		}
	}
	int ans = 0;
	for (int i = 1; i <= M; i++) {
		for (int j = 0; j < N; j++) {
			if (s[j][i] != 1) {
				break;
			}
			if (j == N - 1) {
				ans++;
			}
		}
	}
	cout << ans;
}

Compiler output:
a.cc:3:9: error: 'pair' does not name a type
    3 | typedef pair<int, int> P;
      |         ^~~~
a.cc:6:15: error: 'vector' does not name a type
    6 | using Graph = vector < vector<int>>;
      |               ^~~~~~
a.cc: In function 'int main()':
a.cc:38:9: error: 'cin' was not declared in this scope
   38 |         cin >> N >> M;
      |         ^~~
a.cc:60:9: error: 'cout' was not declared in this scope
   60 |         cout << ans;
      |         ^~~~
Language: C++

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

int main(){
  int N,M;
  cin >>N>>M;
  
  int K,A;
  rep(i,0,N){
    cin >>K;
    rep(i,0,K){
      cin >>A;
      mp[A]++;
    }
  }
  
  int ans = 0;
  rep(i,0,M) if(mp[i]==N) ans++;
  
  cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: 'mp' was not declared in this scope
   14 |       mp[A]++;
      |       ^~
a.cc:19:17: error: 'mp' was not declared in this scope
   19 |   rep(i,0,M) if(mp[i]==N) ans++;
      |                 ^~
Language: Java

function Main(input) {
	input = input.trim();
  var N = parseInt(input.split("\n")[0].split(" ")[0]);
  var M = parseInt(input.split("\n")[0].split(" ")[1]);
  var list = [];
  for(var i = 1; i <= N; i++){
    var tmp = input.split("\n")[i].split(" ");
    if(i == 1){
   	 for(var j = 1; j <= parseInt(tmp[0]); j++){
   	   list.push(tmp[j]);
   	 }
  	}else{
      tmp.shift();
      for(var j = 0; j < list.length; j++){
        if(tmp.indexOf(list[j]) == -1){
           list.splice(list.indexOf(list[j]),1);
          j--;
        }
      }
    }
  }
  console.log(list.length);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
function Main(input) {
^
  (use --enable-preview to enable unnamed classes)
Main.java:1: error: <identifier> expected
function Main(input) {
                   ^
Main.java:5: error: illegal start of expression
  var list = [];
             ^
Main.java:25: error: class, interface, enum, or record expected
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
^
4 errors
Language: C++

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

int main() {
  int n, m, i, s = 0;
  cin >> n >> m;
  set<int> s[i];
  for (i = 0; i < n; i++){
    int k;
    cin >> k;
    for (int j = 0; j < k; j++){
      int a;
      cin >> a;
      s[i].insert(a);
    }
  }
  for(int j = 0; j < m; j++){
    bool b = 1;
    for(i = 0; i < n; i++){
      if(s[i].count(j)){}
      else{
        b = 0;
        break;
      }
    }
    if(b)
      s++;
  }
  cout << s << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: conflicting declaration 'std::set<int> s [i]'
    7 |   set<int> s[i];
      |            ^
a.cc:5:16: note: previous declaration as 'int s'
    5 |   int n, m, i, s = 0;
      |                ^
a.cc:14:8: error: invalid types 'int[int]' for array subscript
   14 |       s[i].insert(a);
      |        ^
a.cc:20:11: error: invalid types 'int[int]' for array subscript
   20 |       if(s[i].count(j)){}
      |           ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define fs first
#define sc second
typedef pair<ll, ll> l_l;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
int main(){
  int n,m;
  cin>>n>>m;
  vector<int>cnt(m,0);
  for(int i=0;i<n;i++){
    int k[n];
    cin>>k[i];
    for(int j=0;j<k[i];j++){
      int a;
      cin>>a
      a--;
      cnt[a]++;
    }
  }
  int ans=0;
  rep(i,m)
  if(cnt[i]==n)ans++;
  cout<<ans<<endl;
  }

Compiler output:
a.cc: In function 'int main()':
a.cc:21:13: error: expected ';' before 'a'
   21 |       cin>>a
      |             ^
      |             ;
   22 |       a--;
      |       ~
Language: Java

public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = Integer.parseInt(scanner.next());
    int M = Integer.parseInt(scanner.next());
    
    ArrayList<Integer> answer = new ArrayList<Integer>();
    for(int i=0;i<=M;i++){
      answer.add(0);
    }
    
    for(int i=0;i<N;i++){
      int A = Integer.parseInt(scanner.next());
      for(int j=0;j<A;j++){
      	int input = Integer.parseInt(scanner.next());
      	int pre = answer.get(input);
       	answer.set(input, pre + 1);
      }
    }
    int ans = 0;
    for(int i=1;i<=M;i++){
    	System.out.println(answer.get(i));
      if(answer.get(i) == N)
        ans++;
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:3: error: cannot find symbol
    Scanner scanner = new Scanner(System.in);
    ^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
    Scanner scanner = new Scanner(System.in);
                          ^
  symbol:   class Scanner
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<Integer> answer = new ArrayList<Integer>();
    ^
  symbol:   class ArrayList
  location: class Main
Main.java:7: error: cannot find symbol
    ArrayList<Integer> answer = new ArrayList<Integer>();
                                    ^
  symbol:   class ArrayList
  location: class Main
4 errors
Language: Java

import java.util.Scanner;
import java.util.ArrayList;

public class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = Integer.parseInt(scanner.next());
    int M = Integer.parseInt(scanner.next());
    
    ArrayList<Integer> answer = new ArrayList<Integer>();
    for(int i=0;i<M;i++){
      answer.add(0);
    }
    
    for(int i=0;i<N;i++){
      int A = Integer.parseInt(scanner.next());
      for(int j=0;j<A;j++){
      	int input = Integer.parseInt(scanner.next());
       	int elem = answer.get(input);
        answer.get(input) = elem + 1;
      }
    }
    int ans = answer.get(0);
    for(int i=1;i<M;i++){
      if(ans < answer.get(i))
        ans = answer.get(i);
    }
    System.out.println(ans);
  }
}

Compiler output:
Main.java:20: error: unexpected type
        answer.get(input) = elem + 1;
                  ^
  required: variable
  found:    value
1 error
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
 
public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = Integer.parseInt(scanner.next());
    int M = Integer.parseInt(scanner.next());
    
    ArrayList<Integer> answer = new ArrayList<Integer>();
    int[] A;
    
    for(int i=0;i<N;i++){
      int K = Integer.parseInt(scanner.next());
      if(i != 0)
      	A = new int[K];
      for(int j=0;j<K;j++){
        if(i == 0){
          answer.add(Integer.parseInt(scanner.next()));
        }
        else{
          A[j] = Integer.parseInt(scanner.next());
        }
      }
      for(int k=0;k<A.length;k++){
        if(!answer.contains(A[k])){
          answer.remove(A[k]);
        }
      }
    }
    System.out.println(answer.size());
  }
}

Compiler output:
Main.java:22: error: variable A might not have been initialized
          A[j] = Integer.parseInt(scanner.next());
          ^
Main.java:25: error: variable A might not have been initialized
      for(int k=0;k<A.length;k++){
                    ^
2 errors
Language: Java

import java.util.Scanner;
import java.util.ArrayList;
 
public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = Integer.parseInt(scanner.next());
    int M = Integer.parseInt(scanner.next());
    
    ArrayList<Integer> answer = new ArrayList<Integer>();
    
    for(int i=0;i<N;i++){
      int K = Integer.parseInt(scanner.next());
      if(i != 0){
      	int[] A;
        A = new int[K];
      }
      for(int j=0;j<K;j++){
        if(i == 0){
          answer.add(Integer.parseInt(scanner.next()));
        }
        else{
          A[j] = Integer.parseInt(scanner.next());
        }
      }
      for(int k=0;k<A.length;k++){
        if(!answer.contains(A[k])){
          answer.remove(A[k]);
        }
      }
    }
    System.out.println(answer.size());
  }
}

Compiler output:
Main.java:23: error: cannot find symbol
          A[j] = Integer.parseInt(scanner.next());
          ^
  symbol:   variable A
  location: class Main
Main.java:26: error: cannot find symbol
      for(int k=0;k<A.length;k++){
                    ^
  symbol:   variable A
  location: class Main
Main.java:27: error: cannot find symbol
        if(!answer.contains(A[k])){
                            ^
  symbol:   variable A
  location: class Main
Main.java:28: error: cannot find symbol
          answer.remove(A[k]);
                        ^
  symbol:   variable A
  location: class Main
4 errors
Language: Java

import java.util.Scanner;
import java.util.ArrayList;

public class Main {
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N = Integer.parseInt(scanner.next());
    int M = Integer.parseInt(scanner.next());
    
    ArrayList<Integer> answer = new ArrayList<Integer>();
    
    for(int i=0;i<N;i++){
      int K = Integer.parseInt(scanner.next());
      if(i != 0)
      	int[] A = new int[K];
      for(int j=0;j<K;j++){
        if(i == 0){
          answer.add(Integer.parseInt(scanner.next()));
        }
        else{
          A[j] = Integer.parseInt(scanner.next());
        }
      }
      for(int k=0;k<A.length;k++){
        if(!answer.contains(A[k])){
          answer.remove(A[k]);
        }
      }
    }
    System.out.println(answer.size());
  }
}

Compiler output:
Main.java:15: error: variable declaration not allowed here
      	int[] A = new int[K];
      	      ^
1 error
Language: C++

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

int main(){
  int N,M;
  cin >> N >> M;
  vector<vector<bool>> match(N,vector<bool>(M,0));
  int k,m;
  for(int i = 0; i < N; ++i){
    cin >> k;
    for(int j = 0; j < k; ++j){
      cin >> m;
      match.at(i).at(m) = 1;
    }
  }
  bool like;
  int num;
  for(int i = 0; i < M; ++i){
    like = 1;
    for(int j = 0; j < N; ++j){
      like *= match.at(j).at(i)
    }
    num += like;
  }
  cout << num << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:32: error: expected ';' before '}' token
   21 |       like *= match.at(j).at(i)
      |                                ^
      |                                ;
   22 |     }
      |     ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main(){
int a,b,e;
  cin>>a>>b;
  vector<int> d(b,0);
  for(int i=0;i<a-1;i++){
    cin>>e;
for(int j=0;j<e;j++){
  cin>>f;
  d.at(f-1)++;
}
  }
  int k=0;
  for(int i=0;i<b;i++){
    if(d.at(i)==a)
      k++;
  }
  cout<<k<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'f' was not declared in this scope
   11 |   cin>>f;
      |        ^
Language: C++


using namespace std;

int main(){
  int n,m,s=0; cin>>n>>m;
  int a[m]={};
  
  for(int i=0;i<n;i++){
    int k; cin>>k;
    for(int j=0;j<k;k++){
      int c; cin>>c;
      a[c-1] += 1;
    }
  }
  
  for(int l=0;l<m;l++){
    if(a[l]==n) s +=1;
  }
  
  cout<<s<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: 'cin' was not declared in this scope
    5 |   int n,m,s=0; cin>>n>>m;
      |                ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:20:3: error: 'cout' was not declared in this scope
   20 |   cout<<s<<endl;
      |   ^~~~
a.cc:20:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:20:12: error: 'endl' was not declared in this scope
   20 |   cout<<s<<endl;
      |            ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

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

int main(){
  int n,m,s=0; cin>>n>>m;
  int a[m+1]={};
  
  for(int i=0;i<n;i++){
    int k; cin>>k;
    for(int j=0;j<k;k++){
      int c; cin>>c;
      a[c] += 1;
    }
  }
  
  for(int l=0;l<m+1;l++){
    if(a[l]==n) s +=1;
  }
  
  cout<<s<<endl;
  return 0;
}

Compiler output:
a.cc:1:11: 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;
int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<bool>> ok(N, vector<bool>(M));
    for(int i = 0; i < N; i++) {
        int k;
        cin >> k;
        for(int j = 0; j < k; j++) {
            int a;
            cin >> a;
            a--;
            ok.at(i).at(a) = true;
        }
    }
    
    int ans = 0;
    for(int i = 0; i < M; i++) {
        bool x = true;
        for(int j = 0; j < N; j++) {
            if(!ok.at(j).at(i)) x = false;
        }
        if(x) ans++;
    }
    
    cout << ans << endl;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <bits/stdc++.h>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> N >> M;
      |     ^~~
a.cc:6:5: error: 'vector' was not declared in this scope
    6 |     vector<vector<bool>> ok(N, vector<bool>(M));
      |     ^~~~~~
a.cc:6:19: error: expected primary-expression before 'bool'
    6 |     vector<vector<bool>> ok(N, vector<bool>(M));
      |                   ^~~~
a.cc:14:13: error: 'ok' was not declared in this scope; did you mean 'k'?
   14 |             ok.at(i).at(a) = true;
      |             ^~
      |             k
a.cc:22:17: error: 'ok' was not declared in this scope
   22 |             if(!ok.at(j).at(i)) x = false;
      |                 ^~
a.cc:27:5: error: 'cout' was not declared in this scope
   27 |     cout << ans << endl;
      |     ^~~~
a.cc:27:20: error: 'endl' was not declared in this scope
   27 |     cout << ans << endl;
      |                    ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(){
  int n,m,ans=0;
  cin >> n >> m;
  int a[n][m],k[n];
  for(int i=0; i<n; i++){
    cin >> k[i];
    for(int j=0; j<m;j++){
      cin >> a[i][j];
    }}
  for(int c=0; c<k[0]; c++){
   int counter=0;
   for(int i=1;i<n;i++)
     for(int j=0;j<m;j++)
       if(a[0][j]==a[i][j]) counter++;
   if(counter==n) ans++;
  }
  cout << counter;
  return 0;
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:11: error: 'counter' was not declared in this scope
   19 |   cout << counter;
      |           ^~~~~~~
a.cc:20:12: error: expected '}' at end of input
   20 |   return 0;
      |            ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C++

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

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

}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:13: error: expected ';' before 'a'
   13 |       cin>>a
      |             ^
      |             ;
   14 |       a--;
      |       ~
Language: C++



    
  

using namespace std;
int main(){
  
  int N,M;
  
  cin>>N>>M;
  
  vector<int>A(M);
  vector<int>sum(M);
  
  for(int i=0;i<N;i++){
    
    for(int j=0;j<N;j++){
    cin>>A.at(j);
      
      for(int k=0;k<M;k++){
        if(k+1==A.at(j)){
          sum.at(k+1)++;
        }
      }
    }
  }
  
  int answer=0;
  
  for(int i=0;i<M;i++){
    if(sum.at(i)==N){
      answer++;
      
    }
  }
  cout<<answer<<endl;
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'cin' was not declared in this scope
   11 |   cin>>N>>M;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:13:3: error: 'vector' was not declared in this scope
   13 |   vector<int>A(M);
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | 
a.cc:13:10: error: expected primary-expression before 'int'
   13 |   vector<int>A(M);
      |          ^~~
a.cc:14:10: error: expected primary-expression before 'int'
   14 |   vector<int>sum(M);
      |          ^~~
a.cc:19:10: error: 'A' was not declared in this scope
   19 |     cin>>A.at(j);
      |          ^
a.cc:23:11: error: 'sum' was not declared in this scope
   23 |           sum.at(k+1)++;
      |           ^~~
a.cc:32:8: error: 'sum' was not declared in this scope
   32 |     if(sum.at(i)==N){
      |        ^~~
a.cc:37:3: error: 'cout' was not declared in this scope
   37 |   cout<<answer<<endl;
      |   ^~~~
a.cc:37:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:37:17: error: 'endl' was not declared in this scope
   37 |   cout<<answer<<endl;
      |                 ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

#include <iostream>

using namespace std;

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

    vector<int> cnt(M, 0);
    for(int i = 0; i < N; ++i){
        int K; cin >> K;
        for(int j = 0; j < K; ++j){
            int A; cin >> A; --A;
            ++cnt[A];
        }
    }

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

    cout << ans << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> cnt(M, 0);
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | 
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> cnt(M, 0);
      |            ^~~
a.cc:14:15: error: 'cnt' was not declared in this scope; did you mean 'int'?
   14 |             ++cnt[A];
      |               ^~~
      |               int
a.cc:20:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   20 |         if(cnt[i] == N){
      |            ^~~
      |            int
Language: C++

#include <bits/stdc++.h>

using namespace std;

long n,m,k;
static long d[31];

void Docfile()
{
  cin >> n >> m;
  for (int i=1;i<=n;i++)
  {
    long tmp;
    cin >> k;
    for (int j=1;j<=k;j++)
    {
      cin >> tmp;
      d[tmp]++;
    }
}
  
void Xuli()
{
  long dem=0;
  for (int i=1;i<=m;i++)
    if (d[i]==n)
      dem++;
  cout << dem;
}
  
int main()
{
  Docfile();
  Xuli();
}
  

Compiler output:
a.cc: In function 'void Docfile()':
a.cc:23:1: error: a function-definition is not allowed here before '{' token
   23 | {
      | ^
a.cc:31:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   31 | int main()
      |         ^~
a.cc:31:9: note: remove parentheses to default-initialize a variable
   31 | int main()
      |         ^~
      |         --
a.cc:31:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:32:1: error: a function-definition is not allowed here before '{' token
   32 | {
      | ^
a.cc:35:2: error: expected '}' at end of input
   35 | }
      |  ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {
int m,n;cin>>m>>n;
  int fav[m],ans=0;
  for(int p=0;p<m;p++) fav[p]=0;
  for(int i=0;i<n;i++)
  {
    int k;cin>>k;
    for(int j=0;j<k;j++)
      int a;cin>>a;
      fav[a-1]++;
  }
  for(int i=0;i<m;i++)
  {
    if(fav[i]==n)
    ans++;
  }
  cout<<ans<<endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: 'a' was not declared in this scope
   14 |       int a;cin>>a;
      |                  ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {
int m,n;cin>>m>>n;
  int fav[m],ans=0;
  for(int p=0;p<m;p++) cin>>fav[p];
  for(int i=0;i<n;i++)
  {
    int k;cin>>k;
    for(int j=0;j<k;j++)
      fav[j-1]++;
  }
  for(int i=0;i<n;i++)
  {
    if(fav[i]==n)
    ans++
  }
  cout<<ans<<endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:19:10: error: expected ';' before '}' token
   19 |     ans++
      |          ^
      |          ;
   20 |   }
      |   ~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {
int m,n;cin>>m>>n;
  int fav[m],ans=0;
  for(int i=0;i<m;i++) int fav[i];cin>>fav[i];
  for(int i=0;i<n;i++)
  {
    int k;cin>>k;
    for(int j=0;j<k;j++)
      fav[j-1]++;
  }
  for(int i=0;i<n;i++)
  {
    if(fav[i]==n)
    ans++
  }
  cout<<ans<<endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:9:44: error: 'i' was not declared in this scope
    9 |   for(int i=0;i<m;i++) int fav[i];cin>>fav[i];
      |                                            ^
a.cc:19:10: error: expected ';' before '}' token
   19 |     ans++
      |          ^
      |          ;
   20 |   }
      |   ~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {
int m,n;cin>>m>>n;
  int fav[m],ans=0;
  for(int i=0;i<m;i++)
    int fav[i];cin>>fav[i];
  for(int i=0;i<n;i++)
  {
    int k;cin>>k;
    for(int j=0;j<k;j++)
      fav[j-1]++;
  }
  for(int i=0;i<n;i++)
  {
    if(fav[i]==n)
    ans++
  }
  cout<<ans<<endl;
}
      


Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'i' was not declared in this scope
   10 |     int fav[i];cin>>fav[i];
      |                         ^
a.cc:20:10: error: expected ';' before '}' token
   20 |     ans++
      |          ^
      |          ;
   21 |   }
      |   ~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {
int m,n;cin>>m>>n;
  int fav[m],ans=0;
  for(int i=0;i<n;i++)
    int fav[i];cin>>fav[i];
  for(int i=0;i<n;i++)
  {
    int k;cin>>k;
    for(int j=0;j<k;j++)
      fav[j-1]++;
  }
  for(int i=0;i<n;i++)
  {
    if(fav[i]==n)
    ans++
  }
  cout<<ans<<endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:10:25: error: 'i' was not declared in this scope
   10 |     int fav[i];cin>>fav[i];
      |                         ^
a.cc:20:10: error: expected ';' before '}' token
   20 |     ans++
      |          ^
      |          ;
   21 |   }
      |   ~
Language: C++

#include <iostream>
#include <tuple>
#include <vector>
using namespace std;

void input_int2(int &a, int &b) {
	cin >> a >> b;
	cin.ignore();
}

void input_int3(int &a, int &b, int &c) {
	cin >> a >> b >> c;	
	cin.ignore();
}

void input_int_array(int n,vector<int> &vec) {
	for (int i=0,tmp=0; i<n && cin >> tmp; i++) vec[i]=tmp;
}

void input_int_matrix(int n, int m, vector<vector<int>> &matrix) {
	int tmp;
	for(int i=0; i<n; i++) {
		for (int j=0; j<m; j++) {
			cin >> tmp;
			matrix[i][j] = tmp;
		}
	}
}

void input_int_var_array(int n,vector<int> &vec) {
	for (int tmp=0; cin >> tmp;) {
		vec.push_back(tmp);
	}
}

void input_int_var_matrix(int n, int m, vector<vector<int>> &matrix) {
	int tmp;
	for(int i=0; i<n; i++) {
		for (int j=0; j<m; j++) {
			cin >> tmp;
			matrix[i][j] = tmp;
		}
	}
}

void input_var_str(vector<string> & array) {
	string s;
	getline(cin, s);
	
	stringstream ss{s};
	while(getline(ss, s, ' ')) {
		array.push_back(s);
	}
}

void input_var_int(vector<int> &array) {
	string s;
	getline(cin, s);
	
	stringstream ss{s};
	while(getline(ss, s, ' ')) {
		array.push_back(stoi(s));
	}
}

template <typename T> void print_var_vector(vector<T> vec) {
	for(typename vector<T>::iterator i=begin(vec); i!=end(vec); i++) {
		cout << *i;
	}
	cout << endl;
}

void print_vector(int N, vector<int> vec) {
	for(int i=0; i<N; i++){
		cout << vec[i] << " ";
	}
	cout << endl;
}

const int MAX_N = 20;
const int MAX_M = 20;

int N, M;
vector<int> k;
vector<vector<int>> A;

void input() {
	vector<int> array;
	input_int2(N, M);
	for(int i=0; i<N; i++){
		array = vector<int>();
		input_var_int(array);
		k.push_back(*array.begin());
		array.erase(array.begin());
		A.push_back(array);
	}
}

int solve() {
	vector<int> result;
	vector<int> tmp = A[0];
	for(int i=1; i<N; i++) {
		result = vector<int>();
		set_intersection(A[i].begin(), A[i].end(), tmp.begin(), tmp.end(), inserter(result, result.end()) );
		tmp = result;
	}
	return tmp.size();
}

int main() {
	input();
	cout << solve() << endl;
}


Compiler output:
a.cc: In function 'void input_var_str(std::vector<std::__cxx11::basic_string<char> >&)':
a.cc:50:22: error: variable 'std::stringstream ss' has initializer but incomplete type
   50 |         stringstream ss{s};
      |                      ^~
a.cc: In function 'void input_var_int(std::vector<int>&)':
a.cc:60:22: error: variable 'std::stringstream ss' has initializer but incomplete type
   60 |         stringstream ss{s};
      |                      ^~
a.cc: In function 'int solve()':
a.cc:104:17: error: 'set_intersection' was not declared in this scope
  104 |                 set_intersection(A[i].begin(), A[i].end(), tmp.begin(), tmp.end(), inserter(result, result.end()) );
      |                 ^~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include<algorithm>
#include<vector>
#include<string>
using namespace std;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:20:14: error: 'itn' was not declared in this scope; did you mean 'int'?
   20 |         for (itn i = 1; i <= M; i++) {
      |              ^~~
      |              int
a.cc:20:25: error: 'i' was not declared in this scope
   20 |         for (itn i = 1; i <= M; i++) {
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main{
  int food[40] = {0};
  int N, M;
  int K, A;
  int ans = 0;
    cin >> N >> M;
    for (int i=0; i<N; ++i) {
        cin >> K;
        for (int k=0; k < K; ++k) {
            cin >> A;
            ++food[A];
        }
    }

    for (int i=1; i<=M; ++i) {
        if (food[i] == N) ++ans;
    }

    cout << ans << endl;

    return 0;
}


Compiler output:
a.cc:3:5: error: cannot declare '::main' to be a global variable
    3 | int main{
      |     ^~~~
a.cc:4:3: error: expected primary-expression before 'int'
    4 |   int food[40] = {0};
      |   ^~~
a.cc:4:3: error: expected '}' before 'int'
a.cc:3:9: note: to match this '{'
    3 | int main{
      |         ^
a.cc:8:5: error: 'cin' does not name a type
    8 |     cin >> N >> M;
      |     ^~~
a.cc:9:5: error: expected unqualified-id before 'for'
    9 |     for (int i=0; i<N; ++i) {
      |     ^~~
a.cc:9:19: error: 'i' does not name a type
    9 |     for (int i=0; i<N; ++i) {
      |                   ^
a.cc:9:24: error: expected unqualified-id before '++' token
    9 |     for (int i=0; i<N; ++i) {
      |                        ^~
a.cc:17:5: error: expected unqualified-id before 'for'
   17 |     for (int i=1; i<=M; ++i) {
      |     ^~~
a.cc:17:19: error: 'i' does not name a type
   17 |     for (int i=1; i<=M; ++i) {
      |                   ^
a.cc:17:25: error: expected unqualified-id before '++' token
   17 |     for (int i=1; i<=M; ++i) {
      |                         ^~
a.cc:21:5: error: 'cout' does not name a type
   21 |     cout << ans << endl;
      |     ^~~~
a.cc:23:5: error: expected unqualified-id before 'return'
   23 |     return 0;
      |     ^~~~~~
a.cc:24:1: error: expected declaration before '}' token
   24 | }
      | ^
Language: C++

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

int main(){
	int N, M;
	cin >> N >> M;
	// MEMO: 先に適当な数で宣言しておく。スコープが問題になってしまっていた。
	vector<int> ans(30);

	int k;
	for (int i=0; i < N; ++i)
	{
		cin >> k;
		vector<int> v1(k);
		for (int j=0; j<k; ++j)
		{
		cin >> v1[j];
		}
		
		if (i==0)
		{
			
			copy(v1.begin(), v1.end(), ans.begin());
			
		} else {
			int num;
			
			for (int mm=0; mm<ans.size(); ++mm)
			{
				num = ans[mm];
				if (num == 0){break;}		
				auto result = find(v1.begin(), v1.end(), num);
				
				if (result != v1.end())
				{
		//			cout << "found" << endl;
				} else {
				auto result = remove(ans.begin(), ans.end(), num);
		//		cout << "remove " << num << endl;		
				}
		}
		// 0でないansの種類を数える。
		auto count = std::count_if(ans.begin(), ans.end(), [](int x) {return x!=0;});
		cout << count << endl;
		}	
		
	return 0;
}


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

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

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

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

#include <iostream>
using namespace std ;
int main ()
{
	int n,m,i,j,k,a,ans; 
	cin >> n >> m ;
	vector<int> cnt(M,0);
	for(i=0;i<n;i++){
		cin >> k;
		for (j=0;j<k;j++) {
			cin >> a ;
			a--;
			++cnt[a];
		}
	}
	for(i=0;i<m;i++){
		if(cnt[i]==n){
			ans++;
		}
	}
	cout << ans << endl ;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector<int> cnt(M,0);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std ;
a.cc:7:16: error: expected primary-expression before 'int'
    7 |         vector<int> cnt(M,0);
      |                ^~~
a.cc:13:27: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |                         ++cnt[a];
      |                           ^~~
      |                           int
a.cc:17:20: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |                 if(cnt[i]==n){
      |                    ^~~
      |                    int
Language: C++

#include <iostream>
using namespace std ;
int main ()
{
	int n,m,i,j,k,a,ans; 
	cin >> n >> m ;
	vector <int > cnt (M , 0);
	for(i=0;i<n;i++){
		cin >> k;
		for (j=0;j<K;j++) {
			cin >> a ;
			a--;
			++cnt[a];
		}
	}
	for(i=0;i<m;i++){
		if(cnt[i]==n){
			ans++;
		}
	}
	cout << ans << endl ;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'vector' was not declared in this scope
    7 |         vector <int > cnt (M , 0);
      |         ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std ;
a.cc:7:17: error: expected primary-expression before 'int'
    7 |         vector <int > cnt (M , 0);
      |                 ^~~
a.cc:10:28: error: 'K' was not declared in this scope
   10 |                 for (j=0;j<K;j++) {
      |                            ^
a.cc:13:27: error: 'cnt' was not declared in this scope; did you mean 'int'?
   13 |                         ++cnt[a];
      |                           ^~~
      |                           int
a.cc:17:20: error: 'cnt' was not declared in this scope; did you mean 'int'?
   17 |                 if(cnt[i]==n){
      |                    ^~~
      |                    int
Language: Java

import java.util.*;
public class Main {
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int M = sc.nextInt();
        
        int kinds[] = new int[M];  

        for (int i = 0; i < N; i++){

            int K = sc.nextInt();
            
          for (int j = 0; j < K; j++){
              int tmp = sc.nextInt() - 1;
              kinds[tmp]++;
            }

        }

        int count = 0;

        for (int i = 0; i < M; i++){

            if (kinds[i] == N) {
                count++
            }

        }
        System.out.println(count);
     }
}

Compiler output:
Main.java:27: error: ';' expected
                count++
                       ^
1 error
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(){
  int n, m; cin >> n >> m;
  vector<int>count(m)
    for(int i = 0;i < m;i++){
      count[i]=0;
    }
  for(int i = 0;i < n;i++){
    int k; cin >> k;
    for(int j = 0;j < k;j++){
      int A; cin >> A; A--;
      count[A]++;
    }
  }
  int ans = 0;
  for(int i = 0;i < m;i++){
    if(count[i] = n){
      ans++;
    }
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:5: error: expected ',' or ';' before 'for'
    7 |     for(int i = 0;i < m;i++){
      |     ^~~
a.cc:7:19: error: 'i' was not declared in this scope
    7 |     for(int i = 0;i < m;i++){
      |                   ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
    int N,M;
    vector<int> count = 0;
    cin >> N >> M;
    int K;
    
    for(int i=0;i<N;i++){
        cin >> K;
        
        for(int j=0;j<K;j++){
            int A; cin >> A; A--;
            count.at(A)++;
        }
    }
    int ans=0;
    for(int i=0;i<M;i++){
        if(count.at(i)==N){
            ans++;
        }
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:25: error: conversion from 'int' to non-scalar type 'std::vector<int>' requested
    7 |     vector<int> count = 0;
      |                         ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
    int n,m;cin >> n >> m;
    int k;
    vector<int> count;
    //count = vector<int>(m,0);
    int count[m+1] = {};
    for(int i =0; i < n;i++){
        cin >> k;
        for(int j = 0; j < k; j++){
            int index;
            cin >> index;
            count[index]++;
        }
    }
    int cnt = 0;
    for(int j = 0; j < m+1; j++)if(count[j]==n)cnt++;
    cout  << cnt << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: conflicting declaration 'int count [(m + 1)]'
   10 |     int count[m+1] = {};
      |         ^~~~~
a.cc:8:17: note: previous declaration as 'std::vector<int> count'
    8 |     vector<int> count;
      |                 ^~~~~