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

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

int main() {


	int N;
	cin >> N;
	vector<int> A;
	int temp;

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

	temp = 0;

	for (int i = 0; i < N - 1; i++) {
		size_t n_count = std::count(A.begin(), A.end(), i + 1);
		cout << n_count << endl;
	}
	cout << 0 << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:39: error: 'count' is not a member of 'std'; did you mean 'cout'?
   21 |                 size_t n_count = std::count(A.begin(), A.end(), i + 1);
      |                                       ^~~~~
      |                                       cout
Language: C++

#include <iostream>
using namespace std;

int main(){
  int n;
  cin >> n;
  int a[n+1] = 0;
  int b[n+1] = 0;
  for (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;
      |                ^
a.cc:9:8: error: 'i' was not declared in this scope
    9 |   for (i = 2; i <= n; i++){
      |        ^
Language: C++

using namespace std;

int n;
int dpp[200005];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    int a;
    for (int i = 2; i <= n; i++)
    {
        cin >> a;
        dpp[a]++;
    }
    for (int i = 1; i <= n; i++)
    {
        cout << dpp[i] << '\n';
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'ios_base' has not been declared
    8 |     ios_base::sync_with_stdio(false);
      |     ^~~~~~~~
a.cc:9:5: error: 'cin' was not declared in this scope
    9 |     cin.tie(0);
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:10:5: error: 'cout' was not declared in this scope
   10 |     cout.tie(0);
      |     ^~~~
a.cc:10:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
Language: C++

#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <vector>
#define rep(i, N) for(int i = 0; i < N; ++i)

typedef long long ll;
using namespace std;

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

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

    rep(i, n)
    {
        cout << boss[i] << endl;
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:19: error: expected ',' or ';' before 'for'
    6 | #define rep(i, N) for(int i = 0; i < N; ++i)
      |                   ^~~
a.cc:17:5: note: in expansion of macro 'rep'
   17 |     rep(i, n-1)
      |     ^~~
a.cc:17:9: error: 'i' was not declared in this scope
   17 |     rep(i, n-1)
      |         ^
a.cc:6:34: note: in definition of macro 'rep'
    6 | #define rep(i, N) for(int i = 0; i < N; ++i)
      |                                  ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ln "\n"
#define pb push_back
#define pll pair<ll,ll>
#define ppll pair<ll,pll>
#define vll vector<ll>
#define vpll vector<pll>
#define vvll vector<vector<ll>>
#define sll stack<ll>
#define qll queue<ll>
#define mp make_pair
#define f first
#define s second
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define Test ll t;cin>>t; while(t--)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define init(x,n,v) for(ll i=0;i<=n;i++) x[i]=v;
#define all(x) x.begin(),x.end()
ll MOD = 1e9+7 , MAX = 1e18 , k=1e9;
int main() 
{
	fast_io;
	ll n,k;
	cin>>n;
	vll a(n+1,0);
	for(ll i=1;i<n;i++) cin>>k , a[k]++;
	for(i=1;i<=n;i++) cout<<a[i]<<ln;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:13: error: 'i' was not declared in this scope
   31 |         for(i=1;i<=n;i++) cout<<a[i]<<ln;
      |             ^
Language: C++

#include <iostream>
using namespace std;

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


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int> 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> A;
      |          ^~~
a.cc:9:3: error: expected ',' or ';' before 'for'
    9 |   for(int n=1;n<=i;n++){
      |   ^~~
a.cc:9:15: error: 'n' was not declared in this scope
    9 |   for(int n=1;n<=i;n++){
      |               ^
Language: C++

using namespace std;
int main(void){
    int n;
    cin>>n;
    vector<int> data(n-1);
    for (int i=0; i<n-1; i++){
        int a;
        cin>>a;
        data[i]=a;
    }
    sort(data.begin(),data.end());
    reverse(data.begin(),data.end());
    for (int i=0; i<n; i++){
        int l=data.size();
        int count=0;
        for (int j=l-1; j>=0; j--){
            if (i==(data[j]-1)){
                count+=1;
            }
            else{
                break;
            }
        }
        for (int j=l-count; j<l; j++){
            data.pop_back();
        }
        cout<<count<<endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin>>n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:5:5: error: 'vector' was not declared in this scope
    5 |     vector<int> data(n-1);
      |     ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:5:12: error: expected primary-expression before 'int'
    5 |     vector<int> data(n-1);
      |            ^~~
a.cc:9:9: error: 'data' was not declared in this scope
    9 |         data[i]=a;
      |         ^~~~
a.cc:11:10: error: 'data' was not declared in this scope
   11 |     sort(data.begin(),data.end());
      |          ^~~~
a.cc:11:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |     sort(data.begin(),data.end());
      |     ^~~~
      |     short
a.cc:12:5: error: 'reverse' was not declared in this scope
   12 |     reverse(data.begin(),data.end());
      |     ^~~~~~~
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout<<count<<endl;
      |         ^~~~
a.cc:27:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:27:22: error: 'endl' was not declared in this scope
   27 |         cout<<count<<endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;
Language: C

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

ans = [0] * (N+1)

for i in A:
    ans[i] += 1

for i in ans[1:]:
    print(i)

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

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

int main() {


	int N;
	cin >> N;
	vector<int> A;
	int temp;

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

	temp = 0;

	for (int i = 0; i < N - 1; i++) {
		size_t n_count = count(A.begin(), A.end(), i + 1);
		cout << n_count << endl;
	}
	cout << 0 << endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:21:34: error: 'count' was not declared in this scope; did you mean 'n_count'?
   21 |                 size_t n_count = count(A.begin(), A.end(), i + 1);
      |                                  ^~~~~
      |                                  n_count
Language: C++

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

    for (int i = 0; i < N-1; i++){
        cin >> A[i];
    }
    
    for (int i = 1; i < N+1; i++){
        cout << count(A, A+N-1, i)
    }
    
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:35: error: expected ';' before '}' token
   16 |         cout << count(A, A+N-1, i)
      |                                   ^
      |                                   ;
   17 |     }
      |     ~
Language: C++

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

int main() {
  int n;
  cin >> n;
  vector<int>a(n),cnt(n+2);
  rep(i,n){
    cin >> a[i];
    cnt[a[i]]++
  }
  rep(i,n) cout << cnt[a[i]+1] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:16: error: expected ';' before '}' token
   13 |     cnt[a[i]]++
      |                ^
      |                ;
   14 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
main()
{

int n;
cin>>n;
int a[n+1];
a[0]=0;
for(int i=27
1 2 3 4 5 6;i<=n;i++)
     cin>>a[i];
int ans[n+1];
unordered_map<int,int> m;
for(int i=n;i>=1;i--)
{
    ans[i]=m[i];
   m[a[i]]++;
}
for(int i=1;i<=n;i++)
    cout<<ans[i]<<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:10:13: error: expected ';' before numeric constant
   10 | for(int i=27
      |             ^
      |             ;
   11 | 1 2 3 4 5 6;i<=n;i++)
      | ~            
a.cc:11:2: error: expected ';' before numeric constant
   11 | 1 2 3 4 5 6;i<=n;i++)
      |  ^~
      |  ;
a.cc:11:4: error: expected ')' before numeric constant
   11 | 1 2 3 4 5 6;i<=n;i++)
      |    ^~
      |    )
a.cc:10:4: note: to match this '('
   10 | for(int i=27
      |    ^
a.cc:11:6: error: expected ';' before numeric constant
   11 | 1 2 3 4 5 6;i<=n;i++)
      |      ^~
      |      ;
a.cc:11:13: error: 'i' was not declared in this scope
   11 | 1 2 3 4 5 6;i<=n;i++)
      |             ^
Language: C

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector <int> a(N);
  a.at(0)=0;
  int n_count;
  
  for(int i=0;i<N-1;i++){
  	cin >> a.at(i+1);
  }
  for(int i=0;i<N;i++){
    n_count = std::count(a.begin(), a.end(), i+1);
    cout << n_count << 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()
{   ios_base::sync_with_stdio(0);
    cin.tie(0);
    map<int,int> mapp;
    long long n,m,a,s,k;
    cin >> n;
    k=n-1;
    while(k--)
    {   cin >> a;
        mapp[a]++;
    }
    for(int i=1;i<=n;i++)
    {
        cout << mapp[i]<<endl;
    }
    
    return 0;
}


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

#include <bits/stdc++.h>
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(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:10:2: error: no match for call to '(std::vector<int>) (int&)'
   10 | a(i)=0;
      | ~^~~
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>
using namespace std;

int main(){
  long long int N;
  long long int A[200000];
  long long int B[200000] = 0;

  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 = 1; i < N + 1; i++){
    cout << B[i] << endl;
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:7:29: error: array must be initialized with a brace-enclosed initializer
    7 |   long long int B[200000] = 0;
      |                             ^
Language: C++

int main()
{
	int N, c, s;
	vector<int> b;
	cin >> N;
	b.push_back(0);
	for (int i = 1; i < N; i++)
	{
		cin >> c;
		b.push_back(0);

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

Compiler output:
a.cc: In function 'int main()':
a.cc:4:9: error: 'vector' was not declared in this scope
    4 |         vector<int> b;
      |         ^~~~~~
a.cc:4:16: error: expected primary-expression before 'int'
    4 |         vector<int> b;
      |                ^~~
a.cc:5:9: error: 'cin' was not declared in this scope
    5 |         cin >> N;
      |         ^~~
a.cc:6:9: error: 'b' was not declared in this scope
    6 |         b.push_back(0);
      |         ^
a.cc:16:17: error: 'cout' was not declared in this scope
   16 |                 cout << b[i] << endl;
      |                 ^~~~
a.cc:16:33: error: 'endl' was not declared in this scope
   16 |                 cout << b[i] << endl;
      |                                 ^~~~
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << 0;
      |         ^~~~
Language: C

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

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



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

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n-1);
  for(int i=0;i<n-1;i++){
    cin>>a[i];
  }
  map<int,int>mp;
  rep(i,n)mp[i]=0;
  set<int>st;
  for(int i=0;i<n-1;i++){
    if(st.count(a[i])){
      mp[a[i]]++;
    }else {
      st.insert(a[i]);
      mp[a[i]]=1;
    }
  }
  for(int i=1;i<n;i++){
    cout<<mp[i])<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:16: error: expected ';' before ')' token
   24 |     cout<<mp[i])<<endl;
      |                ^
      |                ;
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;
 
void Main()
{
	int N;
  
  	cin >> N;
    
    int A[N];
    int B[N];
    
    A[0] = 0;
    for(int i = 1; i < N; i++){
    	cin >> A[i]
    }
    
    for(int i = 0; i < N; i++){
    	B[i] = 0;
    }
    
    for(int i = 1; i < N; i++){
    	B[A[i]-1] = B[A[i]-1] + 1;
    }
    
    for(int i = 0; i < N; i++){
    	printf("%d\n", B[i]);
    }
    
	
	
}
 
int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

n = int(input())
a = list(map(int, input().split()))
li = []
for i in range(n):
    li.append(0)
for x in a:
    li[x-1] += 1
for s in li:
    print(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 ar[1000005];

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


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

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;

void Main()
{
	int N;
  
  	cin >> N;
    
    int A[N];
    int B[N];
    
    A[0] = 0;
    for(i = 1; i < N; i++){
    	cin >> A[i]
    }
    
    for(int i = 0; i < N; i++){
    	B[i] = 0;
    }
    
    for(int i = 1; i < N; i++){
    	B[A[i]-1] = B[A[i]-1] + 1;
    }
    
    for(int i = 0; i < N; i++){
    	printf("%d\n", B[i]);
    }
    
	
	
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C

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

int main() {
  int n;
  cin >> n;
  vector<int>a(n),cnt(n+2);
  rep(i,n){
    cin >> a[i];
    cnt[a[i]]++
  }
  rep(i,n) cout << cnt[a[i]+1] << 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>
using namespace std;

int A, list[200001] = { 0 };

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

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

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

int main(){
long long n,k;
cin>>n;
vector<long long> vec(n-1);
for(int i=0;i<n-1;i++){
cin>>vec.at(i);
}
vector<long long> ans(n);
for(int i=0;i<n-1;i++){
for(int a=0;a<n-2;a++){
if(vec.at(i)==a){
ans.at(a-1)+=1;
}
}
}
for(int i=0;i<n;i++){
cout<<ans.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: Java

import java.util.Scanner;
public class MainC {
	public static void main(String[] args) {
			
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();

			int a[] = new int[n];
						
			for(int i=1; i<n; i++) {
				a[i-1] = sc.nextInt();
			}
			
			int b[] = new int[n];
			
			for(int i=0; i<n;i++) {
				b[i]=0;
			}

			for(int i=0; i<n-1;i++) {
				b[a[i]-1]++;
			}
			
			for(int i=0; i<n;i++) {
				System.out.println(b[i]);
				
			}
	}
}

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

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


int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  p.at(0) = -1;
  for (int i = 1; i < n; i++) {
    cin >> p.at(i);
  }
  vector<vector<int>> children(n);  
 for (int i = 1; i < n; i++) {
   int parent = p.at(i);  
   children.at(parent).push_back(i);  
 }
 int ans;
 for (int i = 1; i < n; i++) {
   cout << children.at(i).size() << endl;
 }
 cout << 0 << 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++

n = int(input())
dicti = dict({})
for i in range(1,n+1):
    dicti.update({i : 0})
arr = list(map(int,input().split()))
for x in arr:
    a = dicti[x]
    dicti.update({x : a+1})
for i in range(1,n+1):
    print(dicti[i])

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = int(input())
      | ^
a.cc:2:16: error: expected unqualified-id before ')' token
    2 | dicti = dict({})
      |                ^
a.cc:4:25: error: expected unqualified-id before ')' token
    4 |     dicti.update({i : 0})
      |                         ^
a.cc:8:27: error: expected unqualified-id before ')' token
    8 |     dicti.update({x : a+1})
      |                           ^
Language: C

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

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

}

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

public class Main {
	public static void main(String[] args) {
			
			Scanner sc = new Scanner(System.in);
			int n = sc.nextInt();

			int a[] = new int[n];
						
			for(int i=1; i<n; i++) {
				a[i-1] = sc.nextInt();
			}
			
			int b[] = new int[n];
			
			for(int i=0; i<n;i++) {
				b[i]=0;
			}

			for(int i=0; i<n-1;i++) {
				b[a[i]-1]++;
			}
			
			for(int i=0; i<n;i++) {
				System.out.println(b[i]);
				
			}
	}
}

Compiler output:
Main.java:4: error: cannot find symbol
			Scanner sc = new Scanner(System.in);
			^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
			Scanner sc = new Scanner(System.in);
			                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C

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


int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  p.at(0) = -1;
  for (int i = 1; i < n; i++) {
    cin >> p.at(i);
  }
  vector<vector<int>> children(n);  // ある組織の子組織の番号一覧
 for (int i = 1; i < n; i++) {
   int parent = p.at(i);  // i番の親組織の番号
   children.at(parent).push_back(i);  // parentの子組織一覧にi番を追加
 }
 int ans;
 for (int i = 1; i < n; i++) {
   cout << children.at(i).size() << endl;
 }
 cout << 0 << 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>
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 i=0;i<N-1;i++){
    for(int j=1;i<N+1;j++){
      int k = 0;
      if(j==a.at(i))
        k++;
    }
      cout << k << endl;
  }
}


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

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

int main() {
	// your code goes here
   int n;
   cin>>n;
   int ar[n-1];
   for(int i=0;i<n-1;i++)
    cin>>ar[i];
   int fr[n+1];
   for(int i=0;i<=n;i++)
    fr[i]=0;
   for(int i=0;i<n-1;i++)
    fr[ar[i]]++;
   for(int i=1;i<=n;i++) cout<<fr[i]<<endl; 
	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;

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

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

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



int main()
{

    int n;
    cin>>n;


    vector<int> v(n-1);

    map<int,int> m;
    map<int,int> :: iterator it;


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

        m[v[i]]++;


    }


    //cout<<m.size()<<endl;


    for(it=m.begin();it!=m.end();it++){
        cout<<it->secondf<<endl;
    }



    int x=n-m.size();


    for(int i=1;i<=x;i++)cout<<0<<endl;;



    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: 'struct std::pair<const int, int>' has no member named 'secondf'; did you mean 'second'?
   32 |         cout<<it->secondf<<endl;
      |                   ^~~~~~~
      |                   second
Language: C++

#include<bits/stdc++>
using namespace std;
int main(){
  int n,i;
  cin>>n;
  int ar[n];
  unordered_map<int,int> mp;
  for(i=1;i<=n-1;i++){
    cin>>ar[i];
    if(mp.count(ar[i])>0)
      mp[ar[i]]++;
    else
      mp[ar[i]]=1;
  }
  for(i=1;i<=n;i++)
    cout<<mp[ar[i]]<<"\n";
 }


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

#include <bits/stdc++.h>
#define exrep(i, a, b) for(long long i = a; i <= b; i++)
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

ll gcd(ll x, ll y){
  if(x%y==0)return y;
  return gcd(y,x%y);
}
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}
template<class Abel> struct UnionFind {
    vector<int> par;
    vector<int> rank;
    vector<Abel> diff_weight;

    UnionFind(int n = 1, Abel SUM_UNITY = 0) {
        init(n, SUM_UNITY);
    }

    void init(int n = 1, Abel SUM_UNITY = 0) {
        par.resize(n); rank.resize(n); diff_weight.resize(n);
        for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0, diff_weight[i] = SUM_UNITY;
    }

    int root(int x) {
        if (par[x] == x) {
            return x;
        }
        else {
            int r = root(par[x]);
            diff_weight[x] += diff_weight[par[x]];
            return par[x] = r;
        }
    }

    Abel weight(int x) {
        root(x);
        return diff_weight[x];
    }

    bool issame(int x, int y) {
        return root(x) == root(y);
    }

    bool merge(int x, int y, Abel w) {
        w += weight(x); w -= weight(y);
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y), w = -w;
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        diff_weight[y] = w;
        return true;
    }

    Abel diff(int x, int y) {
        return weight(y) - weight(x);
    }
};
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

  
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  ll n;
  cin >> n;
  map<ll,ll>mp;
  rep(i,n-1){
    ll a;
    cin >> a;
    mp[a]++;
  }
  rep(i,n){
    cout << mp[i+1] << 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: Java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
class Main{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(bf.readLine());
        int[] ls = Arrays.stream(bf.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
        int[] dic = new int[n];
        for (int i = 0; i < n; i++)
            dic[i] = 0;
        for (int i = 0; i < n - 1; i++){
            dic[ls[i] - 1]++;
        }
        for (int i = 0; i < n; i++){
            System.out.println(ls[i]);
        }
}

Compiler output:
Main.java:10: error: illegal start of type
        for (int i = 0; i < n; i++)
        ^
Main.java:10: error: > or ',' expected
        for (int i = 0; i < n; i++)
                             ^
Main.java:10: error: <identifier> expected
        for (int i = 0; i < n; i++)
                                ^
Main.java:11: error: ']' expected
            dic[i] = 0;
                ^
Main.java:11: error: ';' expected
            dic[i] = 0;
                 ^
Main.java:12: error: illegal start of type
        for (int i = 0; i < n - 1; i++){
        ^
Main.java:12: error: > or ',' expected
        for (int i = 0; i < n - 1; i++){
                              ^
Main.java:12: error: <identifier> expected
        for (int i = 0; i < n - 1; i++){
                                    ^
Main.java:15: error: illegal start of type
        for (int i = 0; i < n; i++){
        ^
Main.java:15: error: > or ',' expected
        for (int i = 0; i < n; i++){
                             ^
Main.java:15: error: <identifier> expected
        for (int i = 0; i < n; i++){
                                ^
11 errors
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);
  rep(i, n - 1) cin >> a[i];

  vector<int> res(n, 0);
  rep(i, n) {
    res[a[i] - 1]++;
  }
  rep(i, n) {
    cout << res[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<iostream>
#include<bits/stdc++.h>
using namespace std;

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

}

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

#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
#define ll long long
int main (){
    int N =0;
    cin >> N;
    vector<int> A(N);
    rep(i,N){
        cin >> A(i);
    }
    vector<int> ans(N);
    rep(i,N){
        rep(j,N){
            if (A(j)==i+1){
                ans(i) += 1;
            }
        }
    }
    rep(i,N){
        cout << ans(i) << endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: no match for call to '(std::vector<int>) (int&)'
   10 |         cin >> A(i);
      |                ~^~~
a.cc:15:18: error: no match for call to '(std::vector<int>) (int&)'
   15 |             if (A(j)==i+1){
      |                 ~^~~
a.cc:16:20: error: no match for call to '(std::vector<int>) (int&)'
   16 |                 ans(i) += 1;
      |                 ~~~^~~
a.cc:21:20: error: no match for call to '(std::vector<int>) (int&)'
   21 |         cout << ans(i) << endl;
      |                 ~~~^~~
Language: C

#include<stdio.h>

int main(void) 
{
	unsigned int N,A[N],B[i],i,j;
	scanf("%d", &N);
	for (i = 1; i < N; i++) {
		scanf("%d", &A[i]);
	}
	for (i = 0; i < N - 1; i++) {
		for (j = i + 1; j < N; j++) {
			if (i == A[j]) B[i] + +;
		}
	}
	for (i = 0; i < N - 1; i++) {
		printf("%d", B[i]);
	}

	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:31: error: 'i' undeclared (first use in this function)
    5 |         unsigned int N,A[N],B[i],i,j;
      |                               ^
main.c:5:31: note: each undeclared identifier is reported only once for each function it appears in
main.c:12:48: error: expected expression before ';' token
   12 |                         if (i == A[j]) B[i] + +;
      |                                                ^
Language: C++

#include<iostream>
#include<unordered_map>
using namespace std;
int main(){
  int n,i;
  cin>>n;
  int ar[n];
  unordered_map<int,int> mp;
  for(i=1;i<=n-1;i++){
    cin>>ar[i];
    if(mp.count(ar[i])>0)
      mp[ar[i]]++;
    else
      mp[ar[i]]=1;
  }
  for(i=1;i<=n;i++)
    cout<<mp[ar[i]<<"\n";
 }


Compiler output:
a.cc: In function 'int main()':
a.cc:17:19: error: invalid operands of types 'int' and 'const char [2]' to binary 'operator<<'
   17 |     cout<<mp[ar[i]<<"\n";
      |              ~~~~~^~~~~~
      |                  |  |
      |                  |  const char [2]
      |                  int
a.cc:17:25: error: expected ']' before ';' token
   17 |     cout<<mp[ar[i]<<"\n";
      |                         ^
      |                         ]
Language: C++

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



int main()
{

    int n;
    cin>>n;


    vector<int> v(n-1);

    map<int,int> m;
    map<int,int> :: iterator it;


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

        m[v[i]]++;


    }


    //cout<<m.size()<<endl;


    for(it=m.begin();it!=m.end();it++){
        cout<<it->secondf<<endl;
    }



    int x=n-m.size();


    for(int i=1;i<=x;i++)cout<<0<<endl;;








    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: 'struct std::pair<const int, int>' has no member named 'secondf'; did you mean 'second'?
   32 |         cout<<it->secondf<<endl;
      |                   ^~~~~~~
      |                   second
Language: C

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N; 
  cin >> N ;
  vector<int> vec1(N-1);
  vector<int> vec2(N);
  for (int i = 0; i < N-1; i++) {
    cin >> vec1.at(i);
} 
  for (int i = 0; i < N-1; i++){
    vec2.at(vec1.at(i)-1)++;
  }
  for (int i = 0; i < N; i++){
    cout << vec2.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>
#include <stdio.h>
#include <iostream>

using namespace std;
 
int main(){
    int n, c;
    #cin >> n;
    scanf("%d", &n);
    int nums[n + 1];
  
    for(int i = 0; i <= n; i++) nums[i] = 0;
    for(int i = 0; i < n-1; i++){
        #cin >> c;
        scanf("%d", &c);
        nums[c] ++;
    }
    
    for(int i = 1; i <= n; i++) cout << nums[i] << endl;
}

Compiler output:
a.cc:9:6: error: invalid preprocessing directive #cin
    9 |     #cin >> n;
      |      ^~~
a.cc:15:10: error: invalid preprocessing directive #cin
   15 |         #cin >> c;
      |          ^~~
Language: C

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

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

    for (int i = 1; i < N+1; i++){
        int cnt = 0;
        for (int j = 0; j < N-1; j++){
            if (A[j] == i){
                cnt += 1;
            }
        }
        cout << cnt << 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>
using namespace std;
int main(void){
    int N,k;
    cin >> N;
    vector<int> man(N-1);
    vector<int> ans(N,0);
    for(int i=0;i<N-1;i++){
    	int count=0;
        cin >> man.at(i);
        for(int j=1;j<N+1;j++){
			if(man.at(i)==j){
        		k=ans.at(j-1);
                k++;
                ans.at(j-1)=k;
         	}
         }
    }
    for(int i=0;i<N;i++){
    	cout << ans.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 n,ans[200010];
int main()
{
	scanf("%d",&n);
	for (int i=2;i<=n;i++){
		int temp;
		scanf("%d",&temp);
		ans[temp]++;
	}
	for (int i=1;i<=n;i++) printf("%d\n",ans[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: Java

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int employee = sc.nextInt();
		int[] results = new int[employee];
		for (int i = 0; i < employee - 1; i++) {
			int boss = sc.nextInt();
			results[boss - 1]++;
		}
		sc.close();
		for (int result : results) {
			System.out.println(result);
		}
	}

}


Compiler output:
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:4: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: C++

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



int main()
{

    int n;
    cin>>n;


    vector<int> v(n-1);

    map<int,int> m;
    map<int,int> :: iterator it;


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

        m[v[i]]++;


    }


    //cout<<m.size()<<endl;


    for(it=m.begin();it!=m.end();it++){
        cout<<it->secondf<<endl;
    }



    int x=n-m.size();


    for(int i=1;i<=x;i++)cout<<0<<endl;;

    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:32:19: error: 'struct std::pair<const int, int>' has no member named 'secondf'; did you mean 'second'?
   32 |         cout<<it->secondf<<endl;
      |                   ^~~~~~~
      |                   second
Language: C

#include <iostream>
#include <cstring>
#include <cstdio>
#include<algorithm>
#include <queue>
#include <cmath>
#include <limits>
#include <map>
#include <iomanip>
using namespace std;
#define ll long long int

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

  for (int i = 0; i <= n; i++)
  {
    answer[i] = 0;
  }

  for (int i = 2; i <= n; i++){
    answer[A[i]]++;
  } 

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

    return 0;
}

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

N = int(input())
A = list(map(int, input().split()))
for i in range(1, N + 1):
    print(A.count(i))

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

#include<bits/stdc++>
using namespace std;
int main(){
  int n,i;
  cin>>n;
  int ar[n];
  unordered_map<int,int> mp;
  for(i=1;i<=n-1;i++){
    cin>>ar[i];
    if(mp.count(ar[i])>0)
      mp[ar[i]]++;
    else
      mp[ar[i]]=1;
  }
  for(i=1;i<=n;i++)
    cout<<mp[ar[i]<<"\n";
 }

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

n = int(input())
array = list(map(int, input().strip().split()))
for i in range(1,n):
    print(array.count(i))


Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n = int(input())
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1: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;
  int ans[n];
  for(int i=0; i<n; i++){
    ans[i] = 0;
  }
  int a;
  for(int i=1; i<n; i++){
    cin >> a;
    ans[a-1] = ans[a-1] + 1;
    }
  }
  for(int i=0; i<n; i++){
    cout << ans[i] << endl;
  }
}


Compiler output:
a.cc:17:3: error: expected unqualified-id before 'for'
   17 |   for(int i=0; i<n; i++){
      |   ^~~
a.cc:17:16: error: 'i' does not name a type
   17 |   for(int i=0; i<n; i++){
      |                ^
a.cc:17:21: error: 'i' does not name a type
   17 |   for(int i=0; i<n; i++){
      |                     ^
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^
Language: C++

#define ll long long
#define ldd long double
#define mpp make_pair
#define pb push_back
#define ff first
#define ss second
#include<bits/stdc++.h>
using namespace std;
int main(){
    ll n,m,y,x,z,h,t,i,j,k;
    ll cnt=0,cnt1=0,sum=0,sum1=0,flag=0,flag1=0,maxi=LLONG_MIN,mini=LLONG_MAX,temp=0,ans=0;
    //freopen("input.txt","r", stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n;
    map<ll,ll> mp;
    for(i=0;i<n-1;i++){
        cin>>temp;
        mp[temp]++;
    }
    for(i=1;i<n+1c;i++){
        cout<<mp[i]<<endl;
    }
return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:17: error: unable to find numeric literal operator 'operator""c'
   23 |     for(i=1;i<n+1c;i++){
      |                 ^~
Language: C

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

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

}

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

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

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    lli m, r,i,j,n,x;
    cin>>n;
    lli a[n-1];
    lli b[n]={0};
    for(i=0;i<n-1;i++){
        cin>>a[i];
        b[a[i]-1]++;
    }
    for(i=0;i<n;i++){
        cout<<b[i]<<" ";
    }
}

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 N;
    cin >> N;
    // スペース区切りの整数の入力
    int A[N-1];

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

    for (int i = 1; i < N+1; i++){
        int cnt = 0;
        for (int j = 0; j < N-1; j++){
            if (A[j] == i){
                cnt += 1;
            }
        }
        cout << cnt << endl;
    }
    
    return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int mod = 1e9+7;
//const ll mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int ninf = 0xc0c0c0c0; 
int main(){
	//freopen("in.txt","r",stdin);
	int n;
	int a[200005]={0};
	cin>>n;
	int t;
	for(int i=0;i<n-1;i++){
		cin>>t;
		a[t]++;
	}
	for(int i=1;i<=n;i++){
		cout<<a[i]<<endl;
	}
	return 0;
}

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

#include <bits/stdc++.h>

#define pan(i,n) for(int i=0;i<n;i++)
#define pans(i,n,a) for(int i=a;i<n;i++)
#define ll long long int
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define INF 1e9+7
#define PI 3.141592653
#define inf 100007
#define P pair<ll,ll>

using namespace std; 

int main(){
    int n;
    cin>>n;
    vi v(n+1,0);
    pan(i,n-1){
        int x;
        cin>>x;
        v[x]++;
    }
    for(int i=1;i<=n;i++){
        cout<<v[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;
#define rep(i, n) for (int i = 1; i < (int)(n); i++)
#define ll long long
int main (){
    int N =0;
    cin >> N;
    vector<int> A(N);
    rep(i,N){
        cin >> A(i);
    }
    vector<int> ans(N);
    rep(i,N){
        rep(j,N-1){
            if (A(j)==i)ans(i)+=1;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: no match for call to '(std::vector<int>) (int&)'
   10 |         cin >> A(i);
      |                ~^~~
a.cc:15:18: error: no match for call to '(std::vector<int>) (int&)'
   15 |             if (A(j)==i)ans(i)+=1;
      |                 ~^~~
a.cc:15:28: error: no match for call to '(std::vector<int>) (int&)'
   15 |             if (A(j)==i)ans(i)+=1;
      |                         ~~~^~~
a.cc:20:20: error: no match for call to '(std::vector<int>) (int&)'
   20 |         cout << ans(i) <<endl;
      |                 ~~~^~~
Language: C++

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

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

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

  for(int i=0;i<N;i++){
    cout<<p.at(i)<<endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'p' was not declared in this scope
    9 |     p[i]=0;
      |     ^
a.cc:15:5: error: 'p' was not declared in this scope
   15 |     p[a]++;
      |     ^
a.cc:19:11: error: 'p' was not declared in this scope
   19 |     cout<<p.at(i)<<endl;
      |           ^
Language: C

#include<stdio.h>

int main(void){
    double N;
    scanf("%lf",&N);
    double A[N], B[N];
    for(int i = 0; i < N; i++){
        A[i] = 0.0;
    }

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

Compiler output:
main.c: In function 'main':
main.c:6:12: error: size of array 'A' has non-integer type
    6 |     double A[N], B[N];
      |            ^
main.c:6:18: error: size of array 'B' has non-integer type
    6 |     double A[N], B[N];
      |                  ^
main.c:15:10: error: array subscript is not an integer
   15 |         A[B[i]-1]++;
      |          ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
const double PI = 3.141592653589793238463;
int main()
{
    long long int n,;
    cin >> n;
    int a[n - 1];
    for (int i = 0; i < n - 1; i++)
    {
        cin >> a[i];
    }

    for (int i = 0; i < n; i++)
    {
        int count = 0;
        for (int j = 0; j < n - 1; j++)
        {
            if (a[j] == i + 1)
            {
                count++;
            }
        }

        cout << count << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:21: error: expected unqualified-id before ';' token
    6 |     long long int n,;
      |                     ^