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

#include <iostream>

using namespace std;

int n, v[200005], x;

int main()
{
    cin>>n;
    for(int i=1;i<=n-1;i++){
        cin>>x;
        v[x]++;
    }
    for(int i=1;i<=n;i++){
        cout<<v[i]<<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;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}

int main() {
    int N;
    cin >> N;
    vector<int> vec;
    int B;
    for(int i = 0;i < N-1;++i){
        cin >> B;
        vec.push_back(B);
    }
    
    for(int i = 0;i < N-1;++i){
        cout << count(vec.begin(),vec.end(),i+1) << 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

def management():
    N=int(input())
    static_list=list(map(int,input().split()))
    result_list=[]
    mid_list=[]
    for i in range(0,N):
        result_list.append(0)
        mid_list.append(0)
    for i in range(0,len(static_list)):
        for j in range(0,N):
            if static_list[i]==j+1:
                result_list[j]=result_list[j]+1
    for i in range(0,N):
        print(result_list[i])


if __name__=="__main__":
    management()


Compiler output:
main.c:1:1: error: unknown type name 'def'
    1 | def management():
      | ^~~
main.c: In function 'management':
main.c:1:17: error: expected declaration specifiers before ':' token
    1 | def management():
      |                 ^
Language: C

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

signed main() {
  int N;
  cin >> N;
  
  vector<int>A(N);
  vector<int>B(N);
  
  for (int i = 0; i < N-1 ; i++){
    cin >> A.at(i);
  }
  
  for (int i = 0; i < N-1; i++){
    B.at(A.at(i)-1) += 1;
  }
  
  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

N = int(input())

a = list(map(int, input().split()))

b_list = list(range(1, N+1))
c_list = []
for i in range(N):
    sr = b_list[i]
    g = int(a.count(sr))
    c_list.append(g)

print(*c_list, sep='\n')

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:5: error: expected expression before 'int'
    1 | N = int(input())
      |     ^~~
Language: Java

import java.util.*;

class Main
{
  public static void main(String[] args)
  {
    Scanner stdIn = new Scanner(System.in);
    int n = stdIn.nextInt();
    int ans[n] = new int[n];
    ans = {0};
    
    for(int i = 0; i < n; i++){
      ans[stdIn.nextInt()] ++;
    }
    
    for(int i = 0; i < n; i++){
      System.out.println(ans[i]);
    }
  }
}

Compiler output:
Main.java:9: error: ']' expected
    int ans[n] = new int[n];
            ^
Main.java:9: error: ';' expected
    int ans[n] = new int[n];
             ^
Main.java:9: error: not a statement
    int ans[n] = new int[n];
                 ^
Main.java:10: error: illegal start of expression
    ans = {0};
          ^
Main.java:10: error: not a statement
    ans = {0};
           ^
Main.java:10: error: ';' expected
    ans = {0};
            ^
6 errors
Language: C

N=int(input())
A=list(map(int,input().split()))

for i in range(1,N+1):
    print(A.count(i))

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

#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using vl = vector<ll>;
using vvl = vector<vl>;

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

ll mod(ll a){
  return (a % 1000000007);
}

ll lcm(ll a,ll b){
  return (a*b)/gcd(a,b);
}


int main(){
  ll n; cin >> n; vl cnt(n);
  
  for(ll i=0; i < n-1; i++){
    ll x; cin >> x;
    cnt[x-1]++;
  }
  
  for(ll i=0; i < n; i++){
    cout << cnt[i] << endl;
  }
}

Compiler output:
main.c:2:9: fatal error: bits/stdc++.h: No such file or directory
    2 | #include<bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.
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); 
  
  vector<int> boss(N);
    
  for(int j=0;j<N;j++){
    if(vec(i)==j){
      
    boss(j) ++;
    }
  }
  
  for(int k=0;k<N;k++){
    cout <<boss(k) <<endl;
  }
  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:15: error: no match for call to '(std::vector<int>) (int&)'
   12 |     cin >> vec(i);
      |            ~~~^~~
a.cc:17:11: error: no match for call to '(std::vector<int>) (int&)'
   17 |     if(vec(i)==j){
      |        ~~~^~~
a.cc:19:9: error: no match for call to '(std::vector<int>) (int&)'
   19 |     boss(j) ++;
      |     ~~~~^~~
a.cc:24:16: error: no match for call to '(std::vector<int>) (int&)'
   24 |     cout <<boss(k) <<endl;
      |            ~~~~^~~
a.cc:27:2: error: expected '}' at end of input
   27 | }
      |  ^
a.cc:4:12: note: to match this '{'
    4 | int main() {
      |            ^
Language: C

N=int(input())
A=list(map(str,input().split()))
ans=[]

for i in range(1,N+1):
  ans.append(str(A.count(str(i))))

print("\n".join(ans))

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

#include <iostream>
using namespace std;

int N;
int buka[200010];
int main(){
    cin >> N;
    int tmp;
        
    for(int i = 0; i < N; ++i){
        buka[i] = 0;
    }
    for(int i = 0; i < N-1; ++i){
        cin >> tmp;
        buka[tmp]++;
    }
    
    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: C

#include<iostream>
using namespace std;

int N;
int buka[200010];
int main(){
    cin >> N;
    int tmp;
        
    for(int i = 0; i < N; ++i){
        buka[i] = 0;
    }
    for(int i = 0; i < N-1; ++i){
        cin >> tmp;
        buka[tmp]++;
    }
    
    for(int i = 0; i < N; ++i){
        cout << buka[i] << 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<iostream>
using namespace std;

int N;
int buka[200010];
int main(){
    cin >> N;
    int tmp;
    for(int i = 0; i < N-1; ++i){
        cin >> tmp;
        buka[tmp]++;
    }
    
    for(int i = 0; i < N; ++i){
        cout << buka[i] << 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 <iostream>
#include <fstream>
#include <math.h>
#include <string>

using namespace std;

int main(){

  int N;
  cin >> N;
  int A[N]={}, sub[N]={};

  for(int i=1; i<N; i++){
    cin >> A[i];
    sub[A[i]-1]++;
  }

  for(int i=0; i<N; i++){
    cout << sub[i] << endl;
  }
}


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

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

int main() {
  long long N;
  cin >> N;
  vector<long long> A(N, 0);
  for (int i = 1; i < N; i++) cin >> A[i];

  vector<long long> ANS(N, 0);
  for (int i = 0; i < N; i++) ANS[A[i] - 1]++;
  for (int i = 0; i < N; i++) cout << ANS[i] << endl;
}


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

#include <stack>
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
#include <iomanip>
using namespace std;
int gcd(int a, int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}
int main(){
    //std::stack<int> stack;
    
    int n;
    cin >> n;
    vector <int> a(n);

    for(int i = 1; i < n; i++){
        cin >> a[i];
    }
    vector <int> ans(n);

    for(int i = 1; i < n; i++){
        ans[a[i]-1] ++;
    }
    for(int i = 0; i < n; i++){
        cout << ans[i] << endl;
    }
    //cout << ans << endl;
    return 0;
}





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

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n];
  int i;
  for(i=0;i<n-1;i++)
  {
    cin>>a[i];
  }
  int j;
  vector<int> v;
  for(i=1;i<=n;i++)
  {
    for(j=0;j<n-1;j++)
    {
      ct=0;
      if(a[j]=i)
      {
        ct++;
      }
    }
    v.push_back(ct);
  }
  for(i=0;i<n;i++)
  {cout<<v[i]<<endl;
  }
  return 0;
}
   
  

Compiler output:
a.cc: In function 'int main()':
a.cc:19:7: error: 'ct' was not declared in this scope
   19 |       ct=0;
      |       ^~
a.cc:25:17: error: 'ct' was not declared in this scope
   25 |     v.push_back(ct);
      |                 ^~
Language: C

#include <iostream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <iomanip>
#include <map>
#define rep(i,n) for (int i=0;i<(n);++i)
#define REP(i,n) for (int i=0;i<=(n);++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int INF = 10000000;

int gcd(int a,int b){return b?gcd(b,a%b):a;}

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


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

n = int(input())
a = list(map(int,input().split())
m = 0
while m < n:
  print(a.count(m + 1))
  m += 1

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

n = int(input())
a = list(map(int,input().split())
m = 0
while m < n:
  print(a.count(m + 1))

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

#include <iostream>
#include <math.h>
#include <algorithm>
#include <functional>
#include <stdio.h>
#include <vector>
#include <string>
#include <map>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
//#define rep(i, n) for(int (i) = 0, TmP = (n); (i) < (int)TmP ; ++(i))
//#define int long long
#define asort(v, n) sort((v), (v + n)) //Using array
#define vsort(v) sort((v).begin(), (v).end()) // Using vector
#define vint vector<int>

using namespace std;

signed main(){
  int n;
  cin >> n;
  int a[20005], ans[20005] = {0};
  rep(i, n - 1)cin >> a[i];

  rep(i, n){
    int j = a[i] - i
    ans[j]++;
  }

  rep(i, n)cout << ans[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:5: error: expected ',' or ';' before 'ans'
   26 |     ans[j]++;
      |     ^~~
Language: C


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

int  main()
{
   int n;
   cin>>n;
   int num[n];
   map<int,int> m;
   for(int i=2;i<=n;i++){
      int a;
      cin>>a;
      if(a<i)
       m[a]++;
   }
   int count=0, total_count=0;
   
     for(int i=1;i<=n;i++){
        cout<<m[i]<<endl;
     }
     
   
  
}

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

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

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

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

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

#include<stdio.h>
#include<stdlib.h>
void main(void)
{
  int N,M,*A;
  scanf("%d",&N);
  A=(int*)malloc(sizeof(int)*(N+1));
  
  int B[N+1]={0};

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

Compiler output:
main.c: In function 'main':
main.c:9:14: error: variable-sized object may not be initialized except with an empty initializer
    9 |   int B[N+1]={0};
      |              ^
Language: C

#include<stdio.h>
#include<stdlib.h>
void main(void)
{
  int N,M,*A;
  scanf("%d",&N);
  A=(int*)malloc(sizeof(int)*(N+1));
  B[N+1]={0};


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

Compiler output:
main.c: In function 'main':
main.c:8:3: error: 'B' undeclared (first use in this function)
    8 |   B[N+1]={0};
      |   ^
main.c:8:3: note: each undeclared identifier is reported only once for each function it appears in
main.c:8:10: error: expected expression before '{' token
    8 |   B[N+1]={0};
      |          ^
Language: C

#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;


int main() {
    int N;
    cin >> N;
    vector<int> res(N);
    for (int i = 0; i < N - 1; i++) {
        int a;
        cin >> a;
        res[a - 1]++;
    }

    for (int i = 0; i < N; i++) {
        cout << res[i] << 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 <iostream>
#include <vector>
using namespace std;

int main() {
	int n;cin>>n;
	vector<int> v(n,0);
	for(int i=0;i<n-1;++i){
		int t;cin >>t;
		++v[t-1];
	}
	
	for (int i=0;i<n;++i){
		cout << v[i] << 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;

void cnt_manager(){
    int n; cin >> n;
    int manager_no[n-1]={};
    for(int i=0;i<n-1;i++){
        cin >> manager_no[i];
    }
    int cnt=0;
    int i=0;
    for(int j=1;j<=n;j++){ //manager's number
        for(i=0;i<n-1;i++){
            if(manager_no[i]==j){
                cnt++;
            }
        }
        cout << cnt << endl;
      	i+=1
        cnt=0;
    }
}

int main(){
    cnt_manager();
    return 0;
}

Compiler output:
a.cc: In function 'void cnt_manager()':
a.cc:19:13: error: expected ';' before 'cnt'
   19 |         i+=1
      |             ^
      |             ;
   20 |         cnt=0;
      |         ~~~
Language: C++

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

void cnt_manager(){
    int n; cin >> n;
    int manager_no[n-1]={};
    for(int i=0;i<n-1;i++){
        cin >> manager_no[i];
    }
    int cnt=0;
    
    for(int j=1;j<=n;j++){ //manager's number
        for(int i=0;i<n-1;i++){
            if(manager_no[i]==j){
                cnt++;
            }
        }
        cout << cnt << endl;
      	i+=1
        cnt=0;
    }
}

int main(){
    cnt_manager();
    return 0;
}

Compiler output:
a.cc: In function 'void cnt_manager()':
a.cc:19:9: error: 'i' was not declared in this scope
   19 |         i+=1
      |         ^
Language: C

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

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

#include <iostream>
using namespace std;

int main(){
    int N;
    cin >> N;
    int count[N]={}; 
    for(int i=0;i<N-1;i++){
        int a;
        cin >> a;
        a--;
        count[a]++;
    }
    for(int i=0;i<N;i++){
        cout << count[i] << endl;
    }
    return 0;
    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;
	cin>>n;
	int a[n+1],b[n+1]；
	
	for(int i=1;i<=n;i++){
		b[i]=0;
	}
	
	for(int i=2;i<=n;i++){
		cin>>a[i];
		b[a[i]]++;
	}
	
	for(int i=1;i<=n;i++)
		cout<<b[i]<<" ";
		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:26: error: expected initializer before '\U0000ff1b'
    7 |         int a[n+1],b[n+1]；
      |                          ^~
a.cc:9:21: error: 'i' was not declared in this scope
    9 |         for(int i=1;i<=n;i++){
      |                     ^
a.cc:15:17: error: 'b' was not declared in this scope
   15 |                 b[a[i]]++;
      |                 ^
a.cc:19:23: error: 'b' was not declared in this scope
   19 |                 cout<<b[i]<<" ";
      |                       ^
Language: C++

int main(){
    int n;
    cin >> n;
    int a[200010];
    int ans[200010];
    for(int i=2; i<=n; i++) cin >> a[i];
    for(int i=2; i<=n; i++) ans[a[i]]++;
    for(int i=1; i<=n; i++) cout << ans[i] << endl;     
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> n;
      |     ^~~
a.cc:8:29: error: 'cout' was not declared in this scope
    8 |     for(int i=1; i<=n; i++) cout << ans[i] << endl;
      |                             ^~~~
a.cc:8:47: error: 'endl' was not declared in this scope
    8 |     for(int i=1; i<=n; i++) cout << ans[i] << endl;
      |                                               ^~~~
Language: C++

#include<iostream>
#include<ios>
using namespace std;
ios::sync_with_stdio(false);

int main() {
    int N, A[200002];
    int num_sup[200002] = {0};
    cin >> N;
    for (int i = 2; i <= N; i++){
        cin >> A[i];
        num_sup[A[i]]++;
    }
    for(int i = 1; i <= N; i++) {
        cout << num_sup[i] << "\n";
        // printf("%d\n",num_sup[i]);
    }
}

Compiler output:
a.cc:4:1: error: specializing member 'std::basic_ios<char>::sync_with_stdio' requires 'template<>' syntax
    4 | ios::sync_with_stdio(false);
      | ^~~
Language: C

#include<bits/stdc++.h>

using namespace std;

int main(int argc, char const *argv[])
{
	int N;
	cin >> N;

	int a[N];

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

	int ans = 0;

	for (int i = 0; i < N; ++i)
	{
		ans = count(a, a + N - 1, i+1);
		printf("%d\n", ans);
	}
	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;
#define mx 200000
typedef long long ll;

int main()
{
    double boss,subordinate[mx];
    scanf("%lf",&boss);
    for(int i=0;i<boss;i++)
    {
        scanf("%lf", &subordinate[i]);
    }
    i--;
    for(int j=1;j<=i;j++)
    {
        if(subordinate[j]==1)
            printf("%d\n",2);
        else if(subordinate[j]!=1 && subordinate[j-1]<subordinate[j])
            printf("%lf\n",subordinate[j]-subordinate[j-1]);
        else
            printf("%d\n",0);
    }
    return 0;
}


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

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

int main()
{
    double boss,subordinate[mx];
    scanf("%ld",&boss);
    for(int i=0;i<boss;i++)
    {
        scanf("%ld", &subordinate[i]);
    }
    i--;
    for(int j=1;j<=i;j++)
    {
        if(subordinate[j]==1)
            printf("%d\n",2);
        else if(subordinate[j]!=1 && subordinate[j-1]<subordinate[j])
            printf("%ld\n",subordinate[j]-subordinate[j-1]);
        else
            printf("%d\n",0);
    }
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
#define mx 200000
typedef long long ll;
#define mx 200000
int main()
{
    double boss,subordinate[mx];
    scanf("%ld",&boss);
    for(int i=0;i<boss;i++)
    {
        scanf("%ld", &subordinate[i]);
    }
    i--;
    for(int j=1;j<=i;j++)
    {
        if(subordinate[j]==1)
            printf("%d\n",2);
        else if(subordinate[j]!=1 && subordinate[j-1]<subordinate[j])
            printf("%lld\n",subordinate[j+1]-subordinate[j]);
        else
            printf("%d\n",0);
    }
    return 0;
}


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

#include <iostream>
using namespace std;

int main() {
  	int total, temp, list[200000];
  	cin >> total;
    fill(list, total + 1, 0);
  	for (int i = 0; i < total; ++i) {
    	cin >> temp;
      	list[temp + 1]++;
    }
  	for (int i = 0; i < total; ++i) {
    	cout << list[i] << endl;
    }
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: no matching function for call to 'fill(int [200000], int, int)'
    7 |     fill(list, total + 1, 0);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:1022:5: note: candidate: 'template<class _ForwardIterator, class _Tp> void std::fill(_ForwardIterator, _ForwardIterator, const _Tp&)'
 1022 |     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
      |     ^~~~
/usr/include/c++/14/bits/stl_algobase.h:1022:5: note:   template argument deduction/substitution failed:
a.cc:7:9: note:   deduced conflicting types for parameter '_ForwardIterator' ('int*' and 'int')
    7 |     fill(list, total + 1, 0);
      |     ~~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{


  int n;
  cin >> n ;
  vector<int > ar(n);

  // int count =0;
  for (int i = 1; i < n; ++i)
  {
  	int temp;
  	cin >> temp;
  	ar[temp]++
  }

  for (int i = 0; i < n; ++i)
  {
    cout << ar[i] << endl;
  }




}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:19: error: expected ';' before '}' token
   18 |         ar[temp]++
      |                   ^
      |                   ;
   19 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main()
{


  int n;
  cin >> n ;
  vector<int > ar(n);

  // int count =0;
  for (int i = 1; i < m; ++i)
  {
  	itn temp;
  	cin >> temp;
  	ar[temp]++
  }

  for (int i = 0; i < n; ++i)
  {
    cout << ar[i] << endl;
  }




}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:23: error: 'm' was not declared in this scope
   14 |   for (int i = 1; i < m; ++i)
      |                       ^
a.cc:16:9: error: 'itn' was not declared in this scope; did you mean 'int'?
   16 |         itn temp;
      |         ^~~
      |         int
a.cc:17:16: error: 'temp' was not declared in this scope; did you mean 'tm'?
   17 |         cin >> temp;
      |                ^~~~
      |                tm
Language: C++

int main(){
    int N;
    cin >> N;
    vector<int> num(N-1);
    vector<int> sya(N);
    
    for(int i = 0 ; i < N-1 ; ++i){
        cin >> num.at(i);
        sya.at(num.at(i)-1)++;
    }
    
    for(int i = 0 ; i < N ; ++i){
        cout << sya.at(i) << endl;
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'cin' was not declared in this scope
    3 |     cin >> N;
      |     ^~~
a.cc:4:5: error: 'vector' was not declared in this scope
    4 |     vector<int> num(N-1);
      |     ^~~~~~
a.cc:4:12: error: expected primary-expression before 'int'
    4 |     vector<int> num(N-1);
      |            ^~~
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> sya(N);
      |            ^~~
a.cc:8:16: error: 'num' was not declared in this scope; did you mean 'enum'?
    8 |         cin >> num.at(i);
      |                ^~~
      |                enum
a.cc:9:9: error: 'sya' was not declared in this scope
    9 |         sya.at(num.at(i)-1)++;
      |         ^~~
a.cc:13:9: error: 'cout' was not declared in this scope
   13 |         cout << sya.at(i) << endl;
      |         ^~~~
a.cc:13:17: error: 'sya' was not declared in this scope
   13 |         cout << sya.at(i) << endl;
      |                 ^~~
a.cc:13:30: error: 'endl' was not declared in this scope
   13 |         cout << sya.at(i) << endl;
      |                              ^~~~
Language: C

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

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

    vector<int> counter(N);
    for (int i = 1; i < N; i++){
        int A;
        cin >> A;
        counter[A-1]++;
    }

    rep(i,N){
        cout << counter[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

import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
counter = np.bincount(a)
for i in range(1, n+1):
    if i < len(counter):
        print(counter[i])
    else:
        print(0)


Compiler output:
main.c:1:1: error: unknown type name 'import'
    1 | import numpy as np
      | ^~~~~~
main.c:1:14: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'as'
    1 | import numpy as np
      |              ^~
main.c:1:14: error: unknown type name 'as'
Language: C

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

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)
ll A[(ll) (2*10e5+5)];
ll ANS[(ll) (2*10e5+5)];

int main(){
    ll N;
    ll Ai;
    cin >> N;
    FOR(i,2,N) {
        cin >> Ai;
        ANS[Ai] += 1;
    }
    FOR(i,1,N) {
        cout << ANS[i];
        cout << 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>
#include <algorithm>
#include <memory>
using namespace std;

int n, m;
int a[200005];
int main()
{
	memset(a, 0, 200005);
	cin >> n;
	for (int i = 2; i <= n; i++)
	{
		int x; cin >> x;
		a[x]++;
	}
	for (int i = 1; i <= n; i++)
	{
		cout << a[i];
		if (i != n) cout << endl;
	}
}

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

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

int n, m;
int a[200005];
int main()
{
	memset(a, 0, 200005);
	cin >> n;
	for (int i = 2; i <= n; i++)
	{
		int x; cin >> x;
		a[x]++;
	}
	for (int i = 1; i <= n; i++)
	{
		cout << a[i];
		if (i != n) cout << endl;
	}
}

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

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

int i,j,k,l,m;
ll mod=1000000007;

int main(){    
    int n;cin>>n;
    int sum=0;
    vector<int> a(n+1,0),b(n+1,0);
    
    for(i=2;i<=n;i++){
        cin>>a[i];//iの上司の番号
        b[a[i]]++;//上司の直属の部下
    }

    for(i=2;i<=n;i++){sum+=b[i];}
    cout<<n-1-sum<<endl;//社員番号1の直属の部下
    
    for(i=2;i<=n;i++){
        cout<<b[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;
	vector<int>arr(n);
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	vector<int> count(n+1);
	for(int i=0;i<n;i++){
		count[arr[i]] += 1;
	}
	for(int i=2;i<=n;i++){
		cout<<count[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<iostream>
using namespace std;

int A[N-1];
int ans[N];
int main(int argc, char const *argv[]) {
  int N;
  cin >> N;
  for (int i = 0; i < N-1; i++){
    cin >> A[i];
    ans[A[i]]++;
  }
  for (int i = 1; i<=N; i++){
    cout << ans[i] << endl;
  }
  return 0;
}

Compiler output:
a.cc:4:7: error: 'N' was not declared in this scope
    4 | int A[N-1];
      |       ^
a.cc:5:9: error: 'N' was not declared in this scope
    5 | int ans[N];
      |         ^
a.cc: In function 'int main(int, const char**)':
a.cc:10:12: error: 'A' was not declared in this scope
   10 |     cin >> A[i];
      |            ^
a.cc:11:5: error: 'ans' was not declared in this scope; did you mean 'abs'?
   11 |     ans[A[i]]++;
      |     ^~~
      |     abs
a.cc:14:13: error: 'ans' was not declared in this scope; did you mean 'abs'?
   14 |     cout << ans[i] << endl;
      |             ^~~
      |             abs
Language: C

#include <iostream>
#include <vector>
#define MAX 200000
using namespace std;

int main(void){
  int N;
  cin >> N;
  int num[MAX]={};
  vector<int> v;
  for(int i=0;i<N-1;i++){
    int tmp;
    cin >> tmp;
    v.push_back(tmp-1);
  }
  for(int i=0;i<N;i++){
    int ai = v[i];
    num[ai] = num[ai] + 1;
  }
  for(int i=0;i<N;i++){
    cout << num[i] << 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() {
  cin >> N,A;
  vector<int> E(N);
  for(int i = 0;i < N;i++){
    cin >> A;
    E[A]++;
  }
  for(int i = 0;i < N;i++){
    cout << E[i] << endl;
  }

}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:10: error: 'N' was not declared in this scope
    5 |   cin >> N,A;
      |          ^
a.cc:5:12: error: 'A' was not declared in this scope
    5 |   cin >> N,A;
      |            ^
Language: C

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

int main() {
  cin >> N,A;
  vector<int> E(N);
  for(int i = 0;i < N;i++){
    cin >> A;
    E[A]++;
  }
  for(int i = 0;i < N;i++){
    cout << E[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>
// #include <algorithm>
using namespace std;

int main(){
    int n;
    cin >> n;
    int a[n];
    int b[n];
    int j=0,k=1;
    a[0] = 0;
    for (int i = 1; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) b[i] = 0;

    // sort(a,a+n);
    // for (int i = 0; i < n; i++) cout << a[i];

    while(1){
        if (k == n) {
            j += 1;
            k = 1;
        }
        if (a[k] == j+1) {
            b[j] ++;
            k ++;
        }else{
            // j += 1;
            k ++;   
        }
        if (j == n - 1) break;
        
    }

    for (int i = 0; i < n; i++) cout << b[i] << endl;
}

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

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

int main(){
    int n;
    cin >> n;
    int a[n];
    int b[n];
    int j=0,k=1;
    a[0] = 0;
    for (int i = 1; i < n; i++) cin >> a[i];
    for (int i = 0; i < n; i++) b[i] = 0;

    // sort(a,a+n);
    // for (int i = 0; i < n; i++) cout << a[i];

    while(1){
        if (k == n) {
            j += 1;
            k = 1;
        }
        if (a[k] == j+1) {
            b[j] ++;
            k ++;
        }else{
            // j += 1;
            k ++;   
        }
        if (j == n - 1) break;
        
    }

    for (int i = 0; i < n; i++) cout << b[i] << endl;
}

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

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

int main(){
    int N;
    vector<int> vec;
    cin >> N;
    int k;
 
    for (int i = 0; i < N-1; i++) {
        cin >> k;
        vec.push_back(k);
    }
    
    for (int i = 0; i < N; i++) {
        size_t vec_count = count(vec.begin(), vec.end(), i + 1);
        cout << vec_count << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: 'count' was not declared in this scope
   17 |         size_t vec_count = count(vec.begin(), vec.end(), i + 1);
      |                            ^~~~~
Language: C

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

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


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;
  cin >> N;
  vector<int>A(N);
  for(int i = 1; i < N; i++)cin >> A.at(i);
  vector<int>ans(N);
  for(int i = 1; i < N; i++){
    ans.at(A.at(i)) += 1;
  }
  for(int i = 0; i < N; i++){
    cout << ans.at(i) << endl;
  }
}


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 arr[n+10] = {0};
  int num;
  for(int i = 1; i <= n; i++) cin >> num, arr[num]++;
  for(int i = 1; i <= n; i++) cout << arr[i] "\n";
  
  
 	return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:45: error: expected ';' before string constant
   12 |   for(int i = 1; i <= n; i++) cout << arr[i] "\n";
      |                                             ^~~~~
      |                                             ;
Language: C++

#include <vector>
using std::vector;
 
int main() {
	int num_of_members {};
  	vector<int> members(200000);
  	
  	scanf("%d", &num_of_members);
  	
  	while(num_of_members - 1 > 0) {
    	int num{};
      	scanf("%d", &num);
      	members.at(num) += 1;
    }
  
  	for(int i=1; i<= num_of_members; i++) {
    	printf(members.at(i);
    }         
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'scanf' was not declared in this scope
    8 |         scanf("%d", &num_of_members);
      |         ^~~~~
a.cc:17:29: error: expected ')' before ';' token
   17 |         printf(members.at(i);
      |               ~             ^
      |                             )
Language: C++

using std::vector;

int main() {
	int num_of_members {};
  	vector<int> members(200000);
  	
  	scanf("%d", &num_of_members);
  	
  	while(num_of_members - 1 > 0) {
    	int num{};
      	scanf("%d", &num);
      	members.at(num) += 1;
    }
  
  	for(int i=1; i<= num_of_members; i++) {
    	printf(members.at(i);
    }
               
	return 0;

}

Compiler output:
a.cc:1:12: error: 'vector' has not been declared in 'std'
    1 | using std::vector;
      |            ^~~~~~
a.cc: In function 'int main()':
a.cc:5:9: error: 'vector' was not declared in this scope
    5 |         vector<int> members(200000);
      |         ^~~~~~
a.cc:5:16: error: expected primary-expression before 'int'
    5 |         vector<int> members(200000);
      |                ^~~
a.cc:7:9: error: 'scanf' was not declared in this scope
    7 |         scanf("%d", &num_of_members);
      |         ^~~~~
a.cc:12:9: error: 'members' was not declared in this scope
   12 |         members.at(num) += 1;
      |         ^~~~~~~
a.cc:16:16: error: 'members' was not declared in this scope
   16 |         printf(members.at(i);
      |                ^~~~~~~
Language: C

#include <bits/stdc++.h>

using namespace std;

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

    vector<int> vt(n, 0);
    for (int i = 1; i < n; ++i) {
        int x;
        cin >> x;
        vt[x - 1]++;
    }

    for (auto x:vt) cout << x << 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: Java


 
public class Main {
 
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
 
		int n = scanner.nextInt();
		int arr[] = new int[n];
		for(int i = 0; i < n - 1; i++) {
			int value = scanner.nextInt();
			arr[value - 1] += 1;
		}
		
		for(int value : arr)
			System.out.println(value);
		
 
		scanner.close();
	}
 
}
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int arr[] = new int[n];
		for(int i = 0; i < n - 1; i++) {
			int value = scanner.nextInt();
			arr[value - 1] += 1;
		}
		
		for(int value : arr)
			System.out.println(value);
		

		scanner.close();
	}

}
提出情報

Compiler output:
Main.java:23: error: class, interface, enum, or record expected
import java.util.*;
^
Main.java:45: error: reached end of file while parsing
????
^
2 errors
Language: Java

import java.util.*;
 
public class Main {
 
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
 
		int n = scanner.nextInt();
		int arr[] = new int[n];
		for(int i = 0; i < n - 1; i++) {
			int value = scanner.nextInt();
			arr[value - 1] += 1;
		}
		
		for(int value : arr)
			System.out.println(value);
		
 
		scanner.close();
	}
 
}
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		int n = scanner.nextInt();
		int arr[] = new int[n];
		for(int i = 0; i < n - 1; i++) {
			int value = scanner.nextInt();
			arr[value - 1] += 1;
		}
		
		for(int value : arr)
			System.out.println(value);
		

		scanner.close();
	}

}
提出情報

Compiler output:
Main.java:23: error: class, interface, enum, or record expected
import java.util.*;
^
Main.java:45: error: reached end of file while parsing
????
^
2 errors
Language: Java

public static void Main(String[] args) {
        

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            map.put(i, 0);
        }
        for (int j = 0; j < n; j++) {
            int s = sc.nextInt();
            map.put(j, map.get(s) + 1);
        }
        for(Integer key: map.keySet()) {
            System.out.println(key + "\r");
        }
    }

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void Main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: Java

public static void main(String[] args) {
        

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<Integer, Integer> map = new HashMap<>();
        for (int i = 0; i < n; i++) {
            map.put(i, 0);
        }
        for (int j = 0; j < n; j++) {
            int s = sc.nextInt();
            map.put(j, map.get(s) + 1);
        }
        for(Integer key: map.keySet()) {
            System.out.println(key + "\r");
        }
    }

Compiler output:
Main.java:1: error: unnamed classes are a preview feature and are disabled by default.
public static void main(String[] args) {
              ^
  (use --enable-preview to enable unnamed classes)
1 error
Language: C

#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <map>
#include <cmath>
#include <bitset>
#include <string>
#include <queue>

using namespace std;

#define int long long

signed main() {
    int n;
    cin >> n;
    vector<int> v(n, 0);
    for(int i = 0; i < n - 1; i++) {
        int m;
        cin >> m;
        v[m - 1]++;
    }

    for(int i = 0; i < n; i++) {
        cout << v[i] << 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>
int main()
{
  int n,a[200000],i,j,b;
  scanf("%d",&n);
  for(i=0;i<n-1;i++)
  {
    scanf("%d",&a[i]);
  }
  for(i=1;i<n;i++)
  {
    b=0;
    for(j=0;j<n-1;j++)
    {
      ifa[j]==i)
        b++;
    }
    printf("%d",b);
  }  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'ifa' was not declared in this scope
   15 |       ifa[j]==i)
      |       ^~~
Language: C++

#include<bits/stdc++.h>
int main()
{
  int n,a[200000],
  scanf("%d",&n);
  for(i=0;i<n-1;i++)
  {
    scanf("%d",&a[i]);
  }
  for(i=1;i<n;i++)
  {
    b=0;
    for(j=0;j<n-1;j++)
    {
      ifa[j]==i)
        b++;
    }
    printf("%d",b);
  }  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: expression list treated as compound expression in initializer [-fpermissive]
    5 |   scanf("%d",&n);
      |                ^
a.cc:5:16: error: invalid conversion from 'int*' to 'int' [-fpermissive]
    5 |   scanf("%d",&n);
      |                ^
      |                |
      |                int*
a.cc:6:7: error: 'i' was not declared in this scope
    6 |   for(i=0;i<n-1;i++)
      |       ^
a.cc:8:21: error: 'scanf' cannot be used as a function
    8 |     scanf("%d",&a[i]);
      |                     ^
a.cc:10:7: error: 'i' was not declared in this scope
   10 |   for(i=1;i<n;i++)
      |       ^
a.cc:12:5: error: 'b' was not declared in this scope
   12 |     b=0;
      |     ^
a.cc:13:9: error: 'j' was not declared in this scope
   13 |     for(j=0;j<n-1;j++)
      |         ^
a.cc:15:7: error: 'ifa' was not declared in this scope
   15 |       ifa[j]==i)
      |       ^~~
Language: C++

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

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

    vector<int> A(N);
    rep(i,0,N-1) {
        int tmp;
        cin >> tmp;
        A[tmp - 1]++;
    }

    rep(i,0,N) {
        cout << a << endl;
    }
}


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

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

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

    int N;
    cin >> N;

    vector<int> A(N);
    rep(i,N-1) {
        int tmp;
        cin >> tmp;
        A[tmp - 1]++;
    }

    rep(i,0,N) {
        cout << A[i] << endl;
    }
}


Compiler output:
a.cc:14:14: error: macro "rep" requires 3 arguments, but only 2 given
   14 |     rep(i,N-1) {
      |              ^
a.cc:2:9: note: macro "rep" defined here
    2 | #define rep(i,s,n) for (int i=(s); i<(n); i++)
      |         ^~~
a.cc: In function 'int main()':
a.cc:14:5: error: 'rep' was not declared in this scope
   14 |     rep(i,N-1) {
      |     ^~~
Language: C++

#include<bits/stdc++.h>
int main()
{
  int n,a[100000],i,
  scanf("%d",&n);
  for(i=0;i<n-1;i++)
  {
    scanf("%d",&a[i]);
  }
  for(i=1;i<n;i++)
  {
    b=0;
    for(j=0;j<n-1;j++)
    {
      if(a[j]==i)
        b++;
    }
    printf("%d\n",n);
    
  }
}
    

Compiler output:
a.cc: In function 'int main()':
a.cc:5:16: error: expression list treated as compound expression in initializer [-fpermissive]
    5 |   scanf("%d",&n);
      |                ^
a.cc:5:16: error: invalid conversion from 'int*' to 'int' [-fpermissive]
    5 |   scanf("%d",&n);
      |                ^
      |                |
      |                int*
a.cc:8:10: error: 'scanf' cannot be used as a function
    8 |     scanf("%d",&a[i]);
      |     ~~~~~^~~~~~~~~~~~
a.cc:12:5: error: 'b' was not declared in this scope
   12 |     b=0;
      |     ^
a.cc:13:9: error: 'j' was not declared in this scope
   13 |     for(j=0;j<n-1;j++)
      |         ^