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


#include <bits/stdc++.h> 2 using namespace std;
3 4 int N, K; 5 vector<int> d; 6 vector<vector<int>> A;
7 8 void input() { 9 cin >> N >> K; 10 d.resize(K); 11 A.resize(K, vector<int>()); 12 for(int i = 0; i < K; i++) { 13 cin >> d[i]; 14 A[i].resize(d[i]); 15 for(int j = 0; j < d[i]; j++) { 16 cin >> A[i][j]; 17 } 18 } 19 }
20 21 void solve() { 22 int ans = 0; 23 for(int i = 1; i <= N; i++) { 24 bool have = false; 25 for(auto v : A) { 26 for(auto p : v) { 27 if(p == i) have = true; 28 } 29 } 30 if(!have) ans++; 31 } 32 cout << ans << endl; 33 }
34 35 int main() { 36 input(); 37 solve();
2
38 return 0; 39 }



Compiler output:
a.cc:2:26: warning: extra tokens at end of #include directive
    2 | #include <bits/stdc++.h> 2 using namespace std;
      |                          ^
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3 4 int N, K; 5 vector<int> d; 6 vector<vector<int>> A;
      | ^
a.cc:3:15: error: expected unqualified-id before numeric constant
    3 | 3 4 int N, K; 5 vector<int> d; 6 vector<vector<int>> A;
      |               ^
a.cc:3:32: error: expected unqualified-id before numeric constant
    3 | 3 4 int N, K; 5 vector<int> d; 6 vector<vector<int>> A;
      |                                ^
a.cc:4:1: error: expected unqualified-id before numeric constant
    4 | 7 8 void input() { 9 cin >> N >> K; 10 d.resize(K); 11 A.resize(K, vector<int>()); 12 for(int i = 0; i < K; i++) { 13 cin >> d[i]; 14 A[i].resize(d[i]); 15 for(int j = 0; j < d[i]; j++) { 16 cin >> A[i][j]; 17 } 18 } 19 }
      | ^
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 20 21 void solve() { 22 int ans = 0; 23 for(int i = 1; i <= N; i++) { 24 bool have = false; 25 for(auto v : A) { 26 for(auto p : v) { 27 if(p == i) have = true; 28 } 29 } 30 if(!have) ans++; 31 } 32 cout << ans << endl; 33 }
      | ^~
a.cc:6:1: error: expected unqualified-id before numeric constant
    6 | 34 35 int main() { 36 input(); 37 solve();
      | ^~
Language: C++


#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>	
#include <deque>
#include <set>
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define fore(i,a) for(auto &i:a)
#define INF INT_MAX/2;
typedef long long ll;
using namespace std;
using vi = vector<int>;
using vll = vector<ll>;
ll mod = 1e9 + 7;
//ll llmax = 10000000000000000000ll;
using namespace std;
using Graph = vector<vector<int>>;


int cnt_digit(ll N)
{
	int digit = 0;

	while (N > 0)
	{
		N /= 10;
		digit++;
	}
	return digit;
}


 // 最大公約数計算
 
ll gcd(ll a, ll b)
{
	if (b == 0) {
		return a;
	}
	else {
		return gcd(b, a % b);
	}
}
// 最小公倍数の計算

ll lcm(ll a, ll b)
{
	ll g = gcd(a, b);

	return a / g * b;
}

struct union_find
{
	vector<int> par, r;
	union_find(int n)
	{
		par.resize(n);
		r.resize(n);
		init(n);
	}


	void init(int n)
	{
		for (int i = 0; i < n; i++) par[i] = i;
		for (int i = 0; i < n; i++) r[i] = 0;
	}

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

	void unite(int x, int y)
	{
		x = find(x);
		y = find(y);

		if (r[x] < r[y])
		{
			par[x] = y;
		}
		else
		{
			par[y] = x;
			if (r[x] == r[y])
			{
				r[x]++;
			}
		}
	}
};


int N, M, Q;
vector<int> a, b, c, d;
int ans;

void dfs(vector<int>A) {
	if (A.size() == N+1) {
		int now = 0;
		rep(i, 0, Q) {
			if (A[b[i]] - A[a[i]] == c[i])now += d[i];

		}
		ans = max(ans, now);
		return;
	}
	A.push_back(A.back());
	while (A.back() <= M) {
		dfs(A);
		A.back()++;
	}

}

vector<int> graph[1050];

void dfs(int v) {

	cout << v << endl;

	if (graph[v][0] == 9) {
		return;
	}
	dfs(graph[v][0]);
}
/*int n, m;
vector<int> H(n);
Graph G(n);
vector<bool>seen;
void dfs(const Graph& G, int v) {
	seen[v] = true;
	int haight = H[v];
	fore(next_v, G[v]) {
		if (seen[next_v])continue;
		dfs(G, next_v);
	}
}*/

int N, K;
vector<int> d;
vector<vector<int>>A;
void input() {
	cin >> N >> K;
	d.resize(K);
	A.resize(K, vector<int>());
	rep(i, 0, K) {
		cin >> d[i];
		A[i].resize(d[i]);
		rep(j, 0, d[i]) {
			cin >> A[i][j];
		}
	}
	
}

void solve() {
	int ans = 0;
	rep(i, 0, N + 1) {
		bool have = false;
		fore(v, A) {
			fore(p, v) {
				if (p == i)have = true;
			}
		}
		if (have != true)ans++;
	}
	cout << ans << endl;
}

int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	input();
	solve();
	return 0;
}

Compiler output:
a.cc:149:5: error: redefinition of 'int N'
  149 | int N, K;
      |     ^
a.cc:103:5: note: 'int N' previously declared here
  103 | int N, M, Q;
      |     ^
a.cc:150:13: error: redefinition of 'std::vector<int> d'
  150 | vector<int> d;
      |             ^
a.cc:104:22: note: 'std::vector<int> d' previously declared here
  104 | vector<int> a, b, c, d;
      |                      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K;
  cin >> N >> K;
  vector<int> A(N);//N人の子供を宣言
  //どの子供がどれだけお菓子をもらったかを入力
  for (int i = 0; i < K ; i++){
    int di;//i番目のお菓子をもってる人数
    cin >> di;
    vector<int> Ai(di);//i番目のお菓子を持ってる人の番号
    for(int j = 0; j < di ; j++){
    cin >>Ai.at(j);//お菓子を持ってる人の番号を入力
    A.at.(Ai.at(j)) += 1; //お菓子をもらった人のお菓子の数を＋１
    }
  }
  //A(N)の値を順に調べていって値が0の人数をカウントする
  int count = 0;
  for( int x : A ){//Aの値xをすべて調べる
    x == 0 ? count+=1 : continue;
  }
  cout << count << endl;
}
    
    

Compiler output:
a.cc: In function 'int main()':
a.cc:14:7: error: invalid use of member function 'std::vector<int>::at' (did you forget the '()' ?)
   14 |     A.at.(Ai.at(j)) += 1; //お菓子をもらった人のお菓子の数を＋１
      |     ~~^~
a.cc:20:25: error: expected primary-expression before 'continue'
   20 |     x == 0 ? count+=1 : continue;
      |                         ^~~~~~~~
Language: C++

#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define PLI pair<ll, int>
#define PIL pair<int, ll>
#define STR string
#define Fst first
#define Snd second
#define SHN 1e9
#define LSHN 1e18
using namespace std;
int n,m;
bool visit[110];
int main()
{
	cin >>n>>m;
	for (int i=0;i<m;i++)
	{
		int siz;
		cin >>siz;
		for (int j=0;j<siz;j++)
		{
			int x;
			cin >>x;
			visit[x-1]=1;
		}
	}
	cout <<count(visit,visit+n,0);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:25: error: reference to 'visit' is ambiguous
   28 |                         visit[x-1]=1;
      |                         ^~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:80,
                 from a.cc:1:
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:6: note:                 'bool visit [110]'
   16 | bool visit[110];
      |      ^~~~~
a.cc:31:22: error: reference to 'visit' is ambiguous
   31 |         cout <<count(visit,visit+n,0);
      |                      ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:6: note:                 'bool visit [110]'
   16 | bool visit[110];
      |      ^~~~~
a.cc:31:28: error: reference to 'visit' is ambiguous
   31 |         cout <<count(visit,visit+n,0);
      |                            ^~~~~
/usr/include/c++/14/variant:1855:5: note: candidates are: 'template<class _Visitor, class ... _Variants> constexpr std::__detail::__variant::__visit_result_t<_Visitor, _Variants ...> std::visit(_Visitor&&, _Variants&& ...)'
 1855 |     visit(_Visitor&& __visitor, _Variants&&... __variants)
      |     ^~~~~
a.cc:16:6: note:                 'bool visit [110]'
   16 | bool visit[110];
      |      ^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
    int n, k;
    cin >> n >> k;
    vint c(n, 0);
    rep(i, k) {
        int d;
        cin >> d;
        rep(j, d) {
            int a;
            cin >> a;
            --a;
            c[a]++;
        }
    }
 
    int ans = 0;
    rep(i, n) if (c[i]==0) ans++;
 
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:5: error: 'vint' was not declared in this scope; did you mean 'uint'?
    6 |     vint c(n, 0);
      |     ^~~~
      |     uint
a.cc:7:9: error: 'i' was not declared in this scope
    7 |     rep(i, k) {
      |         ^
a.cc:7:5: error: 'rep' was not declared in this scope
    7 |     rep(i, k) {
      |     ^~~
Language: C

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

int main() {
  ios::sync_with_stdio(false);
  /* code start */

  int n, k;
  int darr[101];
  n = k = 0;
  for (int i = 0; i < 102; i++) {
    darr[i] = 0;
  }

  cin >> n >> k;

  for (int i = 0; i < k; i++) {
    int tmp;
    cin >> tmp;
    for (int j = 0; j < tmp; j++) {
      int okasi;
      cin >> okasi;
      darr[okasi] |= true;
    }
    /* code */
  }

  int ans = 0;
  for (int i = 1; i < n; i++) {
    if (!darr[i])
      ans++;
  }

  cout << ans << endl;

  /* code end   */
  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<iostream>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  int m = 1;
  int arr[n+1] = {0};
  for(int i=1;i<=k;i=i+m){
    int d;
    cin>>d;
    for(int q=1;q<=d;q++){
      int x;
      cin>>x;
      arr[x] = 1;
    }
    m = d;
  }
  int count = 0;
    for(int i = 1;i<=n+1;i++){
      if(arr[i]!=0)
        count++;
    }
  cout<<n- count<<endl;
  
  return 0;
}
    
    
    
    
    
    
    
  }
  
  
  
  
  
  
  
  
  
 return 0; 
}

Compiler output:
a.cc:34:3: error: expected declaration before '}' token
   34 |   }
      |   ^
a.cc:44:2: error: expected unqualified-id before 'return'
   44 |  return 0;
      |  ^~~~~~
a.cc:45:1: error: expected declaration before '}' token
   45 | }
      | ^
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<unordered_set>
using namespace std;
int main(){
	int n,k,d,x;
	cin>>n>>k;
	unordered_set<int> z;
	for(int i=0;i<k;i++){
		int x;
		cin>>x;
		for(int j=0;j<x;j++){
			int y;
			cin>>y;
			z.insert(y);
		}
	}
	cout<<n-s.size()<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 's' was not declared in this scope
   19 |         cout<<n-s.size()<<endl;
      |                 ^
Language: C++

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


int main(){
    int N,K;
    cin >> N >> K;
    map<int,int> mp;
    while(K!=0){
	int d;
	cin >> d;
	for(int i=0;i<d;i++){
	    int temp;
	    cin >>temp;
	    mp[temp] = 1;
	}
	K--;
    }
    int res = 0;
    for(int i=1;i<=N;i++){
	if (mp.count(i)==0) res++;
    }
    cout << res << endl;
    return 0;
}


Compiler output:
a.cc:1:23: warning: extra tokens at end of #include directive
    1 | #include<bits/stc++.h>;
      |                       ^
a.cc:1:9: fatal error: bits/stc++.h: No such file or directory
    1 | #include<bits/stc++.h>;
      |         ^~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<set>
#include<string>
using namespace std;
#define endl "\n"
#define M 1000000007
#define enter ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define test ll t; cin>>t; while(t--)
#define pb push_back
#define mp make_pair 
typedef unsigned long long int ll;

int main()
{
	#ifndef ONLINE_JUDGE
	  freopen("input.txt","r",stdin);
	  freopen("output.txt","w",stdout);
	#endif
    enter

    	int n,k;
    	cin>>n>>k;
    	int ans=0;
    	int freq[n]={0};

        while(k--){
        	cin>>a;
        	int arr[a];
        	for(int i=0;i<a;i++){
        		cin>>arr[i];
        		freq[arr[i]-1]++;
        	}
        }

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

        cout<<ans<<endl;

     
	return 0;
    }
 



Compiler output:
a.cc: In function 'int main()':
a.cc:27:22: error: 'a' was not declared in this scope
   27 |                 cin>>a;
      |                      ^
a.cc:30:30: error: 'arr' was not declared in this scope
   30 |                         cin>>arr[i];
      |                              ^~~
a.cc:36:20: error: 'arr' was not declared in this scope
   36 |                 if(arr[i]==0){
      |                    ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
int main() {
	// your code goes here
	int n,a,k;
	cin>>n>>k;
	set<int >s;
	int d[k];
	for(int i=0;i<k;i++){
		cin>>d[i];
	for(int i=0;i<d[i];i++){
		cin>>a;
		s.insert(a);
	}
	cout<<n-s.size()<<endl;
	return 0;
}

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

#include <iostream>
#include <stdio.h>

using namespace std;

int main()
{
	int N,K;
	cin >> N >> K ;
	int d[K+1];
	int A[K+1][N+1];
	int n[N] ;
	int i = 1;
	int j;
	while (i <= K)
	{
		n[i] = i;
		cin >> d[i];
		j = 1;
		while (j <= d[i])
		{
			cin >> A[i][j];
			n[A[i][j]] = -1;
			j++;
		}
		i++;
	}
	i = 1;
	int cnt = 0;
	while (i <= N)
	{
		if (n[i] != -1)
			cnt++;
		i++;
	}
	cout << cnt << endl;
	return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,k,i,j;
  cin>>n>>k;
  int arr[n]={0};
  while(k--)
  {
    cin>>i;
    while(i--)
    {
      cin>>j;
      arr[j-1]++;
    }
  }
  int count=0;
  for(i=0;i<n:i++){
    if(arr[i]==0)
           count++;
           }
           cout<<count<<"\n";
     return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:11: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   18 |   for(i=0;i<n:i++){
      |           ^
a.cc:18:14: error: found ':' in nested-name-specifier, expected '::'
   18 |   for(i=0;i<n:i++){
      |              ^
      |              ::
a.cc:18:13: error: 'n' is not a class, namespace, or enumeration
   18 |   for(i=0;i<n:i++){
      |             ^
a.cc:23:6: error: expected primary-expression before 'return'
   23 |      return 0;
      |      ^~~~~~
a.cc:22:30: error: expected ')' before 'return'
   22 |            cout<<count<<"\n";
      |                              ^
      |                              )
   23 |      return 0;
      |      ~~~~~~                   
a.cc:18:6: note: to match this '('
   18 |   for(i=0;i<n:i++){
      |      ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,k,i,j;
  cin>>n>>k;
  int arr[n]={0};
  while(k--)
  {
    cin>>i;
    while(i--)
    {
      cin>>j;
      arr[j-1]++;
    }
  }
  int c=0;
  for(i:arr){
    if(arr[i}==0)
           c++;
           }
           cout<<c<<"\n";
     return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:8: error: found ':' in nested-name-specifier, expected '::'
   18 |   for(i:arr){
      |        ^
      |        ::
a.cc:18:7: error: 'i' is not a class, namespace, or enumeration
   18 |   for(i:arr){
      |       ^
a.cc:19:14: error: expected primary-expression before '==' token
   19 |     if(arr[i}==0)
      |              ^~
a.cc:19:17: error: expected ';' before ')' token
   19 |     if(arr[i}==0)
      |                 ^
      |                 ;
a.cc: At global scope:
a.cc:22:12: error: 'cout' does not name a type
   22 |            cout<<c<<"\n";
      |            ^~~~
a.cc:23:6: 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, K;
  cin >> N >> K;
  vector<vector <int>> hito (K); 
  for (int i = 0; i < K; i++){
    int d;
    cin >> d;
    for(int j = 0; j < d; j++){
      int bango;
      cin >> bango;
      hito[i].push_back(bango);
    }
  }
  vector<int> count;
  int hiku;
  for (int h = 0; h < N+1; h++){
    for (int i = 0; i < K; i++){
      for(int j = 0; j < hito[i].size(); j++){
        if(hito[i][j] == h){
          hiku++;
        }
      }
    }
    count[h].push_back(hiku);
  }
  int key;
  for(int h = 0; h < N+1; h++){
    if(count[h] > 0){
      key++;
    }
  }
  
  cout << N - key << endl;
}
  
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: request for member 'push_back' in 'count.std::vector<int>::operator[](((std::vector<int>::size_type)h))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   26 |     count[h].push_back(hiku);
      |              ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, K;
  cin >> N >> K;
  vector<vector <int>> hito (K, vector<int>); 
  for (int i = 0; i < K; i++){
    int d;
    cin >> d;
    for(int j = 0; j < d; j++){
      int bango;
      cin >> bango;
      hito[i].push_back(bango);
    }
  }
  vector<int> count;
  int hiku;
  for (int h = 0; h < N+1; h++){
    for (int i = 0; i < K; i++){
      for(int j = 0; j < hito[i].size(); j++){
        if(hito[i][j] == h){
          hiku++;
        }
      }
    }
    count[h].push_back(hiku);
  }
  int key;
  for(int h = 0; h < N+1; h++){
    if(count[h] > 0){
      key++;
    }
  }
  
  cout << N - key << endl;
}
  
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:44: error: expected primary-expression before ')' token
    6 |   vector<vector <int>> hito (K, vector<int>);
      |                                            ^
a.cc:26:14: error: request for member 'push_back' in 'count.std::vector<int>::operator[](((std::vector<int>::size_type)h))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   26 |     count[h].push_back(hiku);
      |              ^~~~~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, K;
  cin >> N >> K;
  vector<vector <int>> hito (K, vector<int>); 
  for (int i = 0; i < K; i++){
    int d;
    cin >> d;
    for(int j = 0; j < d; j++){
      int bango;
      cin >> bango;
      hito[i].push_back(bango);
    }
  }
  vector<int> count;
  int hiku;
  for (int h = 1; h <= N; h++){
    for (int i = 0; i < K; i++){
      for(int j = 0; j < hito[i].size(); j++){
        if(hito[i][j] == h){
          hiku++;
        }
      }
    }
    count[h].push_back(hiku);
  }
  int key;
  for(int h = 0; h < N+1; h++){
    if(count[h] > 0){
      key++;
    }
  }
  
  cout << N - key << endl;
}
  
      
    

Compiler output:
a.cc: In function 'int main()':
a.cc:6:44: error: expected primary-expression before ')' token
    6 |   vector<vector <int>> hito (K, vector<int>);
      |                                            ^
a.cc:26:14: error: request for member 'push_back' in 'count.std::vector<int>::operator[](((std::vector<int>::size_type)h))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   26 |     count[h].push_back(hiku);
      |              ^~~~~~~~~
Language: C++

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

int main(){
  int N, K;
  cin >> N >> K;
  vector<int> d(K);
  vector<vector<int>> A(K, vector<int> d.size());
  
  int count = 0;
  
    for(int i = 0; i < K; i++){
    cin >> d.at(i);
    for(int j = 0; j < d.at(i); j++){
      cin >> A.at(i).at(j);
    }
  }
  
  for(int i = 0; i < K; i++){
    bool y = false;
    for(int j = 0; j < d.at(i); j++){
      for(int x = 1; x <= K; x++){
        if(x == A.at(i).at(j)){
          y == true;
        }
      }
    }
    if(y == false){
    count++;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:40: error: expected primary-expression before 'd'
    9 |   vector<vector<int>> A(K, vector<int> d.size());
      |                                        ^
Language: C++

#include<iostream>
using namespace std;

int main(){
  int N, K;
  cin >> N >> K;
  vector<int> d(K);
  vector<vector<int>> A(K, vector<int> d.size());
  
  int count = 0;
  
    for(int i = 0; i < K; i++){
    cin >> d.at(i);
    for(int j = 0; j < d.at(i); j++){
      cin >> A.at(i).at(j);
    }
  }
  
  for(int i = 0; i < K; i++){
    bool y = false;
    for(int j = 0; j < d.at(i); j++){
      for(int x = 1; x <= K; x++){
        if(x == A.at(i).at(j)){
          y == true;
        }
      }
    }
    if(y == false){
    count++;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'vector' was not declared in this scope
    7 |   vector<int> d(K);
      |   ^~~~~~
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:10: error: expected primary-expression before 'int'
    7 |   vector<int> d(K);
      |          ^~~
a.cc:8:17: error: expected primary-expression before 'int'
    8 |   vector<vector<int>> A(K, vector<int> d.size());
      |                 ^~~
a.cc:13:12: error: 'd' was not declared in this scope
   13 |     cin >> d.at(i);
      |            ^
a.cc:15:14: error: 'A' was not declared in this scope
   15 |       cin >> A.at(i).at(j);
      |              ^
a.cc:21:24: error: 'd' was not declared in this scope
   21 |     for(int j = 0; j < d.at(i); j++){
      |                        ^
a.cc:23:17: error: 'A' was not declared in this scope
   23 |         if(x == A.at(i).at(j)){
      |                 ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
vector<int>A(N,0);
for(int i=0;i<K;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int AA;
cin>>AA;
A.at(AA-1)++;
}
}

int ans=0;
for(inti=0;i<K;i++){
if(A.at(i)==0)ans++;
}
cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   18 | for(inti=0;i<K;i++){
      |     ^~~~
      |     int
a.cc:18:12: error: 'i' was not declared in this scope
   18 | for(inti=0;i<K;i++){
      |            ^
Language: C++

#include<bits/stdc++.h>
usingnamespacestd;
int main(){
int N,K;
cin>>N>>K;
vector<int>A(N,0);
for(int i=0;i<K;i++){
int d;
cin>>d;
for(int j=0;j<d;j++){
int AA;
cin>>AA;
A.at(AA-1)++;
}
}

int ans=0;
for(inti=0;i<K;i++){
if(A.at(i)==0)ans++;
}
cout<<ans<<endl;
}

Compiler output:
a.cc:2:1: error: 'usingnamespacestd' does not name a type
    2 | usingnamespacestd;
      | ^~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    5 | cin>>N>>K;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:1: error: 'vector' was not declared in this scope
    6 | vector<int>A(N,0);
      | ^~~~~~
a.cc:6:1: note: suggested alternatives:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53:
/usr/include/c++/14/bits/stl_vector.h:428:11: note:   'std::vector'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
/usr/include/c++/14/vector:93:13: note:   'std::pmr::vector'
   93 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
a.cc:6:8: error: expected primary-expression before 'int'
    6 | vector<int>A(N,0);
      |        ^~~
a.cc:13:1: error: 'A' was not declared in this scope; did you mean 'AA'?
   13 | A.at(AA-1)++;
      | ^
      | AA
a.cc:18:5: error: 'inti' was not declared in this scope; did you mean 'int'?
   18 | for(inti=0;i<K;i++){
      |     ^~~~
      |     int
a.cc:18:12: error: 'i' was not declared in this scope
   18 | for(inti=0;i<K;i++){
      |            ^
a.cc:19:4: error: 'A' was not declared in this scope
   19 | if(A.at(i)==0)ans++;
      |    ^
a.cc:21:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   21 | cout<<ans<<endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:21:12: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   21 | cout<<ans<<endl;
      |            ^~~~
      |            std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C

#include<stdio.h>
int main(void){
  int i, n, k, t, d[100], a[100],s=0;
  scanf("%d%d", &n, &k);
  for(i=1;i<=n;i++){
    a[i]=0;
  }
  for(i=1;i<=k;i++){
    scanf("%d", &d[i]);
    for(j=1;j<=d[i];j++){
      scanf("%d", &t);
      a[t]=1;
    }
  }
  for(i=1;i<=n;i++){
    if(a[i]=0){
      s++;
    }
  }   
  printf("%d", s);
  return 0;
}


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

#include<stdio.h>
int main(void){
  int i, n, t, d[100], a[100],s=0;
  scanf("%d%d", &n, &k);
  for(i=1;i<=n;i++){
    a[i]=0;
  }
  for(i=1;i<=k;i++){
    scanf("%d", &d[i]);
    for(j=1;j<=d[i];j++){
      scanf("%d", &t);
      a[t]=1;
    }
  }
  for(i=1;i<=n;i++){
    if(a[i]=0){
      s++;
    }
  }   
  printf("%d", s);
  return 0;
}


Compiler output:
main.c: In function 'main':
main.c:4:22: error: 'k' undeclared (first use in this function)
    4 |   scanf("%d%d", &n, &k);
      |                      ^
main.c:4:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:9: error: 'j' undeclared (first use in this function)
   10 |     for(j=1;j<=d[i];j++){
      |         ^
Language: C

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	
	int n,k; cin>>n>>k;
	int arr[n+1]; for(int i = 0; i <n+1; i++) arr[i] = 0;
	for(int  i = 0; i < k; i++){
		int x; cin>>x;
		for(int j = 0; j < x; j++) {
			int y; cin>>y;
			arr[y] = 1;
		}
	}
	int co = 0;
	for(int i = 1; i < n+1; i++){
		if(!arr[i]) co++;
	}
	cout<<co<<"\n";
	
}

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

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

int main(){
    int N, K, d, A;
    cin >> N >> K;
    vector<int> S(N, 0);

    for(int i = 0; i < K; i++){
        cin >> d;
        for(int j = 0; j < d; j++){
            cin >> A;
            S.at(A-1)++;
        }
    }
    
    int count = 0;
    for(int k = 0; k < K; k++){
        if(S.at(i) == 0)    count++;
    }
    
    cout << count << endl;

}

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

/*
    author:@bhaskar_8998
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
using namespace __gnu_pbds; 
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;  
typedef long long i64;
typedef vector<int> vi;
typedef vector<long> vl;
typedef pair<int,int>pii;
#define all(A) (A).begin(),(A).end()
#define pb push_back
#define MOD 1000000007
#define fastio() {ios_base::sync_with_stdio(false);cin.tie(NULL);}

int main(){
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif
    fastio();
    i64 ss[31];
    for(int i=1,ts=2;i<=30;i++){
        ss[i]=ts;
        ts*=2;
    }
    clock_t beg=clock();
    int t=1;
    // cin>>t;
    while(t--){
        int n,k;
        cin>>n>>k;
        unordered_map<int,int> m;
        m.clear();
        for(int i=0,l;i<k;i++){
            cin>>l;
            for(int j=0,ct;j<l;j++){
                cin>>ct;
                m[ct]+=1;
            }
        }
        for(int i=1;i<=n;i++){
            if(m[i]==0)ans+=1;
        }
        cout<<ans;
    }

    clock_t end=clock(); 
    fprintf(stderr, "\n%lf sec\n", (double)(end-beg)/(CLOCKS_PER_SEC));
    return 0;
}


    

Compiler output:
a.cc: In function 'int main()':
a.cc:48:24: error: 'ans' was not declared in this scope; did you mean 'abs'?
   48 |             if(m[i]==0)ans+=1;
      |                        ^~~
      |                        abs
a.cc:50:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |         cout<<ans;
      |               ^~~
      |               abs
Language: C

#include <bits/stdc++.h>
using namespace std;
#define ALL(obj) obj.begin(),obj.end()
#define pb(obj) push_back(obj)
#define REP(i,N) for(ll i=0;i<N;i++)
typedef long long ll;
const ll MOD=1e9+7;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,K;
    cin>>N>>K;
    int d;
    int A;
    set<int> okashi;
    for(int i=0;i<K;i++){
        cin>>d;
        for(int j=0;j<d;j++){
            cin>>A;
            okashi.insert(A);
        }
    }
    cout<<N-okashi.size()<<endl;
}

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 lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)



int main(){
    int n, k;
    REP(i, n) { dat[i] = 0; }
    cin >> n >> k;
    char dat[n];
    REP(i, k){
        int d;
        cin >> d;
        int a;
        REP(j, d){
            cin >> a;
            dat[a-1] = 1;
        }
    }
    int res = 0;
    REP(i, n){
        if(dat[i] == 0) { res++; }
    }
    cout << res << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: 'dat' was not declared in this scope
   18 |     REP(i, n) { dat[i] = 0; }
      |                 ^~~
Language: C++

#include <iostream>
using namespace std;
int main() {
  int N, K;
  cin >> N >> K;
  vector<int> snukes(N, 0);
  int i;
  int d;
  for (i=0;i < K;i++) {
    cin >> d;
    int j;
    while(d >= 0) {
      cin >> j;
      snukes[j-1]++;
    }
  }
  for (i=0;i < N;i++) {
    if(snukes[i] == 0) cout << i+1 << "\n";
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> snukes(N, 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:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> snukes(N, 0);
      |          ^~~
a.cc:14:7: error: 'snukes' was not declared in this scope
   14 |       snukes[j-1]++;
      |       ^~~~~~
a.cc:18:8: error: 'snukes' was not declared in this scope
   18 |     if(snukes[i] == 0) cout << i+1 << "\n";
      |        ^~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 int N, K;
vector<int> d;
vector<vector<int>> A;

void input(){
  cin >> N >> K;
  d.resize(K);
  A.resize(K, vector<int<());
  for(int i=0;i<K;i++){
    cin >> d[i];
    A[i].resize(d[i]);
    for(int j =0; j<d[i];j++){
      cin >> A[i][j];
    }
  }
}

void solve(){
  int ans =0;
  for(int i=1;i<=N;i++){
    bool have = false;
    for(auto v : A){
      for(auto p:v){
        if(p == i)have = true;
      }
    }
    if(!have)ans++;
  }
  cout << ans <<endl;
}

int main(){
  input();
  solve();
  return 0;
}

Compiler output:
a.cc: In function 'void input()':
a.cc:10:22: error: 'int' is not a template
   10 |   A.resize(K, vector<int<());
      |                      ^~~
a.cc:10:22: error: template argument 1 is invalid
a.cc:10:22: error: template argument 2 is invalid
Language: C++

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

int main() {
  int N, K, count = 0;
  cin >> N >> K;
  vector<vector<bool>> A(K, vector<bool>(N, false));
  for (int i = 0; i < K; i++){
    int d;
    cin >> d;
    for (int j = 0; j < d; j++){
      int has;
      cin >> has;
      A.at(i).at(has - 1) = true;
    }
  }
  loop: for (int i = 0; i < N; i++){
    for (int j = 0; j < K; j++){
      if(A.at(j).at(i) == true){
        continue loop;
      }
    }
    count++;
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: expected ';' before 'loop'
   20 |         continue loop;
      |                 ^~~~~
      |                 ;
a.cc:20:18: error: 'loop' was not declared in this scope
   20 |         continue loop;
      |                  ^~~~
Language: C++

using namespace std;
 int main()
{
int SNUKE[100];
int SNACK[100];
SNUKE[0]=0;
int count=0;
for( int i =0; i<3; ++i)
{
   cin>>SNACK[i];
cin>>SNUKE[i];
}
for( int i=0;i<3;++i)
{
    if(SNUKE[i]==0)
      {
          count++;
       }
}
cout<<count;
getch();
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:4: error: 'cin' was not declared in this scope
   10 |    cin>>SNACK[i];
      |    ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:20:1: error: 'cout' was not declared in this scope
   20 | cout<<count;
      | ^~~~
a.cc:20:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:21:1: error: 'getch' was not declared in this scope
   21 | getch();
      | ^~~~~
Language: C++

#include <bits/stdc++.h>

int main(){
    int n,k;
    std::cin >> n >> k;

    int l, d[n]=[0],ans[n]={0}, x=0;

    for (int i=0; i<n; i++){
        std::cin >> d[i];
        for (int j=0; j<d[i]; j++){
            std::cin >> l;
            ans[l-1]++;
        }
    }
    for (int i=0; i<n; i++){
        if(ans[i] == 0){
            x++;
        }
    }
    std::cout << x;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:18: error: expected identifier before numeric constant
    7 |     int l, d[n]=[0],ans[n]={0}, x=0;
      |                  ^
a.cc: In lambda function:
a.cc:7:20: error: expected '{' before ',' token
    7 |     int l, d[n]=[0],ans[n]={0}, x=0;
      |                    ^
a.cc: In function 'int main()':
a.cc:7:17: error: array must be initialized with a brace-enclosed initializer
    7 |     int l, d[n]=[0],ans[n]={0}, x=0;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>

int main(){
    int n,k;
    std::cin >> n >> k;
    int l, d[n]=[0],ans[n]={0}, x=0;
    for (int i=0; i<n; i++){
        std::cin >> d[i];
        for (int j=0; j<d[i]; j++){
            std::cin >> l;
            ans[l-1]++;
        }
    }
    for (int i=0; i<n; i++){
        if(ans[i] == 0){
            x++;
        }
    }
    std::cout << x;
}
// B - Trick or Treat
/*
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
 
int main(){
	int N,K; cin>>N>>K;
	vi D(K);
	vector<vi> A(K);
 
	rp(i, 0, K){
		cin>>D[i];
		A[i].resize(D[i]);
		rp(j, 0, D[i]) cin>>A[i][j];
	}
 
	vi ok(N, 0); // ok=1, ng=0
	rp(i, 0, K) rp(j, 0, D[i]) ok[A[i][j] - 1] = 1;
 
	ll ans = 0;
	rp(i, 0, N) if(ok[i] == 0) ans++;
	cout<< ans <<endl;
}
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:6:18: error: expected identifier before numeric constant
    6 |     int l, d[n]=[0],ans[n]={0}, x=0;
      |                  ^
a.cc: In lambda function:
a.cc:6:20: error: expected '{' before ',' token
    6 |     int l, d[n]=[0],ans[n]={0}, x=0;
      |                    ^
a.cc: In function 'int main()':
a.cc:6:17: error: array must be initialized with a brace-enclosed initializer
    6 |     int l, d[n]=[0],ans[n]={0}, x=0;
      |                 ^~~
Language: C

#include<stdio.h>
int main(void){
  int i, n, k, d[100], a[100][100];
  scanf("%d%d", &n, &k);
  for(i=1;i<=k;i++){
    for(j=1;j<=d[i];j++){
      scanf("%d%d", &d[i], &a[i][j]);
    }
  }
  return 0;
}


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

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

int main(){
  int n, k, d[110], a[110], x, ans=0;
  cin >> n >> k;
  for(int i=0;i<=n;i++)a[i]=0;
  for(int i=0;i<k;i++){
    cin >> d[i];
    for(int j=0;j<d[i];j++){
      cin >> x;
      a[x]=1;
    }
  }
  for(int i=1;i<=n;i++)if(a[i]==0)ans++;
  cout << ans << endl;
  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<stdio.h>

int main(void){
  int sunuke, okashi, holder, check, tmp;
  int i, j;
  
  scanf("%d" "%d", &sunuke, &okashi);
  check = 0;
  
  for(i = 1;i <= sunuke; i++){
    scanf("%d",&okashi);
    if(check =< okashi){
      check = okashi;
    }
    for(j = 1; j <= okashi; j++){
      scanf("%d", &tmp);
    }
  }
  
  sunuke = sunuke - check;
  printf("%d\n", sunuke);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:15: error: expected expression before '<' token
   12 |     if(check =< okashi){
      |               ^
Language: C

#include <stdio.h>

int main() {
	int n, k, d, a[105],check[105],count = 0;
	scanf("%d%d", &n, &k);
	for (int i = 0; i < k; k++) {
		scanf_s("%d", &d);
		for (int j = 0; j < d; j++) {
			scanf("%d", &a[j]);
			for (int l = 0; l < n; n++) {
				if (a[j] == (l + 1)) {
					check[l] = 1;
				}
 			}
		}
	}
	for (int m = 0; m < n; m++) {
		if (check[m] != 1)count += 1;
	}
	printf("%d", count);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
    7 |                 scanf_s("%d", &d);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include<stdio.h>

int main(void){
  int sunuke, okashi, holder, check, tmp;
  int i, j;
  
  scanf("%d" "%d", &sunuke, &okashi);
  check = 0;
  
  for(i = 1;i <= sunuke; i++){
    scanf("%d",&okashi);
    if(check =< okashi){
      check = okashi;
    }
    for(j = 0; j < okashi; j++){
      scanf("%d", &tmp);
    }
  }
  
  sunuke = sunuke - check;
  printf("%d\n", sunuke);
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:12:15: error: expected expression before '<' token
   12 |     if(check =< okashi){
      |               ^
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  
 for(int i=0;i<K;i++){ 
  int d;
  cin >> d;
  
  vector<int> A(d);
  for(int i=0;i<d;i++){
    cin >> A.at(i);
  }
   
  vector<int> B(N);
  for(int i=0;i<N;i++){
    if(i==0)
      B.at(0) = A.at(0);
    if(i>0)
      B.at(i) = A.at(i-1) + A.at(i);
  }
   
   int x=0;
  for(int i=0;i<N;i++){
    if(B.at(i) == 0)
      x++;
  }
 
} 


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

public class Main {
    public static void main(String[] args) {
        
        int n, k;
        Scanner scan = new Scanner(System.in);
        n = scan.nextInt();
        scan.close();
    }

    System.out.println(2);
}

Compiler output:
Main.java:10: error: <identifier> expected
    System.out.println(2);
                      ^
Main.java:10: error: illegal start of type
    System.out.println(2);
                       ^
2 errors
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  
 for(int i=0;i<K;i++){ 
  int d;
  cin >> d;
  
  vector<int> A(d);
  for(int i=0;i<d;i++){
    cin >> A.at(i);
  }
 }
  vector<int> B(N);
  for(int i=0;i<N;i++){
    if(i==0)
      B.at(0) = A.at(0);
    if(i>0)
      B.at(i) = A.at(i-1) + A.at(i);
  }
   
   int x=0;
  for(int i=0;i<N;i++){
    if(B.at(i) == 0)
      x++;
  }
 
} 


Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'A' was not declared in this scope
   20 |       B.at(0) = A.at(0);
      |                 ^
a.cc:22:17: error: 'A' was not declared in this scope
   22 |       B.at(i) = A.at(i-1) + A.at(i);
      |                 ^
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  vector<int> candy(N);
  int n = 0;
  int count = 0;
  for(int k = 0; k < K; k++) {
    cin >> dk;
    for(int d = 0; d < dk; d++) {
      cin >> n;
      candy[n]++;
    }
  }
  for(int a = 0; a < K; a++) {
    if(candy[a] == 0){
      count++;
    }
  }
  cout << count << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:12: error: 'dk' was not declared in this scope; did you mean 'k'?
   11 |     cin >> dk;
      |            ^~
      |            k
Language: C++

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


int main() {
  int N,K;
  cin >> N >> K;
  
  int sum =0
  
  vector<int> dK(K);
    for (int i = 0; i < K; i++) {
      cin >> dK.at(i);
      sum += dK.at(i);
    }
  
  vector<int> AKdK(sum);
  for(int i =0; i < K; i++){
    cin >> AKdK.at(i);
  }
    
  sort(AKdK.begin(), AKdK.end());
      
  int ans =0
    
  for (int i = 0; i < sum; i++) {
    if(AKdK[i] != AKdK[i+1]){
        ans++;
    }
  }
  
  cout << N-ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: expected ',' or ';' before 'vector'
   11 |   vector<int> dK(K);
      |   ^~~~~~
a.cc:13:14: error: 'dK' was not declared in this scope; did you mean 'K'?
   13 |       cin >> dK.at(i);
      |              ^~
      |              K
a.cc:26:3: error: expected ',' or ';' before 'for'
   26 |   for (int i = 0; i < sum; i++) {
      |   ^~~
a.cc:26:19: error: 'i' was not declared in this scope
   26 |   for (int i = 0; i < sum; i++) {
      |                   ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: invalid types 'int[int]' for array subscript
    8 |     cin>>i[k];
      |           ^
a.cc:9:11: error: conversion from 'int*' to 'long unsigned int' in a converted constant expression
    9 |     int a[d];
      |           ^
a.cc:9:11: error: could not convert 'd' from 'int [k]' to 'long unsigned int'
    9 |     int a[d];
      |           ^
      |           |
      |           int [k]
a.cc:9:11: error: size of array 'a' has non-integral type 'int [k]'
a.cc:10:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   10 |     for(int h;h<d;h++){
      |               ~^~
a.cc:14:10: error: invalid operands of types 'int' and 'int [k]' to binary 'operator-'
   14 |   cout<<n-d;
      |         ~^~
      |         | |
      |         | int [k]
      |         int
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  
 for(int i=0;i<K;i++){ 
  int d;
  cin >> d;
  
  vector<int> A(d);
  for(int i=0;i<d;i++){
    cin >> A.at(i);
  }
  
  vector<int> B(N);
  for(int i=0;i<N;i++){
    if(i==0)
      B.at(0) = A.at(0);
    if(i>0)
      B.at(i) = A.at(i-1) + A.at(i);
  }
   
   int x=0;
  for(int i=0;i<N;i++){
    if(B.at(i) == 0)
      x++;
  }
 } 
  
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:11: error: 'x' was not declared in this scope
   32 |   cout << x << endl;
      |           ^
Language: C++

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


int main() {
  int N,K;
  cin >> N >> K;
  
  int sum =0
  
  rep(i,K){
    vector<int> dK(K);
    for (int i = 0; i < K; i++) {
      cin >> dK.at(i);
      sum += dK.at(i);
    }
  }
  vector<int> AKdK(sum);
  for(int i =0; i < K; i++){
    cin >> AKdK.at(i);
  }
    
  sort(AKdK.begin(), AKdK.end());
      
  int ans =0
    
  for (int i = 0; i < sum; i++) {
    if(AKdK[i] != AKdK[i+1]){
        ans++;
    }
  }
  
  cout << N-ans <<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:20: error: expected unqualified-id before 'for'
    3 | #define rep(i, n) ,for (int i = 0; i < (int)(n); i++)
      |                    ^~~
a.cc:12:3: note: in expansion of macro 'rep'
   12 |   rep(i,K){
      |   ^~~
a.cc:12:7: error: 'i' was not declared in this scope
   12 |   rep(i,K){
      |       ^
a.cc:3:36: note: in definition of macro 'rep'
    3 | #define rep(i, n) ,for (int i = 0; i < (int)(n); i++)
      |                                    ^
a.cc:28:3: error: expected ',' or ';' before 'for'
   28 |   for (int i = 0; i < sum; i++) {
      |   ^~~
Language: C++

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

int main() {
  int N,K;
  cin >> N >> K;
  
 for(int i=0;i<K;i++){ 
  int d;
  cin >> d;
  
  vector<int> A(d);
  for(int i=0;i<d;i++){
    cin >> A.at(i);
  }
  
  vector<int> B(N);
  for(int i=0;i<N;i++){
    if(i==0)
      B.at(0) = A.at(0);
    if(i>0)
      B.at(i) = A.at(i-1) + A.at(i);
  }
 } 
  int x=0;
  for(int i=0;i<N;i++){
    if(B.at(i) == 0)
      x++;
  }
  
  cout << x << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:8: error: 'B' was not declared in this scope
   27 |     if(B.at(i) == 0)
      |        ^
Language: C

#include<stdio.h>
int main(void){

char N,K,i,j;
scanf("%d,%d",&N,&K);
char d[K+1];
char result[N+1];
char A_a[K][101];

for(i=0;i<N;i++){
  result[i]=0;
}

for(i=0;i<K;i++){
  scanf("%d",&d[i]);
  int A[d[i]+1];
  for(j=0;j<d[i];j++){
    scanf("%d",&A[j]);
    A_a[i][j]=A[j];
    A_a[i][j+1]=0;
  }
}

for(i=0;i<N;i++){
  for(j=0;j<d[i];j++){
  result[A_a[i][j]]++;
  }
}
k=0;
for(i=0;i<N;i++){
  if(result[i]==0){
    k++;
  }
}

printf("%d",k);

return 0;
}

Compiler output:
main.c: In function 'main':
main.c:29:1: error: 'k' undeclared (first use in this function)
   29 | k=0;
      | ^
main.c:29:1: note: each undeclared identifier is reported only once for each function it appears in