CPC 1 Problem 3 - Chika's Popularity Contest

View as PDF

Submit solution

Points: 3 (partial)
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

Chika is running a popularity contest! N people with IDs from 1 to N each get to vote for an individual (possibly themselves). Count how many votes each person got!

Constraints

1 \le N \le 10^7

1 \le a_i \le N

Input Specification

The first line contains a single integer, N.

The next line contains N space-separated integers, the a_i values in order. Student i voted for student a_i in the contest.

Output Specification

Output N lines. On line i, output how many votes student i got.

Sample Input

5
4 4 5 5 3

Sample Output

0
0
1
2
2

Comments

There are no comments at the moment.