【題解】AtCoder ABC 163C – management

【題目敘述】https://atcoder.jp/contests/abc163/tasks/abc163_c

#include <iostream>
using namespace std;

int n, a, cnt[200005];

int main() {
    cin >> n;
    for (int i = 2; i <= n; i++){
        cin >> a;
        cnt[a]++;
    }
    for (int i = 1; i <= n; i++){
        cout << cnt[i] << "\n";
    }
}

分享本文 Share with friends