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

#include <bits/stdc++.h>
using namespace std;
using in6 = int64_t;
using ind = double;
using vi = vector<in6>;
using vii = vector<vi>;
using vs = vector<string>;
using pii = pair<in6,in6>;
using psi = pair<string,in6>;
using vpi = vector<pii>;
using vps = vector<psi>;
#define rep(i, n) for (in6 i = 0; i < (in6)(n); i++)
#define repa(i,a,n) for(in6 i = a; i < (in6)(n); i++)
#define repdown(i,n) for(in6 i = n; i > 0; i--)
#define kyun ios::sync_with_stdio(false)
#define hinata cout << "\n"
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define inf 2147483647
#define dset(n) cout << fixed << setprecision(n)

void yes() {
  cout << "Yes";
}

void no() {
  cout << "No";
}

int main() {
  kyun;
  in6 n;
  cin >> n;
  vi data(n-1);
  rep(i,n-1) cin >> data[i];
  vi ans(n,0);
  rep(i,n-1) {
    ans[data[i]-1]++;
  }
  rep(i,n) cout << ans[i] << \n;
}

Compiler output:
a.cc:40:30: error: stray '\' in program
   40 |   rep(i,n) cout << ans[i] << \n;
      |                              ^
Language: C++

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

}

Compiler output:
a.cc:5:1: error: expected initializer before 'int'
    5 | int main()
      | ^~~
Language: C++

#include <iostream>
using namespace std;

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

signed main(){
	int n;
	cin>>n;
	int m = n-1;
	int freq[m];
	f(i.m) freq[i]=0;
	int dummy;
	f(i,m){
		cin>>dummy;
		freq[dummy]++;
	}
	f(i,m) cout<<freq[i]<<endl;
	return 0;
}

Compiler output:
a.cc:12:14: error: macro "f" requires 2 arguments, but only 1 given
   12 |         f(i.m) freq[i]=0;
      |              ^
a.cc:4:9: note: macro "f" defined here
    4 | #define f(i,n) for(int i=0;i<n;i++)
      |         ^
a.cc: In function 'int main()':
a.cc:12:9: error: 'f' was not declared in this scope
   12 |         f(i.m) freq[i]=0;
      |         ^
Language: C++

#include<iostream>
using namespace std;
int main()
{
 int n;
  cin>>n;
  int i,j,a[n];
for(i=2;i<=n;i++)
{ cin>>j;
  a[j]++;
}
  for(i=1;i<=n;i++)
cout<<a[i]<<'\n;
}


Compiler output:
a.cc:13:13: warning: missing terminating ' character
   13 | cout<<a[i]<<'\n;
      |             ^
a.cc:13:13: error: missing terminating ' character
   13 | cout<<a[i]<<'\n;
      |             ^~~~
a.cc: In function 'int main()':
a.cc:14:1: error: expected primary-expression before '}' token
   14 | }
      | ^
Language: C++

#include<iostream.h>
using namespace std;

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

int main(){
int n;
cin>>n;
  
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;
  return 0;
}

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

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

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

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:22: error: declaration does not declare anything [-fpermissive]
    4 |     typedef int long long;
      |                      ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    typedef int long long;//大样例炸拉！！！
    int n;
    int a[10010],b[10010];
    cin>>n;
    for(int i=1;i<n;i++)cin>>a[i];
    for(int i=1;i<n;i++)b[a[i]-1]++;
    for(int i=0;i<n;i++)cout<<b[i]<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:22: error: declaration does not declare anything [-fpermissive]
    4 |     typedef int long long;//大样例炸拉！！！
      |                      ^~~~
Language: C

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

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

    vector<int> data(N);
    vector<int> out(N,0);

    N--;

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

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

    for(int i=0; i<=N; i++){
        out[data[i]]++;
    }
    
    for(int i=1; i<=N; i++){
        cout << out[i];
    }
}

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

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

Compiler output:
main.c:2:1: error: expected identifier or '(' before numeric constant
    2 | 2 int ans[200010];
      | ^
main.c:3:1: error: expected identifier or '(' before numeric constant
    3 | 3 int main(){
      | ^
Language: C

#include <bits/stdc++.h>//復習必須
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < n; ++i)
using ll = long long;
using namespace std;
#define P pair<int, int>
int main () {
    ll N ;
    cin >> N ;

    map<ll , ll> hyou ;
    for(ll j = 0 ; j < N  ; j++ ){
        hyou[j] = 0 ;
    }
    ll a[N-1] ;
    for(ll i = 0 ; i < N -1 ; i++){
        cin >> a[i] ;
        if(a[i] != 0){
            hyou[a[i]-1]++ ;
        }
    }
    
    for(ll j = 0 ; j < N ; j++){
        cout << hyou[j] << endl;
    }
    

    

    return 0 ;
}

 


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

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

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

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

#include <iostream>
#include <queue>
#include <map>
#include <cmath>
#include <algorithm>
#include <queue>
#include <cstdarg>
#include <set>
#include <limits>
#include <iomanip>

using namespace std;
#define INF 2e9 + 9
#define MOD 1000000007
#define ALL(v) v.begin() , v.end()
#define Int int64_t
#define pll pair<Int,Int>
template<class T> using pql = priority_queue<T, vector<T>>;
template<class T> using pq = priority_queue<T, vector<T>, greater<T>>;
#define ll(n) Int n; cin >> n;
#define LL(...) Int __VA_ARGS___; cin >> __VA_ARGS___;
#define OUT(...) cout << __VA_ARGS___;
#define RP(n, i, s) for(Int i = s ;i < n ;i++)
#define REP(n, i) for (Int i = 0; i < n; i++)
#define REPe(n, i) for (Int i = 1; i <= n; i++)
#define RPe(n, i, s) for (Int i = s; i <= n; i++)
#define upd_max(maxer, updater) if (maxer < updater) maxer = updater;
#define upd_min(miner, updater) if (miner > updater) miner = updater;

void ansYes(bool flag){
    if (flag) cout << "Yes" << endl; else  cout << "No" << endl;
}

void ansYES(bool flag){
    if (flag) cout << "YES" << endl; else  cout << "NO" << endl;
}

struct node {
    Int to;
    Int length;
};


vector<Int> divisor(Int n) {
    vector<Int> ret;
    for (Int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    return (ret);
}

/*
vector<vector<int>> to;
vector<int> flag;
vector<int> c;


Int dfs(int from, int mae) {
    flag[from] = 1;
    Int mini = 0;
    for (auto next : to[from]) {
        if (next == mae) continue;
        if (flag[next] == 1) {
            return -1;
        } else {
            mini = min(mini, dfs(next, from));
        }
    }
    return mini;
}*/

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

int nanko(string s,Int n,Int i){
    Int length = min(n - i - 1,i);
    Int ans = 0;
    for (int k = i-length;k < i;k++){
        if (s.at(k) == 'R' && s.at(i +  (i - k) == 'B')) ans++;
    }
    return ans;
}


int main() {
    Int n;
    cin >> n;
    vector<Int> a(n);
    REP(n-1,i){
        Int x;
        cin >> x;
        a.at(x-1)++;
    }
    REP(n,i){
        cout << a.at(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>
using namespace std;

int main()
{
    int i,j,sum;
    int N; 
    cin >> N;
    int n[N];
    int A[N-1]; 
    for ( i = 0; i < N-1; i++){cin >> A[i];}

    j = 0;
    sum = 0;

    for ( i = 0; i < N; i++)
    {
        
        if(sum != N)
        {
            n[i] = 1;
            sum += 1;

            while ((A[j] == A[j+1]) && ( j < N-1 ))
            {
                n[i] += 1;
                sum += 1;
                j += 1;
            }
        }
        else
        {  
            while (i<N)
            {
                n[i] = 0:
                cout << endl;
            }

            return 0;
        }
            cout << endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:35:25: error: expected ';' before ':' token
   35 |                 n[i] = 0:
      |                         ^
      |                         ;
Language: C++

int main()
{
    int i,j;
    int N; 
    cin >> N;
    int n[N];
    int A[N-1]; 
    for ( i = 0; i < N-1; i++){cin >> A[i];}

    j = 0;

    for ( i = 0; i < N; i++)
    {
        
            n[i] = 1;

            while (A[j] == A[j+1])
            {
                n[i] += 1;
                j += 1;
            }
            putchar('\n');
    }



    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> N;
      |     ^~~
a.cc:22:13: error: 'putchar' was not declared in this scope; did you mean 'char'?
   22 |             putchar('\n');
      |             ^~~~~~~
      |             char
Language: C++

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

    j = 0;

    for ( i = 0; i < N; i++)
    {
        if (n[i] != 0)
        {
            n[i] = 1;

            while (A[j] == A[j+1])
            {
                n[i] += 1;
                j += 1;
            }
            putchar('\n');
        }
    }


    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:12: error: 'cin' was not declared in this scope
    4 |     int N; cin >> N;
      |            ^~~
a.cc:10:5: error: 'j' was not declared in this scope
   10 |     j = 0;
      |     ^
a.cc:23:13: error: 'putchar' was not declared in this scope; did you mean 'char'?
   23 |             putchar('\n');
      |             ^~~~~~~
      |             char
Language: C

#include <iostream>
using namespace std;

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

    j = 0;

    for ( i = 0; i < N; i++)
    {
        if (n[i] != 0)
        {
            n[i] = 1;

            while (A[j] == A[j+1])
            {
                n[i] += 1;
                j += 1;
            }
            putchar('\n');
        }
    }


    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 main()
{
    int i;
    int N; cin >> N;
    int n[N];
    int A[N-1]; cin >> A;
    for ( i = 1; i < N; i++){n[i] = i;}

    j = 0;

    for ( i = 0; i < N; i++)
    {
        if (n[i] != 0)
        {
            n[i] = 1;

            while (A[j] == A[j+1])
            {
                n[i] += 1;
                j += 1;
            }
            cout << 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>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
template <class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

template <int mod>
struct ModInt {
    int val;
    ModInt() : val(0) {}
    ModInt(long long x) : val(x >= 0 ? x % mod : (mod - (-x) % mod) % mod) {}
    int getmod() { return mod; }
    ModInt &operator+=(const ModInt &p) {
        if ((val += p.val) >= mod) {
            val -= mod;
        }
        return *this;
    }
    ModInt &operator-=(const ModInt &p) {
        if ((val += mod - p.val) >= mod) {
            val -= mod;
        }
        return *this;
    }
    ModInt &operator*=(const ModInt &p) {
        val = (int)(1LL * val * p.val % mod);
        return *this;
    }
    ModInt &operator/=(const ModInt &p) {
        *this *= p.inverse();
        return *this;
    }
    ModInt operator-() const { return ModInt(-val); }
    ModInt operator+(const ModInt &p) const { return ModInt(*this) += p; }
    ModInt operator-(const ModInt &p) const { return ModInt(*this) -= p; }
    ModInt operator*(const ModInt &p) const { return ModInt(*this) *= p; }
    ModInt operator/(const ModInt &p) const { return ModInt(*this) /= p; }
    bool operator==(const ModInt &p) const { return val == p.val; }
    bool operator!=(const ModInt &p) const { return val != p.val; }
    ModInt inverse() const {
        int a = val, b = mod, u = 1, v = 0, t;
        while (b > 0) {
            t = a / b;
            swap(a -= t * b, b);
            swap(u -= t * v, v);
        }
        return ModInt(u);
    }
    ModInt pow(long long n) const {
        ModInt ret(1), mul(val);
        while (n > 0) {
            if (n & 1) ret *= mul;
            mul *= mul;
            n >>= 1;
        }
        return ret;
    }
    friend ostream &operator<<(ostream &os, const ModInt &p) { return os << p.val; }
    friend istream &operator>>(istream &is, ModInt &a) {
        long long t;
        is >> t;
        a = ModInt<mod>(t);
        return (is);
    }
    static int get_mod() { return mod; }
};
const int MOD = 1000000007;  // if inv is needed, this shold be prime.
using modint = ModInt<MOD>;

int main() {
    int N;
    cin >> N;
    vector<int> A(N - 1), ans(N, 0);
    for (int i = 0; i < N - 1; i++) {
        cin >> A.at(i);
        ans[A[i] - 1]++;
    }
    for (auto a : ans) {
        cout << a << "\n";
    }
}


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 <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define MP make_pair

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

int main(){
	int n;
	cin >> n;
	int a[n];
	std::vector<int> sol(n) ;
	for (int i = 1; i < n; ++i)
	{
		cin >> a[i];
		sol[a[i]-1]++;
	}
	for (int i = 0; i < n; ++i)
	{
		cout << sol[i] <<"\n";
	}

	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 main(){

    int n;

    cin >> n;

    int a[n];
    a[0]=1;

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

    int p[n]

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

    return 0;
}

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

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

Compiler output:
main.c: In function 'main':
main.c:13:24: error: expected ';' before ')' token
   13 |   for(i=0; i < sum, i++){
      |                        ^
      |                        ;
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:13:24: error: expected ';' before ')' token
   13 |   for(i=0; i < sum, i++){
      |                        ^
      |                        ;
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:10:17: error: 'input' undeclared (first use in this function); did you mean 'int'?
   10 |     scanf("%d", input);
      |                 ^~~~~
      |                 int
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:24: error: expected ';' before ')' token
   13 |   for(i=0; i < sum, i++){
      |                        ^
      |                        ;
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:18: error: variable-sized object may not be initialized except with an empty initializer
    7 |   int num[sum] = {0};
      |                  ^
main.c:10:17: error: 'input' undeclared (first use in this function); did you mean 'int'?
   10 |     scanf("%d", input);
      |                 ^~~~~
      |                 int
main.c:10:17: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:24: error: expected ';' before ')' token
   13 |   for(i=0; i < sum, i++){
      |                        ^
      |                        ;
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:7:18: error: variable-sized object may not be initialized except with an empty initializer
    7 |   int num[sum] = {0, };
      |                  ^
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i=0; i < sum-1; i++){
      |       ^
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:17: error: 'input' undeclared (first use in this function); did you mean 'int'?
   10 |     scanf("%d", input);
      |                 ^~~~~
      |                 int
main.c:13:24: error: expected ';' before ')' token
   13 |   for(i=0; i < sum, i++){
      |                        ^
      |                        ;
Language: C

#include<stdio.h>

int main(){
  int sum;
  scanf("%d", sum);
  
  int num[sum] = {0, };
  
  for(i=0; i < sum-1; i++){
    scanf("%d", input);
    num[input]++;
  }
  for(i=0; i < sum, i++){
    printf("%d\n", num);
  }
  
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:7:18: error: variable-sized object may not be initialized except with an empty initializer
    7 |   int num[sum] = {0, };
      |                  ^
main.c:9:7: error: 'i' undeclared (first use in this function)
    9 |   for(i=0; i < sum-1; i++){
      |       ^
main.c:9:7: note: each undeclared identifier is reported only once for each function it appears in
main.c:10:17: error: 'input' undeclared (first use in this function); did you mean 'int'?
   10 |     scanf("%d", input);
      |                 ^~~~~
      |                 int
main.c:13:24: error: expected ';' before ')' token
   13 |   for(i=0; i < sum, i++){
      |                        ^
      |                        ;
Language: C

#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<numeric>
#include<cmath>
#include<queue>
#include<stack>
#include<list>
#include<unordered_map>
#include<unordered_set>
#include<cctype>
#include<iomanip>
#include<limits>
#include<bitset>

using namespace std;
typedef long long int ll; typedef pair<int, int> P; typedef unsigned long long int ull;
const ll mod = 1000000007;
const int inf = 1e9 + 7;
const ll linf = 1LL << 60;
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define REP(i,m,n) for(int i=(m);i<(int)n;i++)
#define all(a) (a).begin(),(a).end()
#define allg(a) (a).begin(),(a).end(),greater<>()
#define SUM(a) accumulate((a).begin(),(a).end(),0)
#define d10 std::setprecision(10)
#define d20 std::setprecision(20)
#define vec vector<int>
#define vecb vector<bool>
#define vecd vector<double>
using str = string;
const double PI = 3.14159265359;
ll gcd(ll a, ll b) { ll t; while (b != 0) { t = a % b; a = b; b = t; }return a; }
int gcd(int a, int b) { int t; while (b != 0) { t = a % b; a = b; b = t; }return a; }
ll recfact(ll start, ll n) {
	ll i;
	if (n <= 16) {
		ll r = start;
		for (i = start + 1; i < start + n; i++) r = r * i % mod;
		return r % mod;
	}
	i = n / 2;
	return recfact(start, i) % mod * recfact(start + i, n - i) % mod;
}
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}
ll fct(ll n) { return recfact(1, n); }
ll ncm(ll n, ll m) {
	if (n < m)return 0;
	ll x = (fct(n) % mod / (fct(m) * fct(n - m)) % mod) % mod;
	return x;
}
std::string sreverse(string str, int firstItr, int secondItr) {
	if (firstItr < 0 || secondItr>int(str.size() - 1))return str;
	while (firstItr < secondItr) {
		swap(str[firstItr], str[secondItr]);
		firstItr++; secondItr--;
	}
	return str;
}
std::string RunLengthEncoding(std::string str) {
	int itr = 0; std::string res;
	while (itr < int(str.size())) {
		char tmp = str[itr++];
		int length = 1;
		while (itr <int(str.size()) && str[itr] == tmp) { ++itr; ++length; }
		res.push_back(tmp);
		res += to_string(length);
	}
	return res;
}
std::string split(std::string str, size_t first_itr, size_t second_itr) {
	std::string tmp;
	for (size_t i = first_itr; i < second_itr + 1; i++) {
		tmp.push_back(str.at(i));
	}
	return tmp;
}



int main() {
	int n; cin >> n;
	vec v(n, 0);
	rep(i, n - 1) {
		int tmp; cin >> tmp;
		v[tmp - 1]++;
	}
	rep(i, n) {
		cout << v[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 <bits/stdc++.h>
using vi = vector<int>;
using namespace std;
int main() {
  int N;
  cin >> N;
  vi per(N + 1);
  int Ai;
  for (int i = 1; i < N; ++i) {
    cin >> Ai;
    per[Ai]++;
  }
  for (int i = 1; i <= N; ++i) {
    cout << per[i] << endl;
  }
  return 0;
}


Compiler output:
a.cc:2:12: error: 'vector' does not name a type
    2 | using vi = vector<int>;
      |            ^~~~~~
a.cc: In function 'int main()':
a.cc:7:3: error: 'vi' was not declared in this scope
    7 |   vi per(N + 1);
      |   ^~
a.cc:11:5: error: 'per' was not declared in this scope
   11 |     per[Ai]++;
      |     ^~~
a.cc:14:13: error: 'per' was not declared in this scope
   14 |     cout << per[i] << endl;
      |             ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vi per(N + 1);
  int Ai;
  for (int i = 1; i < N; ++i) {
    cin >> Ai;
    per[Ai]++;
  }
  for (int i = 1; i <= N; ++i) {
    cout << per[i] << endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vi' was not declared in this scope
    6 |   vi per(N + 1);
      |   ^~
a.cc:10:5: error: 'per' was not declared in this scope
   10 |     per[Ai]++;
      |     ^~~
a.cc:13:13: error: 'per' was not declared in this scope
   13 |     cout << per[i] << endl;
      |             ^~~
Language: C

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=1;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
typedef long long ll;
#define _GLIBCXX_DEBUG
typedef vector<int> vec;
typedef vector<ll> lvec;
typedef vector<char>cvec;
typedef pair<ll, ll> LP;
typedef tuple<ll, ll, ll> LT;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;
int main()	{
  int n;
  cin>>n;
  vector<int>a(n),d(n);
  rep(i,n) {
    cin>>a[i];
    a[i]--;
  }
  rep(i,n)
    d[a[i]]++;
  for(auto x:d)
    cout<<x<<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()
{
  int64_t N, X;
  X = 0;
  vector<int64_t> A(N+1);
  cin >> N;
  for (int64_t i = 2; i < N+1 ; i++) {
    cin >> A.at(i);
  }
  
  for(int64_t i = 1; i < N + 1; i++) {
    for (int64_t j = 2; j < N+1; j++) {
      if (i == A.at(j)) {
        X++;
      }
      if(j　==　N){
        cout << X <<endl;
        cout << endl;
        X=0;
      }
    }
  }

}

      


Compiler output:
a.cc:19:10: error: extended character 　 is not valid in an identifier
   19 |       if(j　==　N){
      |          ^
a.cc:19:15: error: extended character 　 is not valid in an identifier
   19 |       if(j　==　N){
      |               ^
a.cc: In function 'int main()':
a.cc:19:10: error: 'j\U00003000' was not declared in this scope
   19 |       if(j　==　N){
      |          ^~~
a.cc:19:15: error: '\U00003000N' was not declared in this scope
   19 |       if(j　==　N){
      |               ^~~
Language: C++

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

int main()
{
  int64_t N, X;
  X = 0;
  vector<int64_t> A(N+2);
  cin >> N;
  for (int64_t i = 2; i < N+1 ; i++) {
    cin >> A.at(i);
  }
  
  for(int i=0; i<N + 1; i++) {
    for (int j = 2; j < N+1; j++) {
      if (i = A.at(j)) {
        X++;
      }
      if(j=N){
        cout << X <<endl;
        cout << endl;
        X=0;
      }
    }

}

      


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

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

int main()
{
  int64_t N, X;
  X = 0;
  vector<int64_t> A(N);
  cin >> N;
  for (int i = 0; i < N - 1; i++) {
    cin >> A.at(i);
  }
  int i = 1;
  while (i < N + 1) {
    for (int j = 0; j < N - 1; j++) {
      if (i = A.at(j)) {
        X++;
      }
      else {
      }
    }
    cout << X << endl;
    X = 0;
    i++;
    
  }

}

      


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 <bits/stdc++.h>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

int main(){
   int n; cin>>n;
   vector<int> a(n-1);
   for(int i=0;i<n-1;i++) cin>>a[i];
   vector<int> ans(n);
   for(int i=0;i<n-1;i++){
       for(int j=0;j<n;j++){
           if(a[i]==j+1) ans[j]++;
       }
   }
   for(int i=0;i<n;i++) cout<<ans[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 b[200005];
int main()
{
    int n,m,i;
    scanf("%d",&n);

    for(i=0; i<n-1; i++)
    {
        scanf("%d",&m);
        b[m]++;
    }
    for(i=1; i<=n; i++)
        printf("%d\n",b[i]);

    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,m,i,b[200005]={0};
    scanf("%d",&n);

    for(i=0; i<n-1; i++)
    {
        scanf("%d",&m);
        b[m]++;
    }
    for(i=1; i<=n; i++)
        printf("%d\n",b[i]);

    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 <stdint.h>
#include <inttypes.h>
int main(void){
  uint32_t n;
  scanf("%"PRIu32, &n);
  uint32_t *d;
  do{ d=calloc(n, sizeof(uint32_t)); }while(!d);
  for(uint32_t i=0; i<n; i++){
    uint32_t a;
    scanf("%"PRIu32, &a);
    d[a-1]++;
  }
  for(uint32_t i=0; i<n; i++){
    printf("%d"PRIu32"\n", d[i]);
  }
  free(d); d=NULL;
}


Compiler output:
main.c: In function 'main':
main.c:5:3: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   scanf("%"PRIu32, &n);
      |   ^~~~~
main.c:3:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
    2 | #include <inttypes.h>
  +++ |+#include <stdio.h>
    3 | int main(void){
main.c:5:3: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   scanf("%"PRIu32, &n);
      |   ^~~~~
main.c:5:3: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:7:9: error: implicit declaration of function 'calloc' [-Wimplicit-function-declaration]
    7 |   do{ d=calloc(n, sizeof(uint32_t)); }while(!d);
      |         ^~~~~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'calloc'
    2 | #include <inttypes.h>
  +++ |+#include <stdlib.h>
    3 | int main(void){
main.c:7:9: warning: incompatible implicit declaration of built-in function 'calloc' [-Wbuiltin-declaration-mismatch]
    7 |   do{ d=calloc(n, sizeof(uint32_t)); }while(!d);
      |         ^~~~~~
main.c:7:9: note: include '<stdlib.h>' or provide a declaration of 'calloc'
main.c:14:5: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   14 |     printf("%d"PRIu32"\n", d[i]);
      |     ^~~~~~
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:14:5: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:14:5: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:16:3: error: implicit declaration of function 'free' [-Wimplicit-function-declaration]
   16 |   free(d); d=NULL;
      |   ^~~~
main.c:16:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:16:3: warning: incompatible implicit declaration of built-in function 'free' [-Wbuiltin-declaration-mismatch]
main.c:16:3: note: include '<stdlib.h>' or provide a declaration of 'free'
main.c:16:14: error: 'NULL' undeclared (first use in this function)
   16 |   free(d); d=NULL;
      |              ^~~~
main.c:3:1: note: 'NULL' is defined in header '<stddef.h>'; this is probably fixable by adding '#include <stddef.h>'
    2 | #include <inttypes.h>
  +++ |+#include <stddef.h>
    3 | int main(void){
main.c:16:14: note: each undeclared identifier is reported only once for each function it appears in
   16 |   free(d); d=NULL;
      |              ^~~~
Language: C

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

int main(){
    int N, A[10000], i, j, c[10000];
    cin >> N;
    for(i = 2; i <=N; i++){
        cin >> A[i];
    }
    for(i = 1; i <= N; i++){
        for(j = 1; j<=N; j++){
            if(i==A[j]){
                c[i]++;
            }
        }
    }
    for(i=1; i<=N; i++){
        cout<<c[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; 
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n" 
#define pb push_back
#define mp make_pair
typedef long long int ll;
 
int main()
{
    fast;
    ll n;
    cin >> n;
    long long arr[n + 1];
    map<ll, ll> umap;
    for(ll i = 0; i < n - 1; i++){
        cin >> arr[i];
        umap[arr[i] - 1]++;
    }
 
    for(ll i = 0; i < n; i++){
        if(umap.find(i) != umap.end()){
            cout << umap[i] << " ";
        }
        else{
            cout << 0 << " ";
        }
    }
    cout << 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: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

/**
 * N 人の社員からなる会社があり、各社員には 1, ..., N の社員番号が割り当てられています。 社員番号 1
 * の社員以外の全ての社員には、自分より社員番号が小さい直属の上司がちょうど 1 人います。 X さんが Y さんの直属の上司であるとき、Y さんは X
 * さんの直属の部下であるといいます。 社員番号 i の社員の直属の上司の社員番号が A_i
 * であることが与えられます。各社員について直属の部下が何人いるか求めてください。 Input: N A_2 ... A_N
 */
public final class MainABC163C {
  public static void main(final String[] args) throws Exception {
    try (final BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); final PrintWriter out = new PrintWriter(System.out)) {
      execute(in, out);
      out.flush();
    }
  }

  private static void execute(final BufferedReader in, final PrintWriter out) throws Exception {
    int n = readInt(in);
    int[] a = readIntArray(in); // A_2 ... A_N
    int[] r = new int[n];
    for (int an : a) {
      r[an - 1]++;
    }
    for (int rn : r) {
      out.println(rn);
    }
  }

  public static int readInt(final BufferedReader in) throws IOException {
    return Integer.parseInt(in.readLine());
  }

  public static int[] readIntArray(final BufferedReader in) throws IOException {
    return Arrays.stream(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
  }
}


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

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

/**
 * N 人の社員からなる会社があり、各社員には 1, ..., N の社員番号が割り当てられています。 社員番号 1
 * の社員以外の全ての社員には、自分より社員番号が小さい直属の上司がちょうど 1 人います。 X さんが Y さんの直属の上司であるとき、Y さんは X
 * さんの直属の部下であるといいます。 社員番号 i の社員の直属の上司の社員番号が A_i
 * であることが与えられます。各社員について直属の部下が何人いるか求めてください。 Input: N A_2 ... A_N
 */
public final class MainABC163C {
  public static void main(final String[] args) throws Exception {
    final StringBuilder result = new StringBuilder();
    try (final BufferedReader in = new BufferedReader(new InputStreamReader(System.in))) {
      execute(in, result);
    }
    try (final PrintWriter out = new PrintWriter(System.out)) {
      out.print(result);
      out.flush();
    }
  }

  private static void execute(final BufferedReader in, final StringBuilder result) throws Exception {
    int n = readInt(in);
    int[] a = readIntArray(in); // A_2 ... A_N
    int[] r = new int[n];
    for (int an : a) {
      r[an - 1]++;
    }
    for (int rn : r) {
      result.append(rn).append('\n');
    }
  }

  public static int readInt(final BufferedReader in) throws IOException {
    return Integer.parseInt(in.readLine());
  }

  public static int[] readIntArray(final BufferedReader in) throws IOException {
    return Arrays.stream(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
  }
}


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

#include<bits/stdc++.h>

using namespace std;
#define l long long int 

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

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

N=input()
lista=list(map(int,input().split()))
  for _ in range(1,N+1)
print(lista.count(_))

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | N=input()
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'N' [-Wimplicit-int]
main.c:1:3: error: implicit declaration of function 'input' [-Wimplicit-function-declaration]
    1 | N=input()
      |   ^~~~~
main.c:1:3: error: initializer element is not constant
main.c:2:1: error: expected ',' or ';' before 'lista'
    2 | lista=list(map(int,input().split()))
      | ^~~~~
Language: C++

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

Compiler output:
a.cc:3:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    3 | main() {
      | ^~~~
a.cc: In function 'int main()':
a.cc:11:30: error: expected ';' before 'for'
   11 |  sort(vec.begin(), vec.end())
      |                              ^
      |                              ;
   12 | 
   13 |  for (int i=0; i<N; i++){
      |  ~~~                          
a.cc:13:16: error: 'i' was not declared in this scope
   13 |  for (int i=0; i<N; i++){
      |                ^
Language: C

#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = a; i < b; ++i)
#define all(c) c.begin(), c.end()
#define gmax(x,y) x=max(x,y)
#define gmin(x,y) x=min(x,y)
#define gadd(x,y) x=add(x,y)
#define gmul(x,y) x=mul(x,y)
using namespace std;

typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;

const int N = 2e5 + 5;
int cnt[N];

int main(){
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	int n;
	cin >> n;
	rep(i,0,n-1){
		int x;
		cin >> x;
		++cnt[x];
	}
	rep(i,1,n+1)cout << cnt[i] << '\n';
}


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

	return 0;
}

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

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

int main()
{
 	long long n;
    cin>>n;
  	long long a[n+1]={0};
  long long ans[n+1]={0};
  	for(long long i = 2; i <= n; i++)
    {
      cin>>a[i];
      ans[a[i]]+=1;
    }
  	for(long long i = 1; i <= n;i i++)
    {
      	cout<<ans[i]<<'\n';
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:38: error: expected ')' before 'i'
   15 |         for(long long i = 1; i <= n;i i++)
      |            ~                         ^~
      |                                      )
a.cc:15:42: error: expected ';' before ')' token
   15 |         for(long long i = 1; i <= n;i i++)
      |                                          ^
      |                                          ;
Language: C

#include "bits/stdc++.h"
#define int long long
#define endl '\n'
using namespace std;
 
typedef long long ll;
#define db(x) cerr << #x << ": " << x << '\n';
#define read(a) int a; cin >> a;
#define readb(a, b) int a, b; cin >> a >> b;
#define readc(a, b, c) int a, b, c; cin >> a >> b >> c;
#define readarr(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}

#define print(a) cout << a << endl;
#define printarr(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printv(v) for (int i: v) cout << i << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define all(v) v.begin(), v.end()
#define sz(v) (int)(v.size())
#define rz(v, n) v.resize((n) + 1);
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define vvi vector <vi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;
const ll N = 2e5 + 1;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	read(n);
	int adj[n + 1] = {};
	FOR (i, 2, n)
	{
	    read(x);
	    adj[x]++;
	}
	
	FOR (i, 1, n) cout << adj[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 em;
    int co;
    cin >> em;

    vector<int> data(em);
    for (int i = 2; i <= em; i++){
         cin >> data.at(i);
    }

    vector<int> data(co);
    for (int i = 2; i <= em; i++){
         cin >> data.at(data(i))++;
    }

    vector<int> data(co);    
    for (int i = 1; i <= em; i++){
        cout << data.at(i);
    }

}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: redeclaration of 'std::vector<int> data'
   14 |     vector<int> data(co);
      |                 ^~~~
a.cc:9:17: note: 'std::vector<int> data' previously declared here
    9 |     vector<int> data(em);
      |                 ^~~~
a.cc:16:29: error: no match for call to '(std::vector<int>) (int&)'
   16 |          cin >> data.at(data(i))++;
      |                         ~~~~^~~
a.cc:19:17: error: redeclaration of 'std::vector<int> data'
   19 |     vector<int> data(co);
      |                 ^~~~
a.cc:9:17: note: 'std::vector<int> data' previously declared here
    9 |     vector<int> data(em);
      |                 ^~~~
Language: C

#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>
#include <queue>
#include <set>
#include <bitset>
#include <map>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<long long> vll;
typedef queue<int, int> qii;
typedef pair<int, int> pii;
typedef pair<string, int> psi;

#define PI 3.14159265359
#define rep(i,a) for(int i=0;i<a;i++)

//int型を受け取ってその桁数を返す
int check_digits(int n, int m) {
	int digits = 0;
	while (n != 0) {
		n /= m;
		digits++;
	}
	return digits;
}

//int型を受け取ってその各桁の和を返す
int sum_digits(int n) {
	int sum = 0;
	int N = n;
	while (N) {
		sum += N % 10;
		N /= 10;
	}
	return sum;
}


//最大公約数を返す関数
int gcd(int n, int m) {
	while (n != 0) {
		if (n < m) swap(n, m);
		n = n % m;
	}
	return m;
}


//2点間の距離を返す
float dis(int x1, int y1, int x2, int y2) {
	return sqrt(pow(abs(x1 - x2), 2) + pow(abs(y1 - y2), 2));
}


//入力された文字列が回文か判断してboolを返す
bool is_kaibun(string s) {
	string s_r(s.rbegin(), s.rend());
	return (s == s_r);
}


void yes() { cout << "Yes" << endl; }
void no() { cout << "No" << endl; }


//提出言語もしっかり確認して…
//問題文を落ち着いて読む！
//型に注意！！
//出力例もちゃんと全部見る！！！！！
int main() {
	int n,temp;
	cin >> n;
	vi a(n,0);
	rep(i, n-1) {
		cin >> temp;
		a[temp-1]++;
	}

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

	system("pause");
	return 0;
}


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() {
    int N;
    cin >> N;
    vector<int> A(N, 1);
    for (int i = 1; i < N; i++) {
        cin >> A.at(i);
    }
    map<int, int> cnt;
    for (int i = 1; i < N; i++) {
        cnt[A.at(i) - 1]++;
    }

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

    return 0;
}

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

#include<stdio.h>

int main(){
	int n=0,m=0;
	scanf("%d",&n);
	int t[n]={0};
	for(int i=0;i<n-1;i++){
		scanf("%d",&m);
		t[m-1]++;
	}
	for(int i=0;i<n;i++){
		printf("%d\n",t[i]);
	}
}

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

#include <iostream>
#include <cstdio>

int main(){
	long n;
	cin >> n;
	long A[n];
	long x;
	long B[n];
	for(long i = 1; i < n; i++){
      cin >> x;
      A[i] = x - 1;
    }
  
  for(long i = 0; i < n; i++){
      B[i] = 0;
    }
  
  for(long i = 0; i < n; i++){
      for(long j = 0; j < n; j++){
        if(A[j] == i){
          B[i]++;
        }
      }
    }
	
  for(long i = 0; i < n; i++){
      printf("%lld\n", B[i]);
    }
  
  

}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
Language: C++

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

int main(int argc, char *argv[])
{
	int n, i;
	cin >> n;
	int result[n];
	int input[n - 1];

	memset(result, 0, sizeof(result));

	for (i = 0; i < n - 1; i++)
		cin >> input[i];

	for (i = 0; i < n - 1; i++)
		result[input[i] - 1]++;

	for (i = 0; i < n; i++)
		cout << result[i] << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:13:9: error: 'memset' was not declared in this scope
   13 |         memset(result, 0, sizeof(result));
      |         ^~~~~~
a.cc:3:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <vector>
  +++ |+#include <cstring>
    3 | #include <string>