Problem:


Score : 300 points

Problem Statement

A company has N members, who are assigned ID numbers 1, ..., N.

Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.

When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.

You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Constraints

2 \leq N \leq 2 \times 10^5

1 \leq A_i < i

Input

Input is given from Standard Input in the following format:

N
A_2 ... A_N

Output

For each of the members numbered 1, 2, ..., N, print the number of immediate subordinates it has, in its own line.

Sample Input 1

5
1 1 2 2

Sample Output 1

2
2
0
0
0

The member numbered 1 has two immediate subordinates: the members numbered 2 and 3.

The member numbered 2 has two immediate subordinates: the members numbered 4 and 5.

The members numbered 3, 4, and 5 do not have immediate subordinates.

Sample Input 2

10
1 1 1 1 1 1 1 1 1

Sample Output 2

9
0
0
0
0
0
0
0
0
0

Sample Input 3

7
1 2 3 4 5 6

Sample Output 3

1
1
1
1
1
1
0



Sample input:
5
1 1 2 2


Sample output:
2
2
0
0
0

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
x = map(int, input().split())
a_list = list(x)
# n = 5
# a_list = [1,1,2,2]

# r_list = []
# for i in range(n+1):
#     r_list.append(a_list.count(i))


r_list = map(a_list.count, range(n+1))
r_list = list(r_list)
r_list2 = map(str, r_list[1:])
r_list2 = list(r_list2)

ans = "\n".join(r_list2)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
for i in range(1,n+1):
    print(x.count(i))

Submission status: Time Limit Exceeded

Solution code:
import collections
n = int(input())
a = list(map(str,input().split()))

c = collections.Counter(a)
keys = list(c.keys())

for i in range(1,n+1):
    if str(i) in keys:
        print(c[str(i)])
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))

for i in range(n):
    ans = a.count(i + 1)
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))
ls = set(l)
c = [0] *n
for i in range(1,n+1):
  if i in ls:
    c[i-1] = l.count(i)
for i in range(n):
  print(c[i])

Submission status: Time Limit Exceeded

Solution code:

N = int(input())
Alist = list(map(int,input().split()))
import numpy as np
ans=np.zeros(N)

A2list=list(set(Alist))
#print(A2list)
for i in range(len(A2list)):

    ans[int(A2list[i])-1]=int(Alist.count(A2list[i]))

ans=map(int,ans.tolist())
print(*ans,sep="\n")

Submission status: Time Limit Exceeded

Solution code:
#--management

member = int(input())
mem_number = [int(i) for i in input().split()]

ans = []

for i in range(member):
  ans.append(0)

for j in range(1,member):
  k = mem_number.count(j)
  ans[j-1] = k

for i in  range(member):
  print(ans[i])

Submission status: Time Limit Exceeded

Solution code:
member_cnt = int(input())
bosses = input().split(' ')

for i in range(1, member_cnt + 1):
  print(bosses.count(str(i)))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))
s = [0]*n

for i in range(max(a)):
	s[i] = a.count(i+1)
	
for i in range(n):
  	print(s[i])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

i = int(1)
while i <= n:
    print(a.count(i))
    i = i + 1

Submission status: Time Limit Exceeded

Solution code:
n = int(input()) 
l = list(map(int, input().split()))
[print(l.count(i)) for i in range(1, n+1)]

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a_list=[int(i) for i in input().split(' ')]

slaves=[str(a_list.count(i+1)) for i in range(n-1)]+[str(0)]
print('\n'.join(slaves))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
if N >= 2:
    A = list(map(int, input().split()))
    if len(A) <= N:
        for i in range(1, N+1):
            if i == 1:
                if A.count(i) == 0:
                    print(i)
                else:
                    print(A.count(i))
            else:
                print(A.count(i))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
mem = list(map(int, input().split()))

a = 0
cnt = 1
for i in range(n):
    for j in mem:
        if j==cnt:
            a+=1
    if a>0:
        del mem[:a-1]
    cnt += 1
    print(a)
    a = 0

Submission status: Time Limit Exceeded

Solution code:
# -*- coding:utf-8 -*-

N = int(input())
A = list(input().split())
A = [int(i) for i in A]

for i in range(len(A)+1):    
    print(A.count(i+1))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
n=int(input())
a= [int(i) for i in input().split()]
b=np.array(a)
for i in range(1,n+1):
    print(np.count_nonzero(b==i))

Submission status: Time Limit Exceeded

Solution code:
import collections
N = int(input())
A = list(map(int, input().split()))
count = collections.Counter(A)

for i in range(1,N+1):
  print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
for i in range(N):
    count = A.count(str(i+1))
    print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input()) 
A=list(map(int,input().split())) 
i=0 
s=[]
sumall=0
while sumall<N-1: 
    s.append(0) 
    s[i]=A.count(i+1)
    sumall=sumall+s[i]
    print(s[i])
    i=i+1       
for _ in range(i,N):
    print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(input().split())
for i in range(N):
    print(A.count(str(i+1)))

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
 
def main():
  N = int(stdin.readline().rstrip())
  l = list(map(int, stdin.readline().rstrip().split(" ")))
  
  _ = [print(l.count(n+1)) for n in range(N)]
  
  
  
if __name__ == "__main__":
  main()

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
import numpy as np

n= int(input())
A = [int(a) for a in input().split()]

A = np.array(A)

for i in range(n-1):
    A = A - 1
    print(n-1 -np.nonzero(A)[0].size)
print("0")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int,input().split()))
buka_num=[]
for i in range(1,len(a)+1):
  num = a.count(i)
  buka_num.append(str(num))
  del a[1:num]
  
buka_num.append("0")
joined = "\n".join(buka_num)
print(joined)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
list=[0]*(N-1)
list1=[0]*N
for i in range(1,N):
    list[i-1]=[i+1,A[i-1]]

for j in range(N-1):
    for k in range(N):
        if list[j][1]==k+1:
            list1[k]+=1
for l in range(N):
    print(list1[l])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
i = 1
while i <= N:
    print(sum(1 for x in A if x == i))
    i += 1

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

max_num = max(A)
for i in range(N):
	if max_num < i+1:
		print(0)
	else:
		print(A.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int, input().split()))
for value in range(n):
    if min(a) > n:
        print(0)
    else:
        print(a.count(value+1))

Submission status: Time Limit Exceeded

Solution code:
def get_subordinate(n, members):

    for i in range(1, n+1):
        occur = members.count(i)
        print(occur)
        

if __name__ == '__main__':
    n = int(input())
    members = list(map(int, input().rstrip().split()))
    get_subordinate(n, members)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for n in range(1,N):
    x = A.count(n)
    print(x)
print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a_list = [int(i) for i in input().split()]

for i in range(1, N+1):
    a_sum = len([j for j in a_list if j == i])
    print(a_sum)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

for i, value in enumerate(a):
    print(a.count(i+1))
print('0')

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
c=list(map(int,input().split()))
k=n
u=n
for i in range(1,n):
    p=(c.count(i))
    print(p)
    k=k-p
    u=u-1
    if k<2:
        break
while u>0:
    print(0)
    u=u-1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
i = 1
while i <= N:
 print(A.count(i))
 i += 1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
for i in range(1, N):
    print(A.count(i) if i in A else 0)
print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [i for i in map(int, input().split())]

for j in range(1, n+1):
  print(a.count(j))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split(' ')))
for i in range(N-1):
    k=0
    for j in range(N-1):
        if A[j]==i+1:
            k=k+1
        if A[j]>i+1:
            break
    print(k)
print(0)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin

def main():

    input = stdin.readline

    N = int(input())
    A = list(map(int,input().split()))
    ans = [0] * N

    for i in range(N):
        print(A.count(i+1))
    # for i in range(N-1):
    #     ans[A[i]-1] += 1

    # for i in ans:
    #     print(i)

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
x = map(int, input().split())
a_list = list(x)

r_list = []
for i in range(n+1):
    r_list.append(a_list.count(i))

r_list2 = map(str, r_list[1:])
r_list2 = list(r_list2)

ans = "\n".join(r_list2)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
i=0
for i in range(len(a)):
    print(a.count(i+1))
    print('\n')
print(0)

Submission status: Time Limit Exceeded

Solution code:
from collections import defaultdict

N = int(input())
A = [int(x) for x in input().split()]
k = defaultdict(lambda: 0)

for i in range(1, N + 1):
    k[i] = 0
    for a in A:
        if a == i:
            k[i] += 1

for j in k.values():
    print(j)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
A.insert(0, 0)
for i in range(N):
    tmp = 0
    for j in range(i+1, N):
        if(i+1 == A[j]):
            tmp += 1
    print(tmp)

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())

#==--------------

for i in range(N):
    if i+1 not in joushi_no_bangou:
        print(0)
    else:
        print(joushi_no_bangou.count(i+1))

Submission status: Time Limit Exceeded

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

B = [print(A.count(i)) for i in range(1, N+1)]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int,input().split(' ')))
for i in range(1,N+1):
    if int(a.count(i)) > 0:
        print(a.count(i))
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
total = 0
i = 1
while i <= n:
    print(a.count(str(i)))
    i += 1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
for i in range(1,N+1):
    count = 0
    B =[]
    for j in range(len(A)):
        if A[j]==i:
            count += 1
        else:
            B.append(A[j])
    print(count)
    A = B

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
n=int(input())
lst=list(map(int,input().split()))
dic=Counter(lst)
def abc(i):
  if i in lst:
    return str(dic[i])
  else:
    return '0'
print('\n'.join([abc(i) for i in range(1,n+1)]))

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 5
    # An = [1, 1, 2, 2]
    
    # N = 7
    # An = [1, 2, 3, 4, 5, 6]

    NUM = An.copy()
    out = []
    counter = []
    
    start_index = 0
    
    for n in range(1, N+1):
        count = 0
        # for an_i in range(start_index, len(An)):
        for an in An[start_index:]:
            if n >= an:
                if len(NUM) > 0:
                    count += 1
                    start_index += 1
                    NUM = An[start_index:]
                # print(n, an, NUM)
        counter.append(count)
        # out.append(count)
        
        # print('counter:', counter, 'out:', out)
        
    # print('counter:', counter)
    for i in counter:
        print(i)
            
    
main()

Submission status: Time Limit Exceeded

Solution code:
count = int(input())

data = list(map(int,input().split()))

for i in range(count):
    print(data.count(i + 1))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))

buka_num = []

for i in range(1,N):
    buka_num.append(A.count(i))
    
buka_num.append(0)
for ele in buka_num:
    print(ele)

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
 
def main():
  N = int(input())
  l = list(map(int, input().split(" ")))
  
  _ = [print(l.count(n+1)) for n in range(N)]
  
  
  
if __name__ == "__main__":
  main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
if N >= 2:
    A = list(map(int, input().split()))
    for i in range(1, N+1):
        if i == 1:
            if A.count(i) == 0:
                print(i)
            else:
                print(A.count(i))
        else:
            print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
s = set(A)
x = [0] * N

for i in s:
    x[i-1] += A.count(i)


o = '\n'.join(map(str, x))
print(o)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=(input())
for i in range(1,N+1):
    print(a.count(str(i)))

Submission status: Time Limit Exceeded

Solution code:
a = int(input())
b = list(map(int, input().split()))
for i in range(1,a):
    n = b.count(i)
    print(n)
    if n>0:
        b = [j for j in b if i != j]
print(0)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
import numpy as np
#from numba import njit

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

#NMAX = max(A)
#@njit
def keisan(A,i):
    ans = A.count(i)
    print(ans)

for i in range(1,N+1):
    
    keisan(A,i)
    #ans = A.count(i)
    #print(ans)

Submission status: Time Limit Exceeded

Solution code:
str = input()
line = input().split()
 
count = []
num = int(str)
for i in range(num):
    temp = 0
    for k in line:
        if (i+1) == int(k):
            temp = temp + 1
    count.append(temp)
 
[print(i) for i in count]

Submission status: Time Limit Exceeded

Solution code:
def resolve():
  N = int(input())
  A = [int(x) for x in input().split(" ")]

  results = [A.count(i) for i in range(1, N+1)]

  for result in results:
    print(result)
    
if __name__ == "__main__":
  resolve()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split(' ')))
for i in range(N-1):
    k=0
    for j in range(N-1):
        if A[j]==i+1:
            k=k+1
    print(k)
print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split())) 
for i in range (1,n+1):
    print(a.count(i))

Submission status: Time Limit Exceeded

Solution code:
def get_subordinate(n, members):

    for i in range(1, n+1):
        count = 0
        if i in members:
            for member in members:
                if i == member:
                    count += 1
        else:
            count = 0
        print(count)


if __name__ == '__main__':
    n = int(input())
    members = list(map(int, input().rstrip().split()))
    get_subordinate(n, members)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int,input().split()))
c={}
for i in set(b):
    c[i]=b.count(i)


for i in range(a):
    if i+1 in b:
        print(c[i+1])
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
aList = list(map(int, input().split()))


for i in range(1,n+1):

	print(aList.count(i))

Submission status: Time Limit Exceeded

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()
N=int(input())
As=[int(x) for x in input().split()]
As2=map(lambda x:  As.count(x),range(1,N+1))
for i in As2:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
for i in range(1,n+1):
   num=a.count(i)
   print(num)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
A = list(map(int,input().split()))

def main(i):
  a = A.count(i)
  print(a)


for i in range(1,n+1):
  main(i)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
counts=0
limit=0
for i in range(1,N+1):
  a=A.count(i)
  counts+=1
  limit+=a
  print(a)
  if a==N:
    quit()
for j in range(N-counts):
  print(0)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=[int(x) for x in input().split()]
i=0
if 2<=N<=2*10**5:
    for i in range(0,N-1):
        if 0<=i<=N-2:
            if 1<=A[i]<i+2:
                j=i+1
                print(A.count(j))
                i+=1
        if i==N-1:
            print(0)

Submission status: Time Limit Exceeded

Solution code:
import collections
n=int(input())
A = sorted(list(map(int,input().split())))
for i in range(1,n+1):
    print(A.count(i))
    del A[:A.count(i)]

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()

for i in range(n):
    buka = a.count(str(i+1))
    print(buka)

Submission status: Time Limit Exceeded

Solution code:
number=int(input())
List=list(map(int,input().split()))
for i in range(1,number+1):
    print(List.count(i))

Submission status: Time Limit Exceeded

Solution code:
str = input()
line = input().split()
 
count = []
for i in range(int(str)):
    temp = 0
    for k in line:
        if (i+1) == int(k):
            temp = temp + 1
    count.append(temp)
 
[print(i) for i in count]

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-

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

s = [0]*(n+1)

for i in range(1,n+1):
  for j in range(i-1,n-1):
    if A[j] == i:
      s[i] += 1
  
  print(s[i])

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
an = input().split()
An =[]
for a in an:
    An.append(int(a))
buka = []
for i in range (1,N+1):
    buka.append(An.count(i))
for b in buka:
    print(b)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
x = []
x = map(int, input().split())
a_list = list(x) 

r_list = []
for i in range(n+1):
    r_list.append(a_list.count(i))

r_list2 = map(str, r_list[1:])
r_list3 = list(r_list2)

ans = "\n".join(r_list3)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a =list(map(int,input().split()))
 
[print(a.count(i)) for i in range(1,n+1)]

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
numbers = list(map(int, input().split()))

l = []
amount = 0
for i in range(N):
    for j in range(N-1):
        if numbers[j] == i+1:
            amount = amount + 1
    l.append(amount)
    amount = 0

for i in range(N):
    print(l[i])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input()
S = A.replace(' ','a')
S = S + 'a'

for i in range(N):
  j = str(i+1) + 'a'
  k = S.count(j)
  print(k)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
li=list(map(int,input().split()))
li.sort()
li2=[]
for i in range(len(li)+1):
    li2.append(li.count(i+1))
for s in li2:
    print(s)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
a = 0
for i in range(1,N+1) :
    ans = A.count(i)
    print(ans)
    a += ans
    if a >= len(A) :
        for j in range(N-i) :
            print('0')
        exit()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

for i in range(N):
    print(A.count(i+1))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
i = 1
while i <= N:
    print(A.count(i))
    i += 1

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))

buka_num = []

for i in range(1,N):
    tmp_A = A[i:]
    buka_num.append(tmp_A.count(i))
    
buka_num.append(0)
for ele in buka_num:
    print(ele)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

for i in range (1,n+1):
    if i in a:
        print(a.count(i))
    else :
        print(0)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split()))
i=0
j=0
c=0
for i in range(len(a)):
    print(a.count(i+1))
    print('\n')
print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

for i in range(n):
    ans = 0
    for j in range(n - 1):
        if i + 1 == a[j]:
            ans += 1
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

A = [int(x) for x in input().split()]
A.sort()
for j in range(N):
    b = A.count(j+1)
    print(b)
    if b != 0:
        del A[0:(b-1)]

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
la = list(map(int, input().split()))
la.sort()
la.append(N+1)

for i in range(1, N+1):
    k = 0
    while la[k] == i and la[k] != N+1:
        k += 1
    print(k)
    del la[:k]

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
l = []
for i in range(1,N+1):
    l.append(A.count(i))
    if sum(l)==N-1:
        break
for i in range(len(l)):
    print(l[i])
for _ in range(N-len(l)):
    print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
boss_list = list(map(int, input().split(' ')))

for i in range(n):
    print(boss_list.count(i + 1))

Submission status: Time Limit Exceeded

Solution code:
if __name__ == "__main__":
    n = int(input())
    al = list(map(int, input().split()))
    for i in range(1,n+1):
        print(al.count(i))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = tuple(map(int, input().split()))

for i in range(1, N+1):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))

for i, value in enumerate(a):
    cnt = 0
    for j in range(i, len(a)):
        if a[j] == i+1:
            cnt += 1
    print(cnt)
print('0')

Submission status: Time Limit Exceeded

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

for n in range(0,N):
    y = n +1
    x = A.count(y)
    print(x)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split()))

m = n + 1
s = 0

for i in range(1,m):
    c = a.count(i)
    if c > 0:
        a.remove(i)
        print(c)
    else:
        print('0')

Submission status: Time Limit Exceeded

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

# if N >= sum(A):
#     print(N-sum(A))
# else:
#     print(-1)

for i in range(1,N+1):
    print(A.count(i))

Submission status: Time Limit Exceeded

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

counter = 0
for i in range(1, N):
  for j in range(N-1):
    if A[j] == i:
      counter += 1
  print(counter)
  counter = 0
print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
lis = list(map(int,input().split()))
for i in range(1,n+1):
  print(lis.count(i))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
# N=7
A=list(map(int,input().split()))
A=sorted(A)
B=[]
for i in range(N):
    B=[j for j in A if j-1==i]
    print(len(B))
    B=[]

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
count_list = []

for i in range(N):
  count = A.count(i+1)
  count_list.append(count)

ans  = list(map(str, count_list))
print('\r\n'.join(ans))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = [int(x) for x in input().split()]
ans = []
for i in range(n):
    print(l.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
cnt=N
for n in range(1,max(A)+1):
    print(A.count(n))
    cnt-=1

for n in range(cnt):
    print("0")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
result_list = [0] * N

for i in range(N):
    for a in a_list:
        if i == a:
            result_list[i-1] += 1

# 最後の改行を削除
result_list_str = [str(i) for i in result_list]
print('\n'.join(result_list_str))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = list(map(int,input().split()))

for i in range(1,n+1):
    print(li.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
boss = [0] + list(map(int, input().split()))
#print(boss)
for i in range(n):
    print(boss.count(i+1))
    del boss[0]

Submission status: Time Limit Exceeded

Solution code:
n = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

set_list = list(set(a_list))

if n-1 == len(set_list):
    for i in range(n):
        if i == n-1:
            print(0)
        else:
            print(1)
elif len(set_list) == 1:
    for i in range(n):
        if i == 0:
            print(n-1)
        else:
            print("0")
else:
    for i in range(n):
        if i+1 in set_list:
            print(a_list.count(i+1))
        else:
            print("0")

Submission status: Time Limit Exceeded

Solution code:
import sys

lines = sys.stdin.readlines()

N = int(lines[0])
Y = lines[1].split(' ')
A = []

m = 0
for i in range(N):
    k = 0
    if m != N:
      for j in range(N-1-i):
        if(int(Y[N-j-2])) == i+1:
          k = k +1
      m = m + k
      print(k)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()

for i in range(n):
    m = str(i+1)
    buka = a.count(m)
    if buka != 0:

        print(buka)
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
A_max = max(A)
for i in range(1,N+1):
  if A_max < i:
    print(0)
  else:
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
if N >= 2:
    A = list(map(int, input().split()))
    for i in range(1, N+1):
        if i == 1:
            if A.count(i) == 0:
                print("1")
        print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=tuple(map(int,input().split()))
for cnt in range(len(a)):
    num=0
    for j in a[cnt:]:
        if j == cnt + 1:
            num += 1
    print(num)
print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A_list = list(map(int, input().split()))

print(A_list.count(1))
for a in range(1, N):
    c = A_list.count(a+1)
    print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = list(map(int, input().split()))
ls = set(l)

for i in range(1,n+1):
  if i in ls:
    print(l.count(i))
  else:
    print(0)

Submission status: Time Limit Exceeded

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

for i in range(1, N+1):
  print(A.count(i))
  A = [j for j in A if j != i]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(input().split())
B = [0 for i in range(N)]
for i in range (N-1):
  for j in range (1,N+1):
    if int(A[i])==j:
      B[j-1]=B[j-1]+1
      break
[print(i) for i in B]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int,input().split()))
buka_num=[]
for i in range(1,len(a)+1):
  buka_num.append(str(a.count(i)))
  for j in range(a.count(i)):
    a.remove(i)
buka_num.append("0")
joined = "\n".join(buka_num)
print(joined)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np


n = int(input())
a = [int(x) for x in input().split()]

for k in range(n):
    print(a.count(k+1))

Submission status: Time Limit Exceeded

Solution code:

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

Submission status: Time Limit Exceeded

Solution code:
numOfemp = int(input())
numOfBossInt = []

numOfBossStr = input().split(' ')
for i in range(0, numOfemp-1):
    numOfBossInt.append(int(numOfBossStr[i]))

for i in range(0, numOfemp-1):
    print(numOfBossInt.count(i+1))

print('0')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(N):
	print(A.count(i+1))