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

#include<iostream>
#include<iomanip>
#include<algorithm>
#include<math.h>
#include<vector>
using namespace std;

int main() {
	unsigned int n;

	cin >> n;
	vector<unsigned int> a_Data;
	a_Data.push_back(0);
	for (unsigned int i = 1; i < n; i++) 
	{
		int buf;
		cin >> buf;
		a_Data.push_back(buf);
	}

	int ans_Buf = 0;
	for (int i = 0; i < n; i++) 
	{
		int a_buf = 0;
		ans_Buf = 0;
		for (int j = 0; i + j < n; j++)
		{
			if (a_Data[i] + 1 == a_Data[i + j])
				ans_Buf++;
		}
		cout <<ans_Buf << endl;
	}

	return 0;
}

Compiler output:
main.c:1:9: 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, A[N], S[N+1];
    cin >> N;
    for(int i = 1; i <= n; i++) {
        S[i]=0;
    }
    for(int i = 1; i < n; i++) {
        cin >> A[i];
        S[A[i]]++;
    }
    for(int i = 1; i <= n; i++) {
        cout << S[i] << endl;
    }
}


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

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

int main() {
    int N;
    cin >> N;
    vector<int> A(N + 1, 0);
    for(int i = 2; i <= N; i++) {
    cin >> A[i];
    }
    vector<int> C(N, 0);
    for(int i = 2; i <= N; i++) {
        C[A[i]]++;
    }
    for(int i = 1; i <= N; i++) {
        cout << C[i] << 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 <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template<class F>auto recursive(F f){return[f](auto...a){return f(f,a...);};}
template<class I,class V=typename I::value_type>V sum_up(const I&l,const I&r){V v;for(I i=l;i!=r;i++)v=i==l?*i:v+*i;return v;}
template<class I,class T=iterator_traits<I>>I operator+(I it,int n){for(int i=0;i<n;i++)it++;return it;}
template<class I,class T=iterator_traits<I>>I operator-(I it,int n){for(int i=0;i<n;i++)it--;return it;}
template<class T>using rev_priority_queue=priority_queue<T,vector<T>,greater<T>>;
template<class T>using vector2d=vector<vector<T>>;
struct fixprec{int p;fixprec(int p):p(p){}};
ostream&operator<<(ostream&o,fixprec f){return o<<fixed<<setprecision(f.p);}
void R_YESNO(bool p){cout<<(p?"YES":"NO")<<endl;}
void R_YesNo(bool p){cout<<(p?"Yes":"No")<<endl;}
int main() {
    int N;
    cin >> N;
    vector<int> ans(N);
    for(int i = 1; i < N; i++) {
        int a;
        cin >> a;
        a--;
        ans[a]++;
    }
    for(int i = 0; i < N; i++) {
        cout << ans[i] << 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>
#include <stdlib.h>
#define max 2*100000

int bossy(int x,int n,int boss[])
{
    int dabang=0;

    for(j=1;j<n;j++)
    {
        if(boss[j]==x)dabang++;
    }
    printf("%d ",j);
    return dabang;
}
int main()
{
   int n,i,boss[max];
   scanf("%d",&n);
   for(i=1;i<n;i++)
   {
       scanf("%d",&boss[i]);
   }
   for(i=1;i<=n;i++)
   {
       printf("%d\n",bossy(i,n,boss));
   }
    return 0;
}

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

#include <stdio.h>

int main()
{
	long n;
	scanf("%ld", &n);
	a[n + 1];
	b[n + 1];
	long i,j;
	i = 1;
	while (i <= n)
		b[i++] = 0;
	i = 1;
	while (i < n)
	{
		scanf("%ld", &a[i]);
		b[a[i]] += 1;
		i++;
	}
	i = 1;
	while (i <= n)
		printf("%ld\n", b[i++]);
}


Compiler output:
main.c: In function 'main':
main.c:7:9: error: 'a' undeclared (first use in this function)
    7 |         a[n + 1];
      |         ^
main.c:7:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:9: error: 'b' undeclared (first use in this function)
    8 |         b[n + 1];
      |         ^
Language: C++

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

int main() {
    long long n;
    cin >> n;

    vector<long long> A(n);
    vector<long long> B(n);
  
    ios::sync_with_stdio(false);
  
    for(long long i=1; i<n; i++){
        cin >> A.at(i);
        B.at(A.at(i)-1)+=1;
    }

    for(long long i=0; i<n; i++){
        cout << B.at(i) << \n;
    }
  
    return 0;
}


Compiler output:
a.cc:19:28: error: stray '\' in program
   19 |         cout << B.at(i) << \n;
      |                            ^
Language: Java

import java.util.*;
 
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        List<Integer> list = new ArrayList<Integer>();
      for(int i=1; i<=N; i++){
        list = list.add(0);
      }
        for(int i=1; i<N; i++){
          int Ai = sc.nextInt();
          list[i-1] += 1;
        }
      for(int i=0; i<=N; i++){
      System.out.println(list.get(N));
      }
    }
}

Compiler output:
Main.java:9: error: incompatible types: boolean cannot be converted to List<Integer>
        list = list.add(0);
                       ^
Main.java:13: error: array required, but List<Integer> found
          list[i-1] += 1;
              ^
2 errors
Language: C

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
 
int main() {
  	int N;
  	cin >> N;
  
  	int *A = (int *)malloc(sizeof(int)*N);
    if (A == NULL) {
        printf("Memory cannot be allocated.");
    }
  
	for(int i=1; i<=N-1; i++){
    	cin >> A[i];
    }
  	
  	int *Out = (int *)malloc(sizeof(int)*N);
    if (Out == NULL) {
        printf("Memory cannot be allocated.");
    }
  	for(int i=0;i < N; i++){
		Out[i]=0;
    }
  
  	int num;
  	for(int i=1;i <=N-1; i++){
		num=A[i];
      	Out[num-1]++;
    }
  	for(int i=0;i < N;i++){
    	cout << Out[i] << 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 <iostream>

using namespace std;
 
    
    
int main(){
  int n;
  cin>>n;
  int num[n-1];

  for (int i = 0; i < n-1; i++)
  {
    cin>>num[i];
  }
  
  int buka[n]={};
 for (int i = 0; i < n-1; i++)
  {
    buka[num[i]-1]=buka[num[i]-1]+1;
  }
 
  for (int i = 0; i < n; i++)
  {
    cout<<buka[i]<<endl;
  }
  
    return 0;
}

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

import java.util.Scanner;
class Main{
  public static void main(String args[]){
    int N;
    int[] josi;
    Scanner sc = new Scanner(System.in)
    josi = new Int[sc.nextInt()];
    for(int i =0;i<josi.length-1;i++){
      josi[sc.nextInt()-1]++;
    }
    for(int i = 0;i<josi.length;i++){
      System.out.println(josi[i]);
    }
  }
}

Compiler output:
Main.java:6: error: ';' expected
    Scanner sc = new Scanner(System.in)
                                       ^
1 error
Language: C++

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

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define endl '\n';
#define FASTER ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const ll POSITIVE_INFINITY = 9223372036854775807;
const ll NEGATIVE_INFINITY = -9223372036854775807;
const ll MOD = 1000000007;
const ld PI = acos(-1.0);

template <typename T> inline T bigMod(T A,T B,T M = MOD){A %= M;T ret = 1;while(B){if(B & 1) ret = (ret * A) % M;A = (A * A) % M;B = B >> 1;}return ret;}
template <typename T> inline T invMod (T A,T M = MOD){return bigMod(A,M-2,M);}

const int N = 200005;

bool vis[N + 5];
int cost[N + 5];
vector<int>g[N + 5];
int n;
void dfs(int u){
  vis[u] = true;
  cost[u] = 1;
  for (int v : g[u]){
    if (vis[v] == false){
      dfs(v); 
      cost[u] += cost[v];
    }
  }
}

int main(){
  FASTER;
  cin >> n;
  for (int i = 1; i < n; i++){
    int x;
    cin >> x;
    cost[x]++;
  }
  for (int i = 1; i <= n; i++){
    cout << cost[x] << "\n";
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:18: error: 'x' was not declared in this scope
   43 |     cout << cost[x] << "\n";
      |                  ^
Language: C++

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

int a[200010];
int ans[200010];

   int main(){
   int n;
   scanf("%d",&n);
   for(int i=2;i<=n;i++)scanf("%d",&a[i]);
   for(int i=2;i<=n;i++)ans[a[i]]++;
   for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
   }

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

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

int main() {
  int N;
  cin >> N;
  vector<int> boss(N - 1);
  for (int i = 0; i < N - 1; i++) {
    cin >> boss.at(i);
  }
  sort(boss.begin(), boss.end());
  reverce(boss.begin(), boss.end());
  for (int number = 1; number < N + 1; number++) {
    int ans = 0;
    for (int i = boss.size(); i > 0; i--) {
      if (boss.at(boss.size() - i) == number) {
        ans++;
      }
      else if (boss.at(boss.size() - i) > number) {
        break;
      }
    }
    cout << ans << endl;
    for (int i = 0; i < ans; i++) {
      boss.pop_back();
    }
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:3: error: 'reverce' was not declared in this scope
   12 |   reverce(boss.begin(), boss.end());
      |   ^~~~~~~
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: 'n' was not declared in this scope
    7 |     int mp[n];
      |            ^
a.cc:11:14: error: 's' was not declared in this scope
   11 |         cin>>s[i];
      |              ^
a.cc:12:9: error: 'mp' was not declared in this scope
   12 |         mp[s[i]]++;
      |         ^~
a.cc:16:15: error: 'mp' was not declared in this scope
   16 |         cout<<mp[s[i]]<<endl;
      |               ^~
a.cc:16:18: error: 's' was not declared in this scope
   16 |         cout<<mp[s[i]]<<endl;
      |                  ^
Language: C++

vector<int> a;
vector<int> ans;
int main(){
int n;
cin >> n;
for(int i=2;i<=n;i++) cin >> a.at(i);
for(int i=2;i<=n;i++) ans.at(a.at(i))++;
for(int i=1;i<=n;i++) cout << ans.at(i) << endl;
}


Compiler output:
a.cc:1:1: error: 'vector' does not name a type
    1 | vector<int> a;
      | ^~~~~~
a.cc:2:1: error: 'vector' does not name a type
    2 | vector<int> ans;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'cin' was not declared in this scope
    5 | cin >> n;
      | ^~~
a.cc:6:30: error: 'a' was not declared in this scope
    6 | for(int i=2;i<=n;i++) cin >> a.at(i);
      |                              ^
a.cc:7:23: error: 'ans' was not declared in this scope
    7 | for(int i=2;i<=n;i++) ans.at(a.at(i))++;
      |                       ^~~
a.cc:7:30: error: 'a' was not declared in this scope
    7 | for(int i=2;i<=n;i++) ans.at(a.at(i))++;
      |                              ^
a.cc:8:23: error: 'cout' was not declared in this scope
    8 | for(int i=1;i<=n;i++) cout << ans.at(i) << endl;
      |                       ^~~~
a.cc:8:31: error: 'ans' was not declared in this scope
    8 | for(int i=1;i<=n;i++) cout << ans.at(i) << endl;
      |                               ^~~
a.cc:8:44: error: 'endl' was not declared in this scope
    8 | for(int i=1;i<=n;i++) cout << ans.at(i) << endl;
      |                                            ^~~~
Language: C

#include<stdio.h>
#include<iostream>
using namespace std;

int main(){

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

  for(i=0; i<n-1; i++){
    cin>>A;
    a[A]=a[A]+1;
  }

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


  return 0;
}

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

int a[200010];
int ans[200010];
int main(){
int n;
scanf("%d",&n);
for(int i=2;i<=n;i++)scanf("%d",&a[i]);
for(int i=2;i<=n;i++)ans[a[i]]++;
for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'scanf' was not declared in this scope
    5 | scanf("%d",&n);
      | ^~~~~
a.cc:8:22: error: 'printf' was not declared in this scope
    8 | for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
      |                      ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a[200010];
Language: Java

import java.util.*;
 
class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        Integer a[] = new Integer[N];
        for (int i=0; i<N-1; i++) {
            a[i] = Integer.parseInt(sc.next());
        }
        
         Integer t[] = new Integer[N];
        
      	PrintWriter out = new PrintWriter(System.out);
        for (int i=1; i<=N; i++) {
        	int s = 0;
        	if(Arrays.asList(a).contains(i)){
	        	for (int A=i-1; A<N-1; A++) {
	            	if(i == a[A])
	            		s += 1;
	        	}
        	}
        	out.println(s);
        }
      out.flush();
    }
}

Compiler output:
Main.java:14: error: cannot find symbol
      	PrintWriter out = new PrintWriter(System.out);
      	^
  symbol:   class PrintWriter
  location: class Main
Main.java:14: error: cannot find symbol
      	PrintWriter out = new PrintWriter(System.out);
      	                      ^
  symbol:   class PrintWriter
  location: class Main
2 errors
Language: C++

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

int ar[1000005];

int main()
{
    int n,a;
    cin>>n;
    for(int i=1;i<=n-1;i++){
        cin>>a;
        ar[a]++;
    }
    for(int i=1;i<=n;i++)
        cout<<ar[i]<<endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: expected '}' at end of input
   15 |         cout<<ar[i]<<endl;
      |                           ^
a.cc:7:1: note: to match this '{'
    7 | {
      | ^
Language: C++

int a[200010];
2 int ans[200010];
3 int main(){
4 int n;
5 scanf("%d",&n);
6 for(int i=2;i<=n;i++)scanf("%d",&a[i]);
7 for(int i=2;i<=n;i++)ans[a[i]]++;
8 for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
9 }


Compiler output:
a.cc:2:1: error: expected unqualified-id before numeric constant
    2 | 2 int ans[200010];
      | ^
a.cc:3:1: error: expected unqualified-id before numeric constant
    3 | 3 int main(){
      | ^
Language: C++

int a[200010];
int ans[200010];
int main(){
int n;
scanf("%d",&n);
for(int i=2;i<=n;i++)scanf("%d",&a[i]);
for(int i=2;i<=n;i++)ans[a[i]]++;
for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:1: error: 'scanf' was not declared in this scope
    5 | scanf("%d",&n);
      | ^~~~~
a.cc:8:22: error: 'printf' was not declared in this scope
    8 | for(int i=1;i<=n;i++)printf("%d\n",ans[i]);
      |                      ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int a[200010];
Language: C

a=[0]*int(input())
for i in input().split():a[int(i)-1]+=1
print(*a)


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | a=[0]*int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'a' [-Wimplicit-int]
main.c:1:3: error: expected expression before '[' token
    1 | a=[0]*int(input())
      |   ^
Language: C

#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    int n, val;
    cin >> n;
    vector<int> arr(n+1, 0);
    for(int i = 0; i < n-1; i++) {
        cin >> val;
        arr[val] += 1;
    }
    for(int i = 1; i <= n; i++)
        cout << arr[i] << endl;
    return 0;
}



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

#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
  cin>>n;
  int a[n];
  int b[n+1]={0};
  for(int i=0;i<n-1;++i)
  {
    cin>>a[i];
  	b[a[i]]++;
  }
  for(int i=1;i<=n;++i)
    cout<<b[i]<<"\n";

Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: expected '}' at end of input
   14 |     cout<<b[i]<<"\n";
      |                      ^
a.cc:3:11: note: to match this '{'
    3 | int main(){
      |           ^
Language: C

#include <stdio.h>

int N;
int s[1000000]={0};
scanf("%d", &N);
int c;
for(int i=0; i<N-1; i++){
  scanf("%d",&c);
  s[c-1]++;
}
for(int i=0; i<N; i++)
  printf("%d", s[i]);

Compiler output:
main.c:5:7: error: expected declaration specifiers or '...' before string constant
    5 | scanf("%d", &N);
      |       ^~~~
main.c:5:13: error: expected declaration specifiers or '...' before '&' token
    5 | scanf("%d", &N);
      |             ^
main.c:7:1: error: expected identifier or '(' before 'for'
    7 | for(int i=0; i<N-1; i++){
      | ^~~
main.c:7:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    7 | for(int i=0; i<N-1; i++){
      |               ^
main.c:7:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
    7 | for(int i=0; i<N-1; i++){
      |                      ^~
main.c:11:1: error: expected identifier or '(' before 'for'
   11 | for(int i=0; i<N; i++)
      | ^~~
main.c:11:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   11 | for(int i=0; i<N; i++)
      |               ^
main.c:11:20: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   11 | for(int i=0; i<N; i++)
      |                    ^~
Language: C++

N = int(input())
emp = list(map(int,input().split()))
ans_l = [0]*(N+1)
for i in range(N-1):
    a = emp[i]
    ans_l[a] +=1
for i in range(1,N+1):
    print(ans_l[i])


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

#include <bits/stdc++.h>
#include <math.h>
using namespace std;
 
int main() {
  	int N;
  	cin >> N;
  
  	int *A = (int *)malloc(sizeof(int)*(N-1));
    if (A == NULL) {
        printf("Memory cannot be allocated.");
    }
  
	for(int i=1; i<N-1; i++){
    	cin >> A[i];
    }
  	
  	int *Out = (int *)malloc(sizeof(int)*(N-1));
    if (Out == NULL) {
        printf("Memory cannot be allocated.");
    }
  
  	int num=1;
  	int j;
  	for(i=1;i < N-1; i++){
    	if(A[i]=num){
        	Out[j]++; 
        }
      	else{
          	j++;
          	i--;
        }
    }
  	for(i=1;i<N-1;i++){
    	cout << Out[i] << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:25:13: error: 'i' was not declared in this scope
   25 |         for(i=1;i < N-1; i++){
      |             ^
a.cc:34:13: error: 'i' was not declared in this scope
   34 |         for(i=1;i<N-1;i++){
      |             ^
Language: C

#include<bits/stdc++.h>
using namespace std;
int main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n;
  cin>>n;
  long long int a[n];
  vector<long long int>v(n,0);
  for(long long int i=0;i<n;i++)
  {
    cin>>a[i];
    v[a[i]-1]+=1;
  }
  for(long long int i=0;i<n;i++)
    cout<<v[i]<<endl;
  return 0;
}

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

#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef long double ld;
const double pi=acos(-1.0);
const ll mod=pow(10,9)+7;
const ll INF=pow(2,31)-1;
typedef pair<int,int> P;
typedef vector<int> vi;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

ll gcd(ll a , ll b){
	if(b == 0) return a;
	return gcd(b , a % b);	
}
ll lcm(ll a , ll b){
	ll g = gcd(a , b);
	ll lc = (a/g) * b;
	return lc;
}

int MAX_N=200000;

int main(){
    ios::sync_with_stdio(false);
    int n;
    int boss[MAX_N+5]={};
    int a[MAX_N+5];
    cin >> n;
    rep(i,n-1){
        cin >> a[i];
        boss[a[i]]++;
    }
    for(int i=1;i<(n+1);i++){
        cout << boss[i] << endl;
    }
    return 0;
}

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


import sun.management.counter.Counter;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] result = new int[num + 1];
        Map<Integer, Integer> map = new HashMap<Integer, Integer>();
        for (int i = 2; i <= num; i++)
                map.put(i, sc.nextInt());
        for (int i = 1; i <= num; i++) {
            for (int j = 1; j <= num; j++){
                if (map.getOrDefault(j,0) == i){
                    result[i]++;
                    map.remove(j);
                }
            }
        }
        for (int i = 1; i <= num; i++){
            System.out.println(result[i]);
        }
    }
}


Compiler output:
Main.java:2: error: package sun.management.counter is not visible
import sun.management.counter.Counter;
                     ^
  (package sun.management.counter is declared in module java.management, which does not export it to the unnamed module)
1 error
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <string.h>
int main(void) {
int N ;
scanf("%d",&N);
int array[N+1];
array[1]=1;
int count[N+1];
for (i = 0 ; i <M-1)

for (int i = 2;i<=N;i++)
{
    scanf("%d",&array[i]);
    count[array[i]]++;
}
for (int i = 1 ; i<=N;i++)
{
printf("%d\n",count[i]);
}
 return EXIT_SUCCESS;
}


Compiler output:
main.c: In function 'main':
main.c:12:6: error: 'i' undeclared (first use in this function)
   12 | for (i = 0 ; i <M-1)
      |      ^
main.c:12:6: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:17: error: 'M' undeclared (first use in this function)
   12 | for (i = 0 ; i <M-1)
      |                 ^
main.c:12:20: error: expected ';' before ')' token
   12 | for (i = 0 ; i <M-1)
      |                    ^
      |                    ;
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int n,m,i,c[100005],a,b,v,k,t[100005];
set<int> g[100005];
vector<int>first_half;
vector<int>second_half;
vector<int>total;
int par[209],group[209];
int arra[150000];
vector<int>arr;
map<char,int>cp;
map<int,int>mp;
deque<char>stp1;
deque<char>stp2;
map<int,int>pos;
map<string,int>check;
map<string,string>server;
vector<string>ans1;
vector<string>ans2;
vector<string>ans3;
string server1[1009];
string ip1[1009];
string server2[1009];
string ip2[1009];
ll cashier[109];
ll fir[109];
ll sec[100009];
int main()
{
  	
  ll a,b,c=1,d,e,f,g,h,i,j,k,l,n,s1=1,s2=1,m1=5,m2=15,t,m;
  //cin>>t;
  
  cin>>n;
  for(i=1;i<n;i++)
  {
    cin>>a;
    mp[a]++;	
  }
  for(i=1;i<=n;i++)
    cout<<mp[i]<<'\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>
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define f first
	#define s second
	#define rf freopen("inputf.in" ,"r", stdin)
	#define wf freopen("outputf.in" ,"w", stdout)
	#define  w(data) while(data--)
	#define in(input1) cin>>input1 
	#define out(input2) std::cout<<input2<<endl
	#define start int main(void) 
	#define fast ios_base::sync_with_stdio(false); cin.tie(NULL)
	#define it int a,b,temp,c,d,e,f,g,h,l,m,n,o,p,min1,max1,temp_min1,temp_max1,min_index,max_index
	#define st string s1,s2,s3;
	#define ma 1000000
	int arr[ma];
	using namespace std;
	start{//rf;wf;
	fast;it;st;
	in(a);d=a;
	for (int i = 0; i < ma; ++i)
	{arr[i]=0;
		/* code */
	}
	for (int i = 0; i < a-1; ++i)
	{in(temp);
		arr[temp]+=1;//out(arr[temp]);
	}
	for(int i=1;i<ma;i++){
		if(arr[i]==0){
			c=i;break;
		}
	}
	for (int i = 1; i <c ; ++i)
	{out(arr[i]);d--;
		/* code */
	}

	for (int i = 0; i <d; ++i)
	{out("0");
		/* code */
	}
	}

Compiler output:
main.c:1:18: 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 A,B;
  cin>>A;
  int N[A-1];
  int M[A]={};
  for(int i = 0;i < A-1;i++){
    cin>>N[i];
    M[N[i]]++;
  }
  for(int i  = 0;i < A:i++)cout<<M[i]<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:18: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   13 |   for(int i  = 0;i < A:i++)cout<<M[i]<<endl;
      |                  ^
a.cc:13:23: error: found ':' in nested-name-specifier, expected '::'
   13 |   for(int i  = 0;i < A:i++)cout<<M[i]<<endl;
      |                       ^
      |                       ::
a.cc:13:22: error: 'A' is not a class, namespace, or enumeration
   13 |   for(int i  = 0;i < A:i++)cout<<M[i]<<endl;
      |                      ^
a.cc:14:1: error: expected primary-expression before '}' token
   14 | }
      | ^
a.cc:13:45: error: expected ';' before '}' token
   13 |   for(int i  = 0;i < A:i++)cout<<M[i]<<endl;
      |                                             ^
      |                                             ;
   14 | }
      | ~                                            
a.cc:14:1: error: expected primary-expression before '}' token
   14 | }
      | ^
a.cc:13:45: error: expected ')' before '}' token
   13 |   for(int i  = 0;i < A:i++)cout<<M[i]<<endl;
      |      ~                                      ^
      |                                             )
   14 | }
      | ~                                            
a.cc:14:1: error: expected primary-expression before '}' token
   14 | }
      | ^
Language: Java

import java.util.*;
public class main{
  public static void main(String[] args){
    Scanner scn = new Scanner(System.in);
    Map<Integer,Integer> map = new HashMap<Integer,Integer>();
    int n = scn.nextInt();
    int []arr = new int[n];
    for(int i=1;i<n;i++){
      arr[i] = scn.nextInt();
    }
    for(int i=1;i<arr.length;i++){
      if(map.containsKey(arr[i])){
        int val = map.get(arr[i]) + 1;
        map.put(arr[i],val);
      }else{
        map.put(arr[i],1);
      } 
 }
  for(int i=1;i<arr.length;i++){
    int val = map.get(arr[i]);
    System.out.println(val);
  }
    
    
  
  
  
  
  
  
  
  
  
  
  
  }
  
}
  
  
  
  
  
  


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

#include <iostream>
#include <algorithm>
#include <cstdlib>
using namespace std;
int i,j,k,N;

int main(){
    cin >> N;
    vector<int> v(N);
    for (i = 0; i < N; i++) {
      cin >> v.at(i);
    }
    for (i = 1; i <= N; i++){
        cout << count(v.begin(), v.end(), i) << endl;
    }
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'vector' was not declared in this scope
    9 |     vector<int> v(N);
      |     ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <cstdlib>
  +++ |+#include <vector>
    4 | using namespace std;
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> v(N);
      |            ^~~
a.cc:11:14: error: 'v' was not declared in this scope
   11 |       cin >> v.at(i);
      |              ^
a.cc:14:23: error: 'v' was not declared in this scope
   14 |         cout << count(v.begin(), v.end(), i) << endl;
      |                       ^
Language: Java

import java.util.*;
public class program{
  public static void main(String[] args){
    Scanner scn = new Scanner(System.in);
    Map<Integer,Integer> map = new HashMap<Integer,Integer>();
    int n = scn.nextInt();
    int []arr = new int[n];
    for(int i=1;i<n;i++){
      arr[i] = scn.nextInt();
    }
    for(int i=1;i<arr.length;i++){
      if(map.containsKey(arr[i])){
        int val = map.get(arr[i]) + 1;
        map.put(arr[i],val);
      }else{
        map.put(arr[i],1);
      } 
 }
  for(int i=1;i<arr.length;i++){
    int val = map.get(arr[i]);
    System.out.println(val);
  }
    
    
  
  
  
  
  
  
  
  
  
  
  
  }
  
}
  
  
  
  
  
  


Compiler output:
Main.java:2: error: class program is public, should be declared in a file named program.java
public class program{
       ^
1 error
Language: Java

import java.util.*;
public class program{
  public static void main(String[] args){
    Scanner scn = new Scanner(System.in);
    Map<Integer,Integer> map = new HashMap<Integer,Integer>();
    int n = scn.nextInt();
    int []arr = new int[n];
    for(int i=1;i<n;i++){
      arr[i] = scn.nextInt();
    }
    for(int i=1;i<arr.length;i++){
      if(map.containsKey(arr[i])){
        int val = map.get(x) + 1;
        map.put(x,val);
      }else{
        map.put(x,1);
      } 
 }
  for(int i=1;i<arr.length;i++){
    int val = map.get(arr[i]);
    System.out.println(val);
  }
    
    
  
  
  
  
  
  
  
  
  
  
  
  }
  
}
  
  
  
  
  
  


Compiler output:
Main.java:2: error: class program is public, should be declared in a file named program.java
public class program{
       ^
Main.java:13: error: cannot find symbol
        int val = map.get(x) + 1;
                          ^
  symbol:   variable x
  location: class program
Main.java:14: error: cannot find symbol
        map.put(x,val);
                ^
  symbol:   variable x
  location: class program
Main.java:16: error: cannot find symbol
        map.put(x,1);
                ^
  symbol:   variable x
  location: class program
4 errors
Language: Java

import java.util.*;
public class program{
  public static void main(String[] args){
    Scanner scn = new Scanner(System.in);
    Map<Integer,Integer> map = new HashMap<Integer,Integer>();
    int n = scn.nextInt();
    int []arr = new int[n];
    for(int i=1;i<n;i++){
      arr[i] = scn.nextInt();
    }
    for(int i=1;i<arr.length;i++){
      if(map.containsKey(arr[i]){
        int val = map.get(x) + 1;
        map.put(x,val);
      }else{
        map.put(x,1);
      } 
 }
  for(int i=1;i<arr.length;i++){
    int val = map.get(arr[i]);
    System.out.println(val);
  }
    
    
  
  
  
  
  
  
  
  
  
  
  
  
  
}
  
  
  
  
  
  

Compiler output:
Main.java:12: error: ')' expected
      if(map.containsKey(arr[i]){
                                ^
Main.java:38: error: reached end of file while parsing
}
 ^
2 errors
Language: C

int main(void){
int n;
int a[200000];
int list[200000];

cin>>n;

for(int i=0;i<200000;i++)list[i]=0;
for(int i=1;i<n;i++){
cin>>a[i];
list[a[i]-1]++;
}
for(int i=0;i<n;i++){
cout<<list[i]<<endl;
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:1: error: 'cin' undeclared (first use in this function)
    6 | cin>>n;
      | ^~~
main.c:6:1: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:1: error: 'cout' undeclared (first use in this function)
   14 | cout<<list[i]<<endl;
      | ^~~~
main.c:14:16: error: 'endl' undeclared (first use in this function)
   14 | cout<<list[i]<<endl;
      |                ^~~~
Language: C++

int main(void) {
	int n, i, j;
	std::cin >> n;
	std::vector<int> a(n);
	std::vector<int> c(n);

	for (i = 0; i < n-1; i++) {
		std::cin >> a[i];
	}
	for (i = 0; i < n; i++) {
		c [i]= 0;
		for (j = 0; j < n; j++) {
			if (a[j] == i + 1)
				c[i]++;
		}
	}
	for (i = 0; i < n-1; i++) {
		printf("%d\n", c[i]);
	}
}	

Compiler output:
a.cc: In function 'int main()':
a.cc:3:14: error: 'cin' is not a member of 'std'
    3 |         std::cin >> n;
      |              ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | int main(void) {
a.cc:4:14: error: 'vector' is not a member of 'std'
    4 |         std::vector<int> a(n);
      |              ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | int main(void) {
a.cc:4:21: error: expected primary-expression before 'int'
    4 |         std::vector<int> a(n);
      |                     ^~~
a.cc:5:14: error: 'vector' is not a member of 'std'
    5 |         std::vector<int> c(n);
      |              ^~~~~~
a.cc:5:14: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
a.cc:5:21: error: expected primary-expression before 'int'
    5 |         std::vector<int> c(n);
      |                     ^~~
a.cc:8:22: error: 'cin' is not a member of 'std'
    8 |                 std::cin >> a[i];
      |                      ^~~
a.cc:8:22: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:8:29: error: 'a' was not declared in this scope
    8 |                 std::cin >> a[i];
      |                             ^
a.cc:11:17: error: 'c' was not declared in this scope
   11 |                 c [i]= 0;
      |                 ^
a.cc:13:29: error: 'a' was not declared in this scope
   13 |                         if (a[j] == i + 1)
      |                             ^
a.cc:18:32: error: 'c' was not declared in this scope
   18 |                 printf("%d\n", c[i]);
      |                                ^
a.cc:18:17: error: 'printf' was not declared in this scope
   18 |                 printf("%d\n", c[i]);
      |                 ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(void) {
Language: C++

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

int main() {
  
  int N;
  cin >> N;
  
  vector<int> vec(N);
  
  for (int i =0;i < N - 1;i++){
    cin >> vec.at(i)
  }
  
  int i
    
  if(vec.at(i) == 1){
    
  
     
             
      
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: expected ';' before '}' token
   12 |     cin >> vec.at(i)
      |                     ^
      |                     ;
   13 |   }
      |   ~                  
a.cc:17:3: error: expected initializer before 'if'
   17 |   if(vec.at(i) == 1){
      |   ^~
a.cc:24:2: error: expected '}' at end of input
   24 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected primary-expression before '<' token
   11 |   for(int i=1; i =< n; i++){
      |                   ^
Language: C

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

int main(){
int N;
  cin >> N;
  
  for(int j=0; j<N; j++){
 int sum=0;
  for(int i=0; i<N-1; i++){
    int A;
    cin >> A;
    if (A==j+1){
      sum+=1;
    }
  }
    cout << sum << endl;
    sum=0; 
        
  }
}




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

#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
int main(){
    int n;cin>>n;
    vector<int> A(n),B(n-1);
    A[0]=1;
    for(int i=1;i<n;i++)cin>>A[i];B[i-1]=i;
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(j<A[i])B[j]++;
        }
    }
    for(int i=0;i<n-1;i++){
        cout<<B[i]<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:37: error: 'i' was not declared in this scope
    8 |     for(int i=1;i<n;i++)cin>>A[i];B[i-1]=i;
      |                                     ^
Language: C

#include <stdio.h>

int main (void) {
    int N;

    scanf("%d", &N);

    int A[N];
    int B[N];

    for (int i = 0; i < N; i++) {
        B[i] = 0;
    }
    A[0] = 0;

    for (int i = 1; i < N; i++) {
        int j = 1;
        scanf("%d", &A[i]);
        
        wihle (j != A[i]) {
            j++;
        }
        B[j - 1]++;
    }

    for (int i = 0; i < N; i++){
        printf ("%d\n", B[i]);
    }
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:9: error: implicit declaration of function 'wihle' [-Wimplicit-function-declaration]
   20 |         wihle (j != A[i]) {
      |         ^~~~~
main.c:20:26: error: expected ';' before '{' token
   20 |         wihle (j != A[i]) {
      |                          ^~
      |                          ;
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected primary-expression before '<' token
   11 |   for(int i=1; i =< n; i++){
      |                   ^
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int> vec(N-1);
  for(int i=0;i<N-1;i++){
cin>>vec[i];
  }
  
  
    
for(int i=0;i<N-1;i++){
for(int j=0;j<N-1;j++){
  int sum(j)=0;
if(vec[i]==j){
  sum(j)++;
}




for(int i=0;i<N-1;i++){
cout<<sum(i)<<endl;
}

  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: expected ',' or ';' before '=' token
   16 |   int sum(j)=0;
      |             ^
a.cc:18:6: error: 'sum' cannot be used as a function
   18 |   sum(j)++;
      |   ~~~^~~
a.cc:25:10: error: 'sum' cannot be used as a function
   25 | cout<<sum(i)<<endl;
      |       ~~~^~~
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:14:23: note: to match this '{'
   14 | for(int i=0;i<N-1;i++){
      |                       ^
a.cc:29:2: error: expected '}' at end of input
   29 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: Java

package main.task163;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.io.PrintWriter;
import java.util.stream.Collectors;

public class C {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
      int N = in.nextInt();
      int[] list = new int[N];

      for (int i = 1; i < N; i++) {
        list[i] = in.nextInt();
      }

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

        for (int l : list) {
          if (i == l) res++;
        }
        out.print(res + "\n");
      }
    }
}


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

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N-1; i++) {
    cin >> data.at(i);
  }
  data.at(N-1) = 30000000;
  sort(data.begin(), data.end());
  
  vector<int> ans(N);
  for (int i = 0; i < N-1; i++) {
    if (data.at(i) < data.at(i+1)) {
      ans.at(data.at(i)-1) = i+1;
    }
    else {
      continue;
    }
  }
  cout << ans.at(0) << endl;
  for (int i = 1; i < N; i++) {
    if (ans.at(i) == 0) {
      ans.at(i) = ans.at(i-1);
      cout << ans.at(i)-ans.at(i-1) << endl;
    }
    else {
      cout << ans.at(i)-ans.at(i-1) << endl;
    }
  }
  
}#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0; i < N-1; i++) {
    cin >> data.at(i);
  }
  data.at(N-1) = 30000000;
  sort(data.begin(), data.end());
  
  vector<int> ans(N);
  for (int i = 0; i < N-1; i++) {
    if (data.at(i) < data.at(i+1)) {
      ans.at(data.at(i)-1) = i+1;
    }
    else {
      continue;
    }
  }
  cout << ans.at(0) << endl;
  for (int i = 1; i < N; i++) {
    if (ans.at(i) == 0) {
      ans.at(i) = ans.at(i-1);
      cout << ans.at(i)-ans.at(i-1) << endl;
    }
    else {
      cout << ans.at(i)-ans.at(i-1) << endl;
    }
  }
  
}

Compiler output:
a.cc:34:2: error: stray '#' in program
   34 | }#include <bits/stdc++.h>
      |  ^
a.cc:34:3: error: 'include' does not name a type
   34 | }#include <bits/stdc++.h>
      |   ^~~~~~~
a.cc:37:5: error: redefinition of 'int main()'
   37 | int main() {
      |     ^~~~
a.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~
Language: C++

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

int main() {
  int N;
  cin>>N;
  vector<int> vec(N-1);
  for(int i=0;i<N-1;i++){
cin>>vec[i];
  }
  int sum=0;
  
    
for(int i=0;i<N-1;i++){
for(int j=0;j<N-1;j++){
if(vec[i]==j){
  sum++
}




for(int i=0;i<N-1;i++){
cout<<sum<<endl;
}

  
}



Compiler output:
a.cc: In function 'int main()':
a.cc:17:8: error: expected ';' before '}' token
   17 |   sum++
      |        ^
      |        ;
   18 | }
      | ~       
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:14:23: note: to match this '{'
   14 | for(int i=0;i<N-1;i++){
      |                       ^
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

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

int main(){
    int N,A;
    cin >> N;
    vector<int>V(N);
    for (int i=1 ; i<N ; i++){
        cin >> A;
        for (int j=1 ; j<i+1; j++){
            if (A==j){
                V.at(j-1)++;
                break;
            }
        }
    }
    for (int i=0 ; i<N ; i++)
    cout << V.at(i) << 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;
 
int main() {
  int N, x, Si, i;
  x = 1;
  Si = 0;
  cin >> N;
  for (i = 1; i < N; i++) {
    int A < i;
    cin >> A;
  if (A == x){
    Si++;
  }
  else {
    x++;
    cout << Si << endl;
    Si = 0;
  }
  }
}
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: expected initializer before '<' token
   10 |     int A < i;
      |           ^
a.cc:11:12: error: 'A' was not declared in this scope
   11 |     cin >> A;
      |            ^
Language: C++

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

int main() {
 int N;
 cin>>N;
 vector<int>vec(N);
  vector<int>a(N);
 for(int i=0; i<N; i++){
cin>>vec.at(i);
a.at(i)=0;
 } 
 for(int i=0; i<N; i++){
int j=vec.at(i);
a.at(j-1)++;
}
}
 }
 for(int i=0; i<N; i++){
    cout<<a.at(i)<<endl;
 }
}

Compiler output:
a.cc:18:2: error: expected declaration before '}' token
   18 |  }
      |  ^
a.cc:19:2: error: expected unqualified-id before 'for'
   19 |  for(int i=0; i<N; i++){
      |  ^~~
a.cc:19:15: error: 'i' does not name a type
   19 |  for(int i=0; i<N; i++){
      |               ^
a.cc:19:20: error: 'i' does not name a type
   19 |  for(int i=0; i<N; i++){
      |                    ^
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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

int main() {
  int N;
  vector<int> vec(N - 1);
  for (int i = 0; i < N - 1; i++) {
    cin >> vec.at(i);
}
    
  int count = 0;
  
  for (int i = 1; i <= N ; i++) {
    for (int j = 0; j < N - 1; j++) {
      if (vector.at(j) == i) {
        count++;
      }
    }
    cout << count <<endl;
  }
}
    
    
    
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:15:17: error: expected unqualified-id before '.' token
   15 |       if (vector.at(j) == i) {
      |                 ^
Language: C++

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

int main(){
  int N;
  
  cin >> N;
  
  int n = N - 1;
  Vector<int> A;
  vector<int> B;
  
  A.reserve(2000000);
  B.reserve(2000000);
  
  for(int i = 0; i < n ; i++){
    cin >> A[i];
  }
  
  for(int i = 0; i < N; i++){
    B[i] = 0;
    for(int j = 0; j < n; j++){
      if(A[j] == i + 1){
        B[i]++;
      }
    }
    cout << B[i] << endl;
  }
}
  
    
    
    
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:11:3: error: 'Vector' was not declared in this scope
   11 |   Vector<int> A;
      |   ^~~~~~
a.cc:11:10: error: expected primary-expression before 'int'
   11 |   Vector<int> A;
      |          ^~~
a.cc:14:3: error: 'A' was not declared in this scope
   14 |   A.reserve(2000000);
      |   ^
Language: C

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


int main(){

    int N;
    cin >> N;

    vector<int> A(N - 1);
        for (int i = 0; i < N - 1; i++) {
        cin >> A.at(i);
    }

    sort(A.begin(), A.end());

    vector<int> B(N - 1);

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

        for (int j=0; j < N - 1; j++){

            if(A.at(j) == i + 1){
                B.at(i)++;
            }

            if(A.at(j) == i + 2){
                break;
            }
    }
    }
  
    for (int i = 0; i < N - 1; i++) {
        cout << B.at(i) << endl;
    }

    cout << "0" << 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;

int main() {
  int N;
  vector<int> vec(N - 1);
  for (int = 0; i < N - 1; i++) {
    cin >> vec.at(i);
}
    
  int count = 0;
  
  for (int i = 1; i <= N ; i++) {
    for (int j = 0; j < N - 1; j++) {
      if (vector.at(j) == i) {
        count++;
      }
    }
    cout << count <<endl;
  }
}
    
    
    
  
  


Compiler output:
a.cc: In function 'int main()':
a.cc:7:12: error: expected unqualified-id before '=' token
    7 |   for (int = 0; i < N - 1; i++) {
      |            ^
a.cc:7:11: error: expected ';' before '=' token
    7 |   for (int = 0; i < N - 1; i++) {
      |           ^~
      |           ;
a.cc:7:12: error: expected primary-expression before '=' token
    7 |   for (int = 0; i < N - 1; i++) {
      |            ^
a.cc:7:17: error: 'i' was not declared in this scope
    7 |   for (int = 0; i < N - 1; i++) {
      |                 ^
a.cc:7:26: error: expected ')' before ';' token
    7 |   for (int = 0; i < N - 1; i++) {
      |       ~                  ^
      |                          )
a.cc:7:28: error: 'i' was not declared in this scope
    7 |   for (int = 0; i < N - 1; i++) {
      |                            ^
a.cc:15:17: error: expected unqualified-id before '.' token
   15 |       if (vector.at(j) == i) {
      |                 ^