Submission #12105373


Source Code Expand

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

#define ll long long
#define mod 1000000007
#define pb push_back
#define pi pair<int,int>
#define vi vector<int>
#define vpi vector< pi > 
#define IOS ios_base::sync_with_stdio(false),cin.tie(NULL)
const int N=500003;
int a[N];
int main()
{
	int n,x;
	cin>>n;
	for(int i=2;i<=n;i++)
	{
		cin>>x;
		a[x]++;
	}
	for(int i=1;i<=n;i++) cout<<a[i]<<"\n";
	return 0;
}

Submission Info

Submission Time
Task C - management
User sarwarkhan
Language C++ (GCC 9.2.1)
Score 300
Code Size 432 Byte
Status AC
Exec Time 61 ms
Memory 4372 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 15
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All binary_01, binary_02, line_01, line_02, random_01, random_02, random_03, random_04, sample_01, sample_02, sample_03, small_01, star_01, star_02, star_03
Case Name Status Exec Time Memory
binary_01 AC 59 ms 3832 KB
binary_02 AC 58 ms 3824 KB
line_01 AC 61 ms 4300 KB
line_02 AC 61 ms 4372 KB
random_01 AC 58 ms 4188 KB
random_02 AC 49 ms 4228 KB
random_03 AC 49 ms 4260 KB
random_04 AC 26 ms 3896 KB
sample_01 AC 2 ms 3568 KB
sample_02 AC 2 ms 3596 KB
sample_03 AC 2 ms 3392 KB
small_01 AC 2 ms 3604 KB
star_01 AC 39 ms 3580 KB
star_02 AC 44 ms 3568 KB
star_03 AC 48 ms 3584 KB