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

import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner scn = new Scanner(System.in);
        int N = scn.nextInt();
        String[] AnString = (scn.nextLine()).split(" ");
        int[] Aresult = new int[N];
        int A = 0;
        for(int i=1;i<N;i++){
            A = Integer.valueof(AnString[i]);
            Aresult[A]++;
        }
        for(int i=0;i<N;i++)
            System.out.println(Aresult[i]);
    }
}

Compiler output:
Main.java:10: error: cannot find symbol
            A = Integer.valueof(AnString[i]);
                       ^
  symbol:   method valueof(String)
  location: class Integer
1 error
Language: C

#include<stdio.h>
int main(void){
    int N, i;
    scanf("%d",&N);
    int A,B[N+1];
    for(i=0;i<N;i++){
        B[i] = 0;
    }
    for(i=0;i<N-1;i++){
        scanf("%d",&A);
        B[A]+=1; 
    }
    for(i=0;i<N-1;i++){
        printf("%d"B[i]);
    }
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:20: error: expected ')' before 'B'
   14 |         printf("%d"B[i]);
      |               ~    ^
      |                    )
Language: C

#include <stdio.h>
#include <math.h>

int main(){
  int N;
  scanf("%d", &N);
  int A[N], B[N];
  int i, sum = 0;
  A[N] = 0;
  for (i = 0; i < M; i++) {
    B[i] = 0;
  }
  
  for (i = 1; i < M; i++) {
    A[i] = 0;
    scanf("%d", &A[i]);
    B[A[i] - 1] += 1;
  }
  
  for (i = 0; i < M; i++) {
    printf("%d\n", B[i]);
  }
  return 0;
}

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

#include<stdio.h>
int main(){
  int shain, i, tmp;
  scanf("%d",%shain);
  int buka[shain] = {0};
  for(i = 0; i<shain-1; i++){
    tmp = 0;
    scanf("%d",&tmp);
    buka[tmp] += 1;
  }
 
  for(i=0;i<shain;++i){
    printf("%d\n", buka[i]);
  }
 
  return 0;
 
}

Compiler output:
main.c: In function 'main':
main.c:4:14: error: expected expression before '%' token
    4 |   scanf("%d",%shain);
      |              ^
main.c:5:21: error: variable-sized object may not be initialized except with an empty initializer
    5 |   int buka[shain] = {0};
      |                     ^
Language: C++

#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include <cmath>
#include<queue>
#include<cstdio>
//#include <bits/stdc++.h>
using namespace std;

int main(){
    long int N;
    cin>>N;
    long int A[N-1];
    for (int i=0;i<N-1;i++){
        cin>>A[i];
    }
    sort(A,A+N-1);
    long int j=1,k=0;
    for (int i=0;i<N-1;i++){
        if (A[i]!=j){
            cout<<i-k<<endl;
            k=i;
            j+=1;
        }
    }
    cout<<N-1-k<<endl;
    for (int i=j+2;j<=N;j++){
        cout<<0<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   18 |     sort(A,A+N-1);
      |     ^~~~
      |     sqrt
Language: C++

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

int main(){
  int n;
  vector<int> a(n-1);
  vector<int> b(n);
  int count=0;
  
  cin>>n;
  for(int i=0;i<n-1;i++){
    cin>>a[i];
  }
  
  for(int i=1;i<=n;i++){
    for(int j=0;j<n-1;j++){
      if(i==a[j]){
        count++;
      }
    }
    b[i-1]=count;
  }
  
  for(int i=0;i<n;i++){
    cout<<b[i]<<endl;
  }
}

      
}


Compiler output:
a.cc:31:1: error: expected declaration before '}' token
   31 | }
      | ^
Language: C

#include<stdio.h>
int main(){
  int shain, i tmp;
  scanf("%d",%shain);
  int buka[shain] = {0};
  for(i = 0; i<shain-1; i++){
    tmp = 0;
    scanf("%d",&tmp);
    buka[tmp] += 1;
  }

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

}

Compiler output:
main.c: In function 'main':
main.c:3:16: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'tmp'
    3 |   int shain, i tmp;
      |                ^~~
main.c:4:14: error: expected expression before '%' token
    4 |   scanf("%d",%shain);
      |              ^
main.c:5:21: error: variable-sized object may not be initialized except with an empty initializer
    5 |   int buka[shain] = {0};
      |                     ^
main.c:6:7: error: 'i' undeclared (first use in this function)
    6 |   for(i = 0; i<shain-1; i++){
      |       ^
main.c:6:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:7:5: error: 'tmp' undeclared (first use in this function)
    7 |     tmp = 0;
      |     ^~~
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++){
  int sum(j);
for(int j=0;j<N-2;j++){
if(vec[i]==j){
sum(j)++
}
}
}
for(int k=0;k<N-1;k++){
cout<<sum(k)<<endl;
}


  
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:11: error: 'j' was not declared in this scope
   12 |   int sum(j);
      |           ^
a.cc:15:4: error: 'sum' cannot be used as a function
   15 | sum(j)++
      | ~~~^~~
a.cc:20:7: error: 'sum' was not declared in this scope
   20 | cout<<sum(k)<<endl;
      |       ^~~
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:7:15: error: conflicting declaration 'std::vector<int> ans'
    7 |   vector<int> ans(n);
      |               ^~~
a.cc:5:9: note: previous declaration as 'int ans'
    5 |   int n,ans;
      |         ^~~
a.cc:11:9: error: request for member 'at' in 'ans', which is of non-class type 'int'
   11 |     ans.at(num-1)=ans.at(num-1)+1;
      |         ^~
a.cc:11:23: error: request for member 'at' in 'ans', which is of non-class type 'int'
   11 |     ans.at(num-1)=ans.at(num-1)+1;
      |                       ^~
a.cc:15:16: error: request for member 'at' in 'ans', which is of non-class type 'int'
   15 |      cout<<ans.at(i)<<endl;
      |                ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> vec(N-1);
  vector<int> answer(N);
  for (int i = 0; i < N-1; i++) {
    cin >> vec.at(i);
  }
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N-1) {
      if (vec.at(j) == i+1) {
        answer.at(i)++;
      }
    }
    cout << answer.at(i) << endl;
  }
}
    


Compiler output:
a.cc: In function 'int main()':
a.cc:13:28: error: expected ';' before ')' token
   13 |     for (int j = 0; j < N-1) {
      |                            ^
      |                            ;
Language: C++


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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:18:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
   18 |     if(A.at(i) == "1") {
      |        ~~~~~~~~^~~~~~
a.cc:22:7: error: 'ians' was not declared in this scope; did you mean 'ans'?
   22 |       ians;
      |       ^~~~
      |       ans
a.cc:25:11: error: unable to find numeric literal operator 'operator""ans'
   25 |   cout << 1ans << endl;
      |           ^~~~
a.cc:27:13: error: 'ians' was not declared in this scope; did you mean 'ans'?
   27 |     cout << ians <<endl;
      |             ^~~~
      |             ans
Language: C

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define pii pair<int,int>
#define pli pair<ll,int>
#define pil pair<int,ll>
#define pll pair<ll,ll>
const int inf = 1 << 30;
const ll linf = 1e18;
template<class T> void chmin(T& x, T y){if(x > y) x = y;}
template<class T> void chmax(T& x, T y){if(x < y) x = y;}

int N;
int G[200010];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> N;
    for(int i = 1; i < N; i++){
        int A;
        cin >> A;
        G[A]++;
    }
    for(int i = 1; i <= N; i++){
        cout << G[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, x, Si, i = 1;
  x = 1;
  Si = 1;
  cin >> N;
  for (i = 1; i < N; i++) {
    int A;
    cin >> A;
  }
  if (A == x){
    Si++;
  }
  else {
    Si = Si;
  }
  cout << Si << endl;
  x++;
}
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:13:7: error: 'A' was not declared in this scope
   13 |   if (A == x){
      |       ^
Language: C


import java.util.*;
class Main{
      public static void main(String[] args) {
          Scanner scan = new Scanner(System.in);
         
          int N= scan.nextInt();
          int arr[] =  new int[N];
          for(int i=1;i<N;i++)
               arr[i]= scan.nextInt();

          int count=1;
          int rescount=0;
          int val = arr[1];
          int num=0;
          for(int i=1;i<N-1;i++){
              
              if(val==arr[i+1]){
                  count++;
                  
              }
              else{
                  val = arr[i+1];
                  
               
                    System.out.println(count);
                  
                 count=1;
                  rescount=i;
                  num++;
              }

          } 
          
          while(num!=N){
              num++;
            System.out.println(count);
            
            count=0;
            
          }     
          
   }
}

Compiler output:
main.c:2:1: error: unknown type name 'import'
    2 | import java.util.*;
      | ^~~~~~
main.c:2:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '.' token
    2 | import java.util.*;
      |            ^
main.c:3:1: error: unknown type name 'class'
    3 | class Main{
      | ^~~~~
main.c:3:11: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
    3 | class Main{
      |           ^
Language: C

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

int main() {
  int N;cin>>N;
  vector<int> A(N),B(N+1);
  A.at(0) = 0;
  for (int i=1;i<N;i++) cin>>A.at(i);
  sort(A.begin(), A.end());
  for (int i=1;i<A.at(N-1)+1;i++) B.at(i) = count(A.begin(), A.end(), i);
  for (int i=A.at(N-1)+1;i<N;i++) B.push_back(0);
  for (int i=1;i<N+1;i++) cout<<B.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;
  cin>>n;
   vector<long long> v(n);
  for (int i = 0; i < n; i++) {
  cin >> v.at(i);
}
  vector<long long> a(n);
   vector<long long> b(n);
  for(int t;t=0;t++){
   a.at(t)=0;
     b.at(t)=0;
  }
   for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        a.at(j)=v.at(j)-v.at(i);
        if(a.at(j)<=0){
          a.at(j)=300000;
        }
        int m = *std::min_element(a.begin(), a.end());
       if(m!=0 &&a.at(j)=m){
          b.at(i)+=1;
        }
      }
      }
  for(int w;w=0;w<n){
  cout<<b.at(w)<<endl;
  }
}
     

Compiler output:
a.cc: In function 'int main()':
a.cc:25:16: error: lvalue required as left operand of assignment
   25 |        if(m!=0 &&a.at(j)=m){
      |           ~~~~~^~~~~~~~~
Language: C++

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

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


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

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, x, Si, i = 1;
  x = 1;
  Si = 1;
  cin >> N;
  for (i < N; i++) {
    int A[i];
    cin >> A[i];
  }
  if (A[i] == x){
    Si++;
  }
  else {
    Si = Si;
  }
  cout << Si << endl;
  x++;
}
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before ')' token
    9 |   for (i < N; i++) {
      |                  ^
      |                  ;
a.cc:13:7: error: 'A' was not declared in this scope
   13 |   if (A[i] == x){
      |       ^
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  int A[200005];
  int B[200005];
  cin >> N;
for( int i = 1; i < N; ++i){
  cin >> A[i];
  int p = A[i];
  B[p] += 1;
}
for( int i = 1; i <= N; ++i)cout << B[i] endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: expected ';' before 'endl'
   13 | for( int i = 1; i <= N; ++i)cout << B[i] endl;
      |                                         ^~~~~
      |                                         ;
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: expected ';' before '}' token
   11 |     count.at(A.at(i))+=1
      |                         ^
      |                         ;
   12 |   }
      |   ~
Language: C

/**
 * Dont raise your voice, improve your argument.
 * --Desmond Tutu
 */

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

vector<string> vec_splitter(string s) {
    for(char& c: s) c = c == ','?  ' ': c;
    stringstream ss; ss << s;
    vector<string> res;
    for(string z; ss >> z; res.push_back(z));
    return res;
}

void debug_out(vector<string> __attribute__ ((unused)) args, __attribute__ ((unused)) int idx) { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, Head H, Tail... T) {
    if(idx > 0) cerr << ", ";
    stringstream ss; ss << H;
    cerr << args[idx] << " = " << ss.str();
    debug_out(args, idx + 1, T...);
}

#ifdef XOX
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __VA_ARGS__)
#else
#define debug(...) 42
#endif

const double PI = acos(-1);
typedef long long ll;
#define int ll
#define fori(n) for(int i=0; i<int(n); i++)

#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cind(d) double d; cin>>d;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a, n) vd a(n); fori(n) { cin>>a[i]; }

typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;

void solve() {
    cini(n);
    vvi adj(n);
    for(int i=1; i<n; i++) {
        cini(aux);
        aux--;
        adj[aux].push_back(i);
        adj[i].push_back(aux);
    }

    cout<<adj[0].size()<<endl;
    for(int i=1; i<n; i++)  {
        cout<<adj[i].size()-1<<endl;
    }
}

signed main() {
    cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    solve();
}



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

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

int main() {
  
  int n;
  cin>>n;
   vector<long long> v(n);
  for (int i = 0; i < n; i++) {
  cin >> v.at(i);
}
  vector<long long> a(n);
   vector<long long> b(n);
  for(int t;t=0;t++){
   a.at(k)=0;
     b.at(k)=0;
  }
   for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        a.at(j)=v.at(j)-v.at(i);
        if(a.at(j)<=0){
          a.at(j)=300000;
        }
        int m = *std::min_element(a.begin(), a.end());
       if(m!=0 &&a.at(j)=m){
          b.at(i)+=1;
        }
      }
      }
  for(int w;w=0;w<n){
  cout<<b.at(w)<<endl;
  }
}
     
        
       
       
  

Compiler output:
a.cc: In function 'int main()':
a.cc:15:9: error: 'k' was not declared in this scope
   15 |    a.at(k)=0;
      |         ^
a.cc:25:16: error: lvalue required as left operand of assignment
   25 |        if(m!=0 &&a.at(j)=m){
      |           ~~~~~^~~~~~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
  int N;
  int A[200005];
  int B[200005];
  cin >> N;
for( i = 1; i < N; ++i){
  cin >> A[i];
  int p = A[i];
  B[p] += 1;
}
for( i = 1; i <= N; ++i)cout << B[i] endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:6: error: 'i' was not declared in this scope
    8 | for( i = 1; i < N; ++i){
      |      ^
a.cc:13:6: error: 'i' was not declared in this scope
   13 | for( i = 1; i <= N; ++i)cout << B[i] endl;
      |      ^
Language: C++

#include <iostream>
using namespace std;

int main(){
int N;
cin >> N;
vector<int> a(N);
 for (int i = 0; i < N; i++) {
   cin >> a.at(i);
 }
 vector<vector<int>> c(N);
 for (int i = 1; i < N; i++) {
   int b = a.at(i); 
   c.at(b).push_back(i); 
 }
    for (int i = 0; i <N; i++){
    cout << c.at(i).size() << endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:1: error: 'vector' was not declared in this scope
    7 | vector<int> a(N);
      | ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:7:8: error: expected primary-expression before 'int'
    7 | vector<int> a(N);
      |        ^~~
a.cc:9:11: error: 'a' was not declared in this scope
    9 |    cin >> a.at(i);
      |           ^
a.cc:11:16: error: expected primary-expression before 'int'
   11 |  vector<vector<int>> c(N);
      |                ^~~
a.cc:13:12: error: 'a' was not declared in this scope
   13 |    int b = a.at(i);
      |            ^
a.cc:14:4: error: 'c' was not declared in this scope
   14 |    c.at(b).push_back(i);
      |    ^
a.cc:17:13: error: 'c' was not declared in this scope
   17 |     cout << c.at(i).size() << endl;
      |             ^
Language: C++

#include<iostream>
using namespace std;
int main()
{

    int N;
    cin >> N;

    vector<int> vec;

    // 配列初期化
    for (i = 0; i < N; i++) {
        vec.at(i) = 0;
    }

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

        vec.at(A - 1) += 1;        
    }

    // 出力
    for (int i = 0; i < N; i++) {
        cout << vec.at(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> vec;
      |     ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include<iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:9:12: error: expected primary-expression before 'int'
    9 |     vector<int> vec;
      |            ^~~
a.cc:12:10: error: 'i' was not declared in this scope
   12 |     for (i = 0; i < N; i++) {
      |          ^
a.cc:13:9: error: 'vec' was not declared in this scope
   13 |         vec.at(i) = 0;
      |         ^~~
a.cc:16:10: error: 'i' was not declared in this scope
   16 |     for (i = 0; i < N - 1; i++) {
      |          ^
a.cc:20:9: error: 'vec' was not declared in this scope
   20 |         vec.at(A - 1) += 1;
      |         ^~~
a.cc:25:17: error: 'vec' was not declared in this scope
   25 |         cout << vec.at(i) <<  endl;
      |                 ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, x, Si, i = 1;
  x = 1;
  Si = 1;
  cin >> N;
  for (i < N; i++){
    int Ai;
    cin >> Ai;
  }
  if (Ai == x){
    Si++;
  }
  else {
    Si = Si;
  }
  cout << Si << endl;
  x++;
}
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before ')' token
    9 |   for (i < N; i++){
      |                  ^
      |                  ;
a.cc:13:7: error: 'Ai' was not declared in this scope; did you mean 'i'?
   13 |   if (Ai == x){
      |       ^~
      |       i
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; i++)
  {
    buka[i]=0;
  }
  for (int i = 0; i < n; i++)
  {
    for (int j = 0; j < n-1; j++)
    {
      if (i+1==num[j])
      {
        buka[i]=buka[i]+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: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:5: error: 'coun' was not declared in this scope; did you mean 'count'?
   11 |     coun.at(A.at(i))+=1
      |     ^~~~
      |     count
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, x, Si, i = 1;
  x = 1;
  Si = 1;
  cin >> N;
  for (i < N){
    int Ai;
    cin >> Ai;
    i++;
  
  if (Ai == x){
    Si++;
  }
  else {
    Si = Si;
  }
  cout << Si << endl;
  x++;
  }
}
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:9:13: error: expected ';' before ')' token
    9 |   for (i < N){
      |             ^
      |             ;
a.cc:23:1: error: expected primary-expression before '}' token
   23 | }
      | ^
a.cc:22:4: error: expected ';' before '}' token
   22 |   }
      |    ^
      |    ;
   23 | }
      | ~   
a.cc:23:1: error: expected primary-expression before '}' token
   23 | }
      | ^
a.cc:22:4: error: expected ')' before '}' token
   22 |   }
      |    ^
      |    )
   23 | }
      | ~   
a.cc:9:7: note: to match this '('
    9 |   for (i < N){
      |       ^
a.cc:23:1: error: expected primary-expression before '}' token
   23 | }
      | ^
Language: C++

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

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

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

#include <bits/stdc++.h>
using namespace std;
#define int long long
int main() {
    int N, M, ans = 0;
    cin >> N;
    vector<int> A(N), B(N);
    int min;
    for (int i = 0; i < N - 1; i++) {
        cin >> A.at(i);
    }
    M = A.at(0);
    int k = 0;
    for (int i = 0; i < N - 1; i++) {
        if (M != A.at(i)) {
            k++;
            M = A.at(i);
            B.at(k)++;
        } else
            B.at(k)++;
    }
    for (int i = 0; i < N; i++) {
        cout << B.at(i) << endl;
    }
}


Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

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

int main() {
  
  int n;
  cin>>n;
   vector<long long> v(n);
  for (int i = 0; i < n; i++) {
  cin >> v.at(i);
}
  vector<long long> a(n);
   vector<long long> b(n);
  for(int k;k=0;k++){
   a.at(k)=0;
     b.at(k)=0;
  }
   for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        a.at(j)=v.at(j)-v.at(i);
        if(a.at(j)<=0){
          a.at(j)=300000;
        }
        int min = *std::min_element(a.begin(), a.end());
       if(min!=0 &&a.at(j)=min){
          b.at(i)+=1;
        }
      }
      }
  cout<<b.at(i)<<endl;
}
     
        
       
       
  

Compiler output:
a.cc: In function 'int main()':
a.cc:25:18: error: lvalue required as left operand of assignment
   25 |        if(min!=0 &&a.at(j)=min){
      |           ~~~~~~~^~~~~~~~~
a.cc:30:14: error: 'i' was not declared in this scope
   30 |   cout<<b.at(i)<<endl;
      |              ^
Language: C++

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main(){
    int n;
    cin  >> n;
    vector<int>a[n];
    rep(i,n-1){
        int nu;
        cin >> nu;
        a.at(nu-1)++;
    }
    
    rep(i,n)cout << a.at(i) << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: request for member 'at' in 'a', which is of non-class type 'std::vector<int> [n]'
   13 |         a.at(nu-1)++;
      |           ^~
a.cc:16:23: error: request for member 'at' in 'a', which is of non-class type 'std::vector<int> [n]'
   16 |     rep(i,n)cout << a.at(i) << endl;
      |                       ^~
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	   Scanner in = new Scanner(System.in);
      	HashMap<Integer, Integer> hm = new HashMap<>();
	    int n = in.nextInt();
      	int ar[] = new int[n-1];
      	for(int i=0;i<n-1;i++){
          ar[i]=in.nextInt();
        }
     
      	for(int i:ar){
          if(!hm.containsKey(i))
            hm.put(i,1);
          else
            hm.put(i,hm.get(i)+1);
        }
        for(Map.Entry<Integer,Integer> me : hm.entrySet() ){
         	System.out.println(me.getValue()); 
        }
      	int rem= n-hm.size();
      	for(int i=0;i<rem;i++){
          System.out.println("0");
        
          
	}

}


Compiler output:
Main.java:30: error: reached end of file while parsing
}
 ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, x, Si, i = 1;
  x = 1;
  Si = 1;
  cin >> N;
  for (i < N; i++){
    int Ai;
    cin >> Ai;
  }
  if (Ai == x){
    Si++;
  }
  else {
    Si = Si
  }
  cout << Si << endl;
  x++;
}
    
    
  


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: expected ';' before ')' token
    9 |   for (i < N; i++){
      |                  ^
      |                  ;
a.cc:13:7: error: 'Ai' was not declared in this scope; did you mean 'i'?
   13 |   if (Ai == x){
      |       ^~
      |       i
a.cc:17:12: error: expected ';' before '}' token
   17 |     Si = Si
      |            ^
      |            ;
   18 |   }
      |   ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main()
{
    // 整数の入力
    int N;
    cin >> N;
    // スペース区切りの整数の入力
    int sum[N] = {0};
    int a;

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:15:22: error: expected ';' before '}' token
   15 |         sum[a-1] += 1
      |                      ^
      |                      ;
   16 | 
   17 |     }
      |     ~
Language: C

//
//  main.cpp
//  HelloWorld
//
//  Created by purple on 2020/04/13.
//  Copyright © 2020 Purple. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <string>
#include <fstream>

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...


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


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

n=int(input())
a=list(map(int,input().split()))
i=0
for i in range(len(a)):
    print(a.count(i+1))
    print('\n')
print(0)

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 main(){
  int a,c;
  cin>>a;
  vector<int> b(a);
  for(int i = 0;i < a;i++)
   cin>>b.at(i); 
  for(int i =0;i < a;i++){
    c = 0;
    for(int j = 0;j < a;j++){
      if(i == b.at(j))
        c++;
    }
    cout<<c<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> b(a);
      |   ^~~~~~
a.cc:2:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    1 | #include <iostream>
  +++ |+#include <vector>
    2 | using namespace std;
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int> b(a);
      |          ^~~
a.cc:8:9: error: 'b' was not declared in this scope
    8 |    cin>>b.at(i);
      |         ^
a.cc:12:15: error: 'b' was not declared in this scope
   12 |       if(i == b.at(j))
      |               ^
Language: C

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

int main() {
  int n;cin>>n;
  vector<int> buka(n);
  for (int i = 1; i < n; i++) {
    int id;cin>>id;
    buka.at(id-1)++;
  }
  for (int howMany : buka) cout << howMany << 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 n = N - 1;
  int A[n];
  int B[N];
  
  for(int i = 0; i < n; i++){
	  do{
       cin >> A[i];
  	  }while(A[i] > i + 2 || A[i] < 1);
  }
  
  for(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:19:7: error: 'i' was not declared in this scope
   19 |   for(i = 0; i < N; i++){
      |       ^
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.bigin(), A.end());
  int num = 1;
  int sum = 0;
  for(int i = 0; i < N; i++){
    
    if(A.at(i) == num) sum++;
    else{
      cout << sum << endl;
      sum = 0;
      num++;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:10: error: 'class std::vector<int>' has no member named 'bigin'; did you mean 'begin'?
   14 |   sort(A.bigin(), A.end());
      |          ^~~~~
      |          begin
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);
  }
  
  for (int j = 0; j < N - 1; j++) {
    int a(j); //jの数
    a(j) = 0;
    for (int k = 0; k < N - 1; k++) {
      if (A.at(k) == j) {
        a(j) +=1;
      }
    }
    cout << a(j) << endl;
  }
}
  
        


Compiler output:
a.cc: In function 'int main()':
a.cc:15:6: error: 'a' cannot be used as a function
   15 |     a(j) = 0;
      |     ~^~~
a.cc:18:10: error: 'a' cannot be used as a function
   18 |         a(j) +=1;
      |         ~^~~
a.cc:21:14: error: 'a' cannot be used as a function
   21 |     cout << a(j) << endl;
      |             ~^~~
Language: Java

import java.util.*;

class Main{
  public static void main(String[] args) {
    Scanner reader=new Scanner(System.in);
    int n=reader.nextInt();
    int buka[]=new int[n+1];
    int number[]=new int[n+1];
    buka[0]=0;
    for(int i=0;i<n;i++)
    {
      number[i]=0;
    }
    for(int i=2;i<=n;i++)
    {
      buka[i]=reader.nextInt();

      number[buka[i]]++;

    }
    for(int i=1;i<=n;i++)
  System.out.println(number[i]);

Compiler output:
Main.java:22: error: reached end of file while parsing
  System.out.println(number[i]);
                                ^
1 error
Language: Java

import java.util.*;
public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
	   Scanner in = new Scanner(System.in);
      	HashMap<Integer, Integer> hm = new HashMap<>();
	    int n = in.nextInt();
      	int ar[] = new int[n-1];
      	for(int i=0;i<n-1;i++){
          ar[i]=in.nextInt();
        }
     
      	for(int i:ar){
          if(!hm.containsKey(i))
            hm.put(i,1);
          else
            hm.put(i,hm.get(i)+1);
        }
      	System.out.println(hm);
        for(Map.Entry<Integer,Integer> me : hm.entrySet() ){
         	System.out.println(me.getValue()); 
        }
      	int rem= n-hm.size();
      	for(int i=0;i<rem;i++){
          System.out.println("0");
        
          
	}

}


Compiler output:
Main.java:31: error: reached end of file while parsing
}
 ^
1 error
Language: C

#include <stdio.h>
#include <stdlib.h>
int main(void){
  int *ip;
  int *emp;
  int num,i;
  scanf("%d",&num);
  ip = (int *)malloc(n * sizeof(int));
  emp = (int *)malloc(n * sizeof(int));

  for(int i = 0; i < num-1; i++){
    scanf("%d",&ip[i])
  }
  for(int i = 0; i < num; i++){
    for(int j = 0; j < num-1; j++){
      if(ip[j] == i + 1){
        emp[i]++;
      }
    }
  }
  for(int i=0; i < num; i++){
    printf("%d\n",emp[i]);
  }
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:22: error: 'n' undeclared (first use in this function)
    8 |   ip = (int *)malloc(n * sizeof(int));
      |                      ^
main.c:8:22: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:23: error: expected ';' before '}' token
   12 |     scanf("%d",&ip[i])
      |                       ^
      |                       ;
   13 |   }
      |   ~
Language: C++

#include<string>
#include<iostream>
#include <algorithm>
#include<vector>
#include<functional>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <numeric>
#define ll long long
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
using namespace std;



int main() {
ll N;
cin>>N;
vector<ll> A(N+1);
vector<ll> A_count(N+1,0);
for(ll j=2;j<N+1,j++) cin>>A[j];
for(ll i=2;i<N+1,i++){
for(ll k=1;k<i,k++){
    if(A[i]==k) A_count[k]++;

  } 
}
for(ll v=1;v<N+1;v++) cout<<A_counter[v]<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:21: error: expected ';' before ')' token
   21 | for(ll j=2;j<N+1,j++) cin>>A[j];
      |                     ^
      |                     ;
a.cc:22:21: error: expected ';' before ')' token
   22 | for(ll i=2;i<N+1,i++){
      |                     ^
      |                     ;
a.cc:23:19: error: expected ';' before ')' token
   23 | for(ll k=1;k<i,k++){
      |                   ^
      |                   ;
a.cc:28:29: error: 'A_counter' was not declared in this scope; did you mean 'A_count'?
   28 | for(ll v=1;v<N+1;v++) cout<<A_counter[v]<<endl;
      |                             ^~~~~~~~~
      |                             A_count
Language: C

//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

int main(){
    int N;
    cin >> N;
    int A[N];
    int B[N];
    map<int,int>mp;
    map<int,int>mp_2;
    for(int i=0;i<N-1;++i){
        cin >> A[i];
        mp[A[i]]++;
    }
    for(int i=1;i<N;++i){
        cout << mp[i] << endl;
    }
}

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

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

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 <bits/stdc++.h>
using namespace std;
int main() {
  int n; cin >> n;
  vector<int>a(n-1);
  for(int i; i<n-1; i++) cin >> a[i];
  vector<int> rsl(n);
  for(int i; i<n; i++) rsl[i]=0;
  for(int i; i<n-1; i++){
    rsl[a[i]-1] += 1;
  }
  for(int i; i<n; i++) cout << rsl[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 <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);++i)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

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

  cin >> n;
  vector<int> ans(n + 1, 0);

  REP(i, n - 1) {
    int a;
    cin >> a;
    a--;
    ans[a]++;
  }


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


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()
{
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    long long n;
    cin >> n;
    int m;
    m = n + 2;
    long long a[m] ;
    for (int i = 0; i < m;i++)
    {
        a[i] = 0;
    }

    for (int i = 2; i <= n; i++)
    {
        int b;
        cin >> b;
        a[b] += 1;
    }
    for (int i = 1; i <= n; i++)
    {
        cout << a[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;
 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++){
for(int K=0; k<N; k++){
if(vec.at(i)=k){
a.at(k)++;
}
}
 }
 for(int i=0; i<N; i++){
    cout<<a.at(i)<<endl;
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:14: error: 'k' was not declared in this scope
   13 | for(int K=0; k<N; k++){
      |              ^
Language: C

#include <iostream>
#include <vector>


using namespace std;
 
typedef long long ll;

int main(int argc, char const* argv[]) {
    // input
    int N;
    cin >> N;
    int a[N];
  
  for(int i=1;i<=N;i++){
		cin >> a[i];
  }
  vector<int>     v(a, a+sizeof(a));
    // process
    for (int i = 1; i <= N; i++) {
      size_t n_count = std::count(v.begin(), v.end(), i);
            cout << n_count << endl;
           
    }
 
    return 0;
}


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

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:14:30: error: expected ';' before ')' token
   14 |     for (int i = 0; i < N - 1) {
      |                              ^
      |                              ;
Language: Java

import java.util.ArrayList;
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        ArrayList<Integer> hey = new ArrayList<Integer>();
        for(int i=0;i<a-1;i++){
            int b = sc.nextInt();
            hey.add(b);
        }
        System.out.println(count(hey,hey.get(0))+" ");
        while(true){
            int g = count(hey,hey.get(0));
            int s=0;
            for(int h=0;h<g;h++){
                hey.remove(hey.get(0));
            }
            if(hey.size()==0){
                s=0;
            }
            else{
                s = count(hey,hey.get(0));
            }
                for(int f=0;f<g;f++){
                    if(f==0 ){
                        System.out.println(s);
                    }
                    else{
                        System.out.println(0);
                    }

                }
            if(hey.size()==0){
                break;
            }
        }

    }
    static int count(ArrayList<Integer> hey,int i){
        int sum=0;
        for(int a=0;a<hey.size();a++){
            if(i==hey.get(a)){
                sum+=1;
            }
        }
        return sum;
    }

Compiler output:
Main.java:48: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include<bits/stdc++>

using namespace std;
int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	int t=1;
	//cin >> t;
	while (t--) {
		int n;
		cin>>n;
		int a[n];	
		for(int i=0;i<n-1;i++){
			cin>>a[i];
		}
		for(int i=1;i<=n;i++){
			cout<<count(a,a+n,i)<<endl;
		}
	}
	return 0;
}

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

#include<stdio.h>

int main(void) {
	int n, i;
	int a[100000];
	int buka[100000] = { 0 };

	scanf_s("%d", &n);

	for (i = 0; i < n - 1; i++) {
		scanf_s("%d", &a[i]);
	}


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

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

	return 0;
}

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

#include <iostream>
using namespace std;

int main() {
  int N;
  cin>>N;
  int A[N];
  
  for(int n=1;n<=N;n++){
    int ans=0;
    for(int a=0;a<N,a++){
      cin>>A[a];
      if(A[a]==n){
        ans++;
        cout<<n<<endl;
      }
    }
  }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: error: expected ';' before ')' token
   11 |     for(int a=0;a<N,a++){
      |                        ^
      |                        ;
Language: C++

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

int main(){
  int n;
  vector<int> a(n-1);
  int count=0;
  
  cin>>n;
  for(int i=0;i<n-1;i++){
    cin>>a[i];
  }
  
  for(i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++){
      if(a[i]==a[j]){
        count=1;
        count++;
      }
    }
    cout<<count<<endl;
  }
}


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

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

int main() {
 int 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++){
for(int K-0; k<N; k++){
if(vec.at(i)=k){
a.at(k)++;
}
}
 }
 for(int i=0; i<N; i++){
    cout<<a.at(i)<<endl;
 }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:10: error: expected ';' before '-' token
   13 | for(int K-0; k<N; k++){
      |          ^
      |          ;
a.cc:13:14: error: 'k' was not declared in this scope
   13 | for(int K-0; k<N; k++){
      |              ^
a.cc:13:17: error: expected ')' before ';' token
   13 | for(int K-0; k<N; k++){
      |    ~            ^
      |                 )
a.cc:13:19: error: 'k' was not declared in this scope
   13 | for(int K-0; k<N; k++){
      |                   ^
Language: C++

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

int main(){
  int n;
  vector<int> a(n-1);
  int count=0;
  
  cin>>n;
  for(int i=0;i<n-1;i++){
    cin>>a[i];
  }
  
  for(i=0;i<n-2;i++;){
    for(int j=i+1;j<n-1;j++;){
      if(a[i]==a[j]){
        count=1;
        count++;
      }
    }
    cout<<count<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:7: error: 'i' was not declared in this scope
   15 |   for(i=0;i<n-2;i++;){
      |       ^
a.cc:15:20: error: expected ')' before ';' token
   15 |   for(i=0;i<n-2;i++;){
      |      ~             ^
      |                    )
a.cc:15:21: error: expected primary-expression before ')' token
   15 |   for(i=0;i<n-2;i++;){
      |                     ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  int a[n+1] = 0;
  int b[n+1] = 0;
  for (int i = 2; i <= n; i++){
    cin >> a[i];
    b[a[i]]++;
  }
  for (int j = 1; j <= n; j++){
    cout << b[j] << endl;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: array must be initialized with a brace-enclosed initializer
    7 |   int a[n+1] = 0;
      |                ^
a.cc:8:16: error: array must be initialized with a brace-enclosed initializer
    8 |   int b[n+1] = 0;
      |                ^