stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main()

{

  int n; cin >> n;

  int a[n+1];

  memset(a, 0, sizeof(a));

  for(int i = 1; i < n; i++)

  {

  	int x; cin >> x;

  	a[x]++;

  }

  for(int i= 1; i <= n; i++)

  cout << a[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 5.194463472212084x):
#include<stdio.h>

int main() {

	int i,n;

	scanf("%d",&n);

	int a;

	int b[n];

	for( i=0;i<n;i++) {

		b[i]=0;

	}

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

		scanf("%d",&a);

		b[a-1]=b[a-1]+1;

	}

	for( i=0;i<n;i++) {

		printf("%d\n",b[i]);

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define PI acos(-1)

using namespace std;

int main()

{

    int n,a;

    cin>>n;

    int b[n+10]={0};

    int m=n-1;

    while(m--)

    {

        cin>>a;

        b[a]++;

    }

    for(int i=1; i<=n; i++)

    {

        cout<<b[i]<<"\n";

    }

}


// Faster C++ solution for the same problem (measured speedup: 5.196141776784122x):
#include<stdio.h>

#include<math.h>



int n,i;

int main()

{

     scanf("%d",&n);

     int res[n],x,m;

     m=n-1; for(i=1;i<=n;i++) res[i]=0;







    while(m--)

    {

        scanf("%d",&x);

        res[x]++;

    }

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



}
// Slower C++ solution:
#include <iostream>

#include <array>



using namespace std;



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



int main() {

  array<int, 200000> count;

  fill(count.begin(), count.end(), 0);



  int n;

  cin >> n;

  Rep(i, n - 1) {

    int a;

    cin >> a;

    count[a - 1]++;

  }



  Rep(i, n) {

    cout << count[i] << endl;

  }

  return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.8075223601998147x):
#include <iostream>

#include <vector>



using namespace std;



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



int main() {



  int n;

  cin >> n;

  vector<int> count(n, 0);

  Rep(i, n - 1) {

    int a;

    cin >> a;

    count[a - 1]++;

  }



  Rep(i, n) {

    cout << count[i] << endl;

  }

  return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;



int main()

{

    int n; cin >> n;



    vector<int> num(1000000);

    

    for (int i = 2; i <= n; i++) {

        int tmp_a;

        cin >> tmp_a;

        num[tmp_a]++;

    }



    for (int i = 1; i <= n ; i++) {

        cout << num[i] << endl;

    }



    return 0;



}

// Faster C++ solution for the same problem (measured speedup: 2.8149411585552855x):
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;



int main()

{

    int n; cin >> n;



    vector<int> num(200001, 0);



    for (int i = 2; i <= n; i++) {

        int tmp; cin >> tmp;

        num[tmp]++;

    }



    for (int i = 1; i <= n; i++) {

        cout << num[i] << endl;

    }



    return 0;

}
// Slower C++ solution:
#include <iostream>

#include <vector>



int main()

{

    using std::cin;

    using std::cout;



    int N;

    cin >> N;



    std::vector A(2 * 100010, 0);

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

        int a;

        cin >> a;

        A[a - 1]++;

    }



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

        cout << A[i] << '\n';

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.8142395794658852x):
#include <iostream>

#include <vector>



int main()

{

    int N; std::cin >> N;



    std::vector A(N, 0);

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

        int a; std::cin >> a;

        A[a - 1]++;

    }



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

        std::cout << A[i] << '\n';

    }

}
// Slower C++ solution:
#include <iostream>

#include <vector>



int main()

{

    using std::cin;

    using std::cout;



    int N;

    cin >> N;



    std::vector A(2 * 100010, 0);

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

        int a;

        cin >> a;

        A[a - 1]++;

    }



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

        cout << A[i] << '\n';

    }

}

// Faster C++ solution for the same problem (measured speedup: 1.7779600402854858x):
#include <iostream>

#include <vector>



int main()

{

    std::cin.tie(nullptr);

    std::ios::sync_with_stdio(false);





    int N; std::cin >> N;



    std::vector A(N, 0);

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

        int a; std::cin >> a;

        A[a - 1]++;

    }



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

        std::cout << A[i] << '\n';

    }

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int num;

         int n;

     int ans[200010]={0};



   cin>>n;

    for(int i=2; i<=n; i++)

    {

        scanf("%d",&num);



        ans[num]++;

    }

    for(int i=1; i<=n; i++)

    {

        printf("%d\n",ans[i]);

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.8084757114020955x):
//#pragma GCC optimize("Ofast")

//#pragma GCC optimize ("unroll-loops")

//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")



#include <bits/stdc++.h>



#define fastio                              ios_base::sync_with_stdio(NULL); cin.tie(NULL); cout.tie(NULL);

#define read                                freopen("input.txt", "r", stdin);

#define write                               freopen("output.txt", "w", stdout);

#define nl                                  '\n'

#define mem(v,n)                            memset(v,n,sizeof(v))

#define debug(x)                            cerr << #x << " = " << x << nl

#define LCM(a,b)                            (a / __gcd(a,b) ) *b

#define GCD(a,b)                            __gcd(a,b)



#define ll                                  long long

#define ull                                 unsigned long long

#define vi                                  vector<int>

#define pb                                  push_back

#define vpii                                vector<pair<int, int>>

#define vpll                                vector<pair<ll, ll>>

#define mp                                  make_pair

#define ff                                  first

#define ss                                  second

#define all(v)                              v.begin(), v.end()

#define rsort(v)                            sort(v.rbegin(), v.rend())



using namespace std;



const double pi = 2*acos(0.0);







int main(){

    //fastio;

    //read;

    int n, x;

    cin >> n;

    int f[n+1];

    mem(f, 0);

    for(int i = 1; i < n; i++){

        cin >> x;

        f[x]++;

    }

    for(int i = 1; i <= n; i++) cout << f[i] << nl;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int num;

         int n;

     int ans[200010]={0};



   cin>>n;

    for(int i=2; i<=n; i++)

    {

        scanf("%d",&num);



        ans[num]++;

    }

    for(int i=1; i<=n; i++)

    {

        printf("%d\n",ans[i]);

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.8108958039241076x):
#include <stdio.h>



int main()

{

    int n,arr[200001]={},i,j,p;

    scanf("%d",&n);

    for(i=1;i<=n-1;i++) {

        scanf("%d",&p);

        arr[p]++;

    }

    for(j=1;j<=n;j++) {

        printf("%d\n",arr[j]);

    }



    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int num;

         int n;

     int ans[200010]={0};



   cin>>n;

    for(int i=2; i<=n; i++)

    {

        scanf("%d",&num);



        ans[num]++;

    }

    for(int i=1; i<=n; i++)

    {

        printf("%d\n",ans[i]);

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.8064781970122832x):
#include<iostream>

using namespace std;



int main()

{

    int n,count=0,i,j;

    cin >> n;

    int arr[n-1];

    int arr2[n];

    for(i=0; i<n-1; i++)

        cin >> arr[i];

    for(i=0; i<n; i++)

        arr2[i]=0;

    for(i=0; i<n-1; i++)

        arr2[arr[i]-1]++;

    for(i=0; i<n; i++)

        cout << arr2[i] << endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int num;

         int n;

     int ans[200010]={0};



   cin>>n;

    for(int i=2; i<=n; i++)

    {

        scanf("%d",&num);



        ans[num]++;

    }

    for(int i=1; i<=n; i++)

    {

        printf("%d\n",ans[i]);

    }

}


// Faster C++ solution for the same problem (measured speedup: 1.7853031648951236x):
#include<bits/stdc++.h>

using namespace std;

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



 

int main(){

	int n;

	map<int,int>mp;

	cin>>n;

	vector<int>a(n);

	rep(i,n-1){

		cin>>a[i];

		mp[a[i]]++;

	}

	// for(auto p:mp){

	// 	cout<<p.second<<endl;

	// }

	for(int i=1;i<=n;++i){

		cout<<mp[i]<<endl;

	}

}
// Slower C++ solution:
#include <bits/stdc++.h>



using namespace std;



int main() {



    long long n, x, arr[int(2e5 + 5)]{};



    cin >> n;

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

    {

        cin >> x;

        arr[x]++;

    }

    for (int i = 1; i <= n; i++)

    {

        cout << arr[i];

        if (n != 1 && i != n)

            cout <<"\n";

    }



    return 0;

}

// Faster C++ solution for the same problem (measured speedup: 2.5837799042722236x):
#include<bits/stdc++.h>

using namespace std;

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



 

int main(){

	int n;

	map<int,int>mp;

	cin>>n;

	vector<int>a(n);

	rep(i,n-1){

		cin>>a[i];

		mp[a[i]]++;

	}

	// for(auto p:mp){

	// 	cout<<p.second<<endl;

	// }

	for(int i=1;i<=n;++i){

		cout<<mp[i]<<endl;

	}

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int64_t N,A,b[200001]={};

    int64_t i,j,k;



    cin>>N;

    for(i=2;i<=N;i++){

        cin>>A;

        b[A]++;

    }

    for(i=1;i<=N;i++){

        cout<<b[i]<<endl;

    }

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 1.4555014265656743x):
#include<bits/stdc++.h>

using namespace std;



int main()

{

 int n; cin >> n;

 int num_of_sub[200001]={0};

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

 {

  int temp; cin>> temp;  num_of_sub[temp]++;

 }

 for(int i=1;i<n+1;i++)

 {

   cout<<num_of_sub[i]<<"\n";

 }

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int64_t N,A,b[200001]={};

    int64_t i,j,k;



    cin>>N;

    for(i=2;i<=N;i++){

        cin>>A;

        b[A]++;

    }

    for(i=1;i<=N;i++){

        cout<<b[i]<<endl;

    }

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 1.4381075768171354x):
#include <bits/stdc++.h>

#define FRU                                  freopen("out.txt","w",stdout);

#define FRO                                  freopen("in.txt","r",stdin);

#define pb                                   push_back

#define pf                                   push_front

#define ppb                                  pop_back()

#define ppf                                  pop_front()

#define mp                                   make_pair

#define ff                                   first

#define ss                                   second

#define flash                                ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define mem(ara,n)                           memset(ara,n,sizeof ara)

#define fr(i,j,n)                            for(i=j;i<n;i++)

#define rf(i,j,n)                            for(i=n;i>=j;i--)

#define inf                                  2147483647

#define ll                                   long long

#define ull                                  unsigned long long

#define pii                                  pair<int,int>

#define vi                                   vector<int>

#define vll                                  vector <long long>

#define vch                                  vector <char>

#define itr                                  ::iterator

#define msi                                  map<string,int>

#define psi                                  pair <string,int>

#define vii                                  vector <pair<int,int> >

#define all(n)                               n.begin(),n.end()

#define INF                                  10000000000000000LL

#define pi                                   3.1415926535897932384626434

#define sii                                  set <int>

#define max3(a,b,c)                          max(a,max(b,c))

#define min3(a,b,c)                          min(a,min(b,c))

#define mid3(a,b,c)                          min(max(a,b),max(b,c),max(a,b))

#define max4(a,b,c,d)                        max(max(a,b),max(c,d))

#define min4(a,b,c,d)                        min(min(a,b),min(c,d))

#define endl                                 '\n'

#define endll                                cout<<"\n";

#define spc                                  ' '

#define ld                                   long double



using namespace std;







int main()

{

    flash

    string s,st;

    int n,t,T,i,j,J,I,k,m;

    char ch;

    cin>>n;

    int boss[200005]={0};

    fr(i,1,n)

    {

        cin>>m;

        boss[m]++;

    }

    fr(i,1,n+1)cout<<boss[i]<<endl;

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int64_t N,A,b[200001]={};

    int64_t i,j,k;



    cin>>N;

    for(i=2;i<=N;i++){

        cin>>A;

        b[A]++;

    }

    for(i=1;i<=N;i++){

        cout<<b[i]<<endl;

    }

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 1.4564151124848976x):
#include<iostream>

#include<set>

#include<cstring>



using namespace std;



int arr[200005];



int main()

{

    int n, a;

    while(cin >> n) {

        memset(arr, 0, sizeof(arr));

        n--;

        for(int i = 0; i < n; i++) {

            cin >> a;

            arr[a]++;

        }

        for(int i = 1; i <= n+1; i++)

            cout << arr[i] << endl;

    }

    return 0;

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int64_t N,A,b[200001]={};

    int64_t i,j,k;



    cin>>N;

    for(i=2;i<=N;i++){

        cin>>A;

        b[A]++;

    }

    for(i=1;i<=N;i++){

        cout<<b[i]<<endl;

    }

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 2.5933512342714673x):
#include<bits/stdc++.h>

using namespace std;

int A[200001];

int main()

{

    map <int,int> mp;



    int i, n;

    cin >> n;

    for(i = 0; i < (n-1); i++)

    {

        cin >> A[i];

        mp[A[i]]++;

    }

    for(i = 1; i <= n; i++)

    {

         cout << mp[i] << endl;

    }





}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

 int n; cin >> n;

 int num_of_sub[200001]={0};

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

 {

  int temp; cin>> temp;  num_of_sub[temp]++;

 }

 for(int i=1;i<n+1;i++)

 {

   cout<<num_of_sub[i]<<"\n";

 }

}


// Faster C++ solution for the same problem (measured speedup: 1.781757947424761x):
#include<bits/stdc++.h>

using namespace std;

int A[200001];

int main()

{

    map <int,int> mp;



    int i, n;

    cin >> n;

    for(i = 0; i < (n-1); i++)

    {

        cin >> A[i];

        mp[A[i]]++;

    }

    for(i = 1; i <= n; i++)

    {

         cout << mp[i] << endl;

    }





}
// Slower C++ solution:
#include <bits/stdc++.h>

#define FRU                                  freopen("out.txt","w",stdout);

#define FRO                                  freopen("in.txt","r",stdin);

#define pb                                   push_back

#define pf                                   push_front

#define ppb                                  pop_back()

#define ppf                                  pop_front()

#define mp                                   make_pair

#define ff                                   first

#define ss                                   second

#define flash                                ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define mem(ara,n)                           memset(ara,n,sizeof ara)

#define fr(i,j,n)                            for(i=j;i<n;i++)

#define rf(i,j,n)                            for(i=n;i>=j;i--)

#define inf                                  2147483647

#define ll                                   long long

#define ull                                  unsigned long long

#define pii                                  pair<int,int>

#define vi                                   vector<int>

#define vll                                  vector <long long>

#define vch                                  vector <char>

#define itr                                  ::iterator

#define msi                                  map<string,int>

#define psi                                  pair <string,int>

#define vii                                  vector <pair<int,int> >

#define all(n)                               n.begin(),n.end()

#define INF                                  10000000000000000LL

#define pi                                   3.1415926535897932384626434

#define sii                                  set <int>

#define max3(a,b,c)                          max(a,max(b,c))

#define min3(a,b,c)                          min(a,min(b,c))

#define mid3(a,b,c)                          min(max(a,b),max(b,c),max(a,b))

#define max4(a,b,c,d)                        max(max(a,b),max(c,d))

#define min4(a,b,c,d)                        min(min(a,b),min(c,d))

#define endl                                 '\n'

#define endll                                cout<<"\n";

#define spc                                  ' '

#define ld                                   long double



using namespace std;







int main()

{

    flash

    string s,st;

    int n,t,T,i,j,J,I,k,m;

    char ch;

    cin>>n;

    int boss[200005]={0};

    fr(i,1,n)

    {

        cin>>m;

        boss[m]++;

    }

    fr(i,1,n+1)cout<<boss[i]<<endl;

    return 0;

}






// Faster C++ solution for the same problem (measured speedup: 1.8033082337353046x):
#include<bits/stdc++.h>

using namespace std;

int A[200001];

int main()

{

    map <int,int> mp;



    int i, n;

    cin >> n;

    for(i = 0; i < (n-1); i++)

    {

        cin >> A[i];

        mp[A[i]]++;

    }

    for(i = 1; i <= n; i++)

    {

         cout << mp[i] << endl;

    }





}
// Slower C++ solution:
#include<iostream>

#include<set>

#include<cstring>



using namespace std;



int arr[200005];



int main()

{

    int n, a;

    while(cin >> n) {

        memset(arr, 0, sizeof(arr));

        n--;

        for(int i = 0; i < n; i++) {

            cin >> a;

            arr[a]++;

        }

        for(int i = 1; i <= n+1; i++)

            cout << arr[i] << endl;

    }

    return 0;

}


// Faster C++ solution for the same problem (measured speedup: 1.7806401568071883x):
#include<bits/stdc++.h>

using namespace std;

int A[200001];

int main()

{

    map <int,int> mp;



    int i, n;

    cin >> n;

    for(i = 0; i < (n-1); i++)

    {

        cin >> A[i];

        mp[A[i]]++;

    }

    for(i = 1; i <= n; i++)

    {

         cout << mp[i] << endl;

    }





}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;

int main()

{

    int64_t N,A,b[200001]={};

    int64_t i,j,k;



    cin>>N;

    for(i=2;i<=N;i++){

        cin>>A;

        b[A]++;

    }

    for(i=1;i<=N;i++){

        cout<<b[i]<<endl;

    }

    return 0;



}


// Faster C++ solution for the same problem (measured speedup: 2.627594530352868x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long num;

    while(cin>>num)

    {

        long long arr[num+5],count[num+5]={0};

        for(long long i=0;i<num-1;i++)

        {

            cin>>arr[i];

            count[arr[i]]++;

        }

        for(long long i=1;i<=num;i++)

        {

            cout<<count[i]<<endl;

        }

      break;

    }

}
// Slower C++ solution:
#include<bits/stdc++.h>

using namespace std;



int main()

{

 int n; cin >> n;

 int num_of_sub[200001]={0};

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

 {

  int temp; cin>> temp;  num_of_sub[temp]++;

 }

 for(int i=1;i<n+1;i++)

 {

   cout<<num_of_sub[i]<<"\n";

 }

}


// Faster C++ solution for the same problem (measured speedup: 1.8052847509416763x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long num;

    while(cin>>num)

    {

        long long arr[num+5],count[num+5]={0};

        for(long long i=0;i<num-1;i++)

        {

            cin>>arr[i];

            count[arr[i]]++;

        }

        for(long long i=1;i<=num;i++)

        {

            cout<<count[i]<<endl;

        }

      break;

    }

}
// Slower C++ solution:
#include <bits/stdc++.h>

#define FRU                                  freopen("out.txt","w",stdout);

#define FRO                                  freopen("in.txt","r",stdin);

#define pb                                   push_back

#define pf                                   push_front

#define ppb                                  pop_back()

#define ppf                                  pop_front()

#define mp                                   make_pair

#define ff                                   first

#define ss                                   second

#define flash                                ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);

#define mem(ara,n)                           memset(ara,n,sizeof ara)

#define fr(i,j,n)                            for(i=j;i<n;i++)

#define rf(i,j,n)                            for(i=n;i>=j;i--)

#define inf                                  2147483647

#define ll                                   long long

#define ull                                  unsigned long long

#define pii                                  pair<int,int>

#define vi                                   vector<int>

#define vll                                  vector <long long>

#define vch                                  vector <char>

#define itr                                  ::iterator

#define msi                                  map<string,int>

#define psi                                  pair <string,int>

#define vii                                  vector <pair<int,int> >

#define all(n)                               n.begin(),n.end()

#define INF                                  10000000000000000LL

#define pi                                   3.1415926535897932384626434

#define sii                                  set <int>

#define max3(a,b,c)                          max(a,max(b,c))

#define min3(a,b,c)                          min(a,min(b,c))

#define mid3(a,b,c)                          min(max(a,b),max(b,c),max(a,b))

#define max4(a,b,c,d)                        max(max(a,b),max(c,d))

#define min4(a,b,c,d)                        min(min(a,b),min(c,d))

#define endl                                 '\n'

#define endll                                cout<<"\n";

#define spc                                  ' '

#define ld                                   long double



using namespace std;







int main()

{

    flash

    string s,st;

    int n,t,T,i,j,J,I,k,m;

    char ch;

    cin>>n;

    int boss[200005]={0};

    fr(i,1,n)

    {

        cin>>m;

        boss[m]++;

    }

    fr(i,1,n+1)cout<<boss[i]<<endl;

    return 0;

}






// Faster C++ solution for the same problem (measured speedup: 1.8271195929363937x):
#include<bits/stdc++.h>

using namespace std;

int main()

{

    long long num;

    while(cin>>num)

    {

        long long arr[num+5],count[num+5]={0};

        for(long long i=0;i<num-1;i++)

        {

            cin>>arr[i];

            count[arr[i]]++;

        }

        for(long long i=1;i<=num;i++)

        {

            cout<<count[i]<<endl;

        }

      break;

    }

}