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())
a = [int(x) for x in input().split()]


for i in range(1,N+1):
    answer = 0
    for j in range(len(a)):
        if i == a[j]:
            answer += 1
    
    print(answer)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(str, input().split()))
A = list(set(a))
ans = ["0"]*n
for ai in A:
  ans[int(ai)-1] = str(a.count(ai))
print("\n".join(ans))

Submission status: Time Limit Exceeded

Solution code:
data = [input() for i in range(2)]
N = int(data[0])
A = data[1].split()
A_num = [int(k) for k in A]
for i in range(N):
  answer = 0
  num = i + 1
  for j in A_num:
    if j == num:
      answer += 1
  print(answer)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int, input().split()))
print(len([n for n in A if n == 1]))
for i, num in enumerate(A):
    ORG = A[:]
    ORG.pop(i)
    me = i + 2
    sub = len([n for n in ORG if n == me])
    print(sub)

Submission status: Time Limit Exceeded

Solution code:
import collections
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):
    print(a.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
param_n = int(input())
params1 = list(map(lambda x: int(x), input().split(' ')))

for i in range(param_n):
    print(len(list(filter(lambda x: x == i + 1, params1))))

Submission status: Time Limit Exceeded

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

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

	
	print(ans)

Submission status: Time Limit Exceeded

Solution code:

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


for n in range(N):
   print(len(list(filter(lambda x: x == n + 1, arg))))

Submission status: Time Limit Exceeded

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

print(a.count('1'))
for i in range(n-1):
  print(a.count(str(i+2)))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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


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

print("0")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A_i = list(map(int, input().split()))
uq_A_i = list(set(A_i))
C = [0] * N
for i in uq_A_i:
    C[i - 1] = A_i.count(i)
for c in C:
    print(c)

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 = 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))

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:
N = int(input())
A=list(map(int,input().split()))
i=0
s=[]
for i in range(N):
    s.append(0)
for i in range(N):
    for j in range(N-1):
        if i+1==A[j]:
            s[i]=s[i]+1
for i in range(N):
    print(s[i])

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
c=input().split()
for j in range(a):
    print(c.count(str(j+1)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().replace("\n","").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()))
count=0
for i in range(1,n+1):
    for j in range (len(a)):
        if a[j] == i:
            count += 1
    else:
        print(count)
        count = 0

Submission status: Time Limit Exceeded

Solution code:
n= int(input())

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
array = input().split()
l = list(map(int, array))
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()))
seq = []

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

ans = 0

for i in range (1,N):
    for j in range(0,N-1):

        if(A[j]==i):
            ans += 1

    print(ans)

    ans = 0

print("0")

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

l = [int(i) for i in input().split()]
c = 1
ans = []

for j in range(1,n):
    c = l.count(j)
    ans.append(c)
ans.append(0)

for i in ans:
    print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split(' ')

intAList = [int(i) for i in A]
sortA = sorted(intAList)
#print(sortA)

for i in range(1,N+1):
  hoge = sortA.count(i)
  print(hoge)
  sortA = sortA[hoge:]

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:
# C - management

N = int(input())
A = [int(a) for a in 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()))

rsl = []
for i in range(1,n):
    rsl.append(a.count(i))

for _ in rsl:
    print(_)
print(0)

Submission status: Time Limit Exceeded

Solution code:
import math

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())
works = list(map(int, input().split()))

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

Submission status: Time Limit Exceeded

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

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

s = [0]*n

for i in range(0,n):
  print( A.count(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:
from numba import jit
import numpy as np

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


ansSet = set(A)

for i in range(1, N + 1):
    if i in ansSet:
        print(A.count(i))
    else:
        print(0)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans=[0]*N
set_A=set(A)
for i in set_A:
    ans[i-1]=A.count(i)
for i in range(N):
    print(ans[i])

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
for N_i in range(1,N+1):
  cnt = 0
  for A_i in A:
    if N_i == A_i:
      cnt += 1
  print(cnt)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
A.insert(0,0)
x = [0]*N
for i in range(N):
    A[i]=int(A[i])
for j in range(N):
    print(A.count(j+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:
# -*- coding: utf-8 -*-

N = int(input())

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

count = 0

for n in range(N):
    for i in range(N-1):
        if A[i] == n+1:
            count += 1
    
    print(count)
    count = 0

Submission status: Time Limit Exceeded

Solution code:
num_staffs = int(input())
staffs = sorted([int(i) for i in input().split()])


for i in range(1, num_staffs + 1):
    ans = staffs.count(i)
    print(ans)
    staffs = staffs[ans:]

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
from collections import Counter

n = int(input())
a = list(map(int, input().replace("\n","").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()))

li = [0] * n
for i in a:
    for j in range(1, n+1):
        if i == j:
            li[j-1] += 1

for ans in li:
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int, input().split()))
A_=list(set(A))
count_=["0\n"]*N

for i in range(len(A_)):
	count_[A_[i]-1]=str(A.count(A_[i]))+"\n"

print("".join(count_))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

[print(a.count(i)) for i in range(1, n+1)]

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
list = list(map(int, input().split()))
res = []
i=1

while(i<N+1):
  res.append(list.count(i))
  i+=1

k=0
while(k<len(res)):
  print(str(res[k]))
  k+=1

Submission status: Time Limit Exceeded

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

for r in result:
    print(r)

Submission status: Time Limit Exceeded

Solution code:
i = int(input())
ii = list(map(int,input().split()))

import collections

c = collections.Counter(ii)
k = list(c.keys())

for a in range(i):
    if k.count(a+1)==0:
        print(0)
    else:
        print(c[a+1])

Submission status: Time Limit Exceeded

Solution code:
import sys
import numpy as np


def solve(N: int, A: "List[int]"):

    a = np.array(A)

    for i in range(N):
        b = len(a[a == (i+1)])
        print(b)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

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())
A = list(map(int, input().split()))

for i in range(1, N+1):
    count = 0
    for a in A:
        if i == a:
            count += 1
    print(count)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

for num in range(len(List) + 1):
  print(List.count(num+1))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

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

for s in range(N):
  print(a[s])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import collections 

N = int(input())
A = list(map(int, input().split()))
lst = []
c = collections.Counter(A)
for key in c:
    lst.append(key)
lst.sort()
cnt = 0
for i in range(1, N+1):
    if(i in lst):
        print(c[i])
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
*A, = map(int, input().split())
# member = []

for i in range(N):
    # member.append(A[i:].count(i+1))
    print(A[i:].count(i+1))

Submission status: Time Limit Exceeded

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

a.sort()
tn = 1
cnt = 0
suffix = 0
for i in range(n):
    
    for j in range(suffix, n-1):
        if a[j] == tn:
            cnt += 1
            suffix = j
    print(cnt)
    cnt = 0
    tn += 1

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
num = int(input())
line = list(map(int,input().split()))
for i in range(1,num+1):
    number = line.count(i)
    print(number)

Submission status: Time Limit Exceeded

Solution code:
n, *aa = map(int, open(0).read().split())

for i in range(1, n+1):
    have = aa.count(i)    
    print(have)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
import math as mt
N=int(input())
#R=map(int, input().split())
A=list(map(int,input().split()))
for i in range(0,N):
    print(A.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin
input = stdin.readline

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:
import sys
input = sys.stdin.readline
n = int(input())
a = list(input())
for i in range(n):
    print(a.count(str(i+1)))

Submission status: Time Limit Exceeded

Solution code:
import collections
N=int(input())
A_list = list(map(int, input().split()))
Alist=[A_list.count(i+1) for i in range(N)]
for i in range(N):
  print(Alist[i])

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    A_list = [A for A in input().split()]
    A_list = list(map(int, A_list))
    #ans_list = []

    for n_cycle in range(1,N+1) :
        #ans_list.append(A_list.count(n_cycle))
        print(A_list.count(n_cycle))
    #for ans in ans_list :
    #    print(ans)


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
import sys

lines = sys.stdin.readlines()

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

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

Submission status: Time Limit Exceeded

Solution code:
member = int(input())
subcount = list(map(int, input().split()))
for i in range(1, member + 1):
  print(subcount.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):
	ans = 0
	for j in range(n-1):
		if a[j] == i:
			ans += 1
		else:
			ans += 0
	print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter


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

c=Counter(a)
ck=list(Counter(a).keys())
for i in range(1,n+1):
    if i in ck:
        print(c[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 = [a for a in A if a!=i]

Submission status: Time Limit Exceeded

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

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):
    x = a.count(i+1)
    print(x)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A_List = list(map(int, input().split()))
i_before=1
for i in range(N):
  i_count=A_List.count(i+1)
  print(i_count)
  if(i>i_before):
    continue
  i_before=i

Submission status: Time Limit Exceeded

Solution code:
import math
n=int(input())
a=list(map(int, input().split()))
count=0
for i in range(1,n+1):
    for j in range (len(a)):
        if a[j] == i:
            count += 1
    else:
        print(count)
        count = 0

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()))

lp=0
for aa in a:
    lp+=1
    print(a.count(lp))
print(0)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
 
b=input().split()
counter_list=[]
for i in range(N) :
	count=0
	for item in b :
		if str(i+1)==item :
			count+=1
	print(count)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N=int(input())
A=list(map(int,input().split()))

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
input_line1 = input()
input_line2 = input()

n = int(input_line1)
a_list = list(map(int, input_line2.split()))

for i in range(0, n):
    print(a_list[i:].count(i+1))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
li = list(map(int,input().split()))
lians = []
for i in range(1,n):
    lians.append(li.count(i))
lians.append(0)
for i in range(n):
    print(lians[i])

Submission status: Time Limit Exceeded

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

for i in range(N):
  n = A.count(i)
  number.append(n)

del number[0]
number.append(0)
for Answer in number:
  print(Answer)

Submission status: Time Limit Exceeded

Solution code:
# abc163
n = int(input())
members = list(map(int,input().split()))

ans = [0]*n

for i in range(len(members)):
    ans[i] = members.count(i+1)

for i in ans:
    print(i)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# 部下の人数を返す
def get_subordinates(my_number):
    counter = 0
    for i, employee in enumerate(params1):
        if employee == my_number:
            counter += 1
    return counter

param_n = int(input())
params1 = list(map(lambda x: int(x), input().split(' ')))

for i in range(param_n):
    print(get_subordinates(i + 1))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
As = list(map(int, input().split()))
sort_as = sorted(As)
shine = [x + 1 for x in range(N)]
c = 0
s = 0
j = 0
for x in range(N):
  for y in range(len(As)):
    if shine[x] == As[y]:
      c += 1
  print(c)
  c = 0

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(N-1):
    Ans = 0
    L = len(A)
    for j in range(L):
        if i+1 == A[L-j-1]:
            Ans += 1
            A.remove(A[L-j-1])
            #print(A)
    print(Ans)
print("0")

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={x:As.count(x) for x in range(1,N+1)}
for i in As2:
    print(As2[i])

Submission status: Time Limit Exceeded

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

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:
import itertools
import math
import string
import collections
from collections import Counter
from collections import deque
import sys
sys.setrecursionlimit(2*10**5)
INF = 2**60


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
N = int(input())
a = readints()
ans = [0]*(N+1)
for i in range(len(a)):
    for j in range(1, N+1):
        if a[i] == j:
            ans[j] += 1
for i in range(len(ans)-1):
    print(ans[i+1])

Submission status: Time Limit Exceeded

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

for i in range(1, N+1):
    num_sub = As.count(i)
    As = [a for a in As if a != i]
    print(num_sub)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
c=input().split()
for j in range(a):
    j=str(j+1)
    print(c.count(j))

Submission status: Time Limit Exceeded

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

m = n + 1

for i in range(1,m):
    c = a.count(i)
    print(c)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
#n, m = list(map(int, input().split()))
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()))
a.sort()
for i in range(n):
  b = a.count(i+1)
  print(b)

Submission status: Time Limit Exceeded

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

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

for r in result:
    print(r)

Submission status: Time Limit Exceeded

Solution code:
num_staffs = int(input())
staffs = sorted([int(i) for i in input().split()])

sets = set(staffs)

for i in range(1, num_staffs + 1):
    try:
        sets.remove(i)
        ans = staffs.count(i)
        print(ans)
        staffs = staffs[ans:]
    except:
        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):
    count = a.count(i)
    print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for i in range(len(li) + 1):

    print(li.count(i + 1))
    li = [e for e in li if e != i+1]

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))#N-1
count=0
list=[]
for i in range(1,N):
    for j in range(0,N-1):
        if not j==N-2 and A[j]==i:
            count+=1
        elif j==N-2 and A[j]==i:
            count+=1
            list.append(count)
            count=0
        elif j==N-2 and not A[j]==i:
            list.append(count)
            count=0

if not len(list)==N:
    for i in range(0,N-len(list)):
        list.append(0)

for i in range(0,len(list)):
    print(list[i])

Submission status: Time Limit Exceeded

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

for i in range(N):
    count = 0
    count = list_A.count(i+1)
    print(count)

Submission status: Time Limit Exceeded

Solution code:
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
import fractions
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()
A = LI()

cnt = [0] * n

sa = set(A)

for v in sa:
    if cnt[v-1] != 0:
        continue
    cnt[v-1] = A.count(v)

for c in cnt:
  print(c)

Submission status: Time Limit Exceeded

Solution code:
def main():
    mn = int(input())
    j = [int(x) for x in input().split()]
    [print(j.count(x)) for x in range(1, mn + 1)]


if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(a) for a in input().split()]

number = []
for i in range(1,N+1):
  number.append(A.count(i))
  print(number[i-1])

Submission status: Time Limit Exceeded

Solution code:
#整数の入力
N = int(input())
#スペース区切りの整数の入力リスト
A_list = list(map(int, input().split()))

ans = 0
for i in range(len(A_list)+1):
  ans = A_list.count(i+1)
  print(ans)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int, input().split()))
a=list(set(A))
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()))
ans = 0
for i in range(1,N+1):
    if i in A:
        ans += A.count(i)
        print(ans)
        ans = 0
        A.remove(i)
    else:
        print(0)

Submission status: Time Limit Exceeded

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

for i in range(1,n+1):
	nums.append(a.count(i))

for i in nums:
	print(i)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = [int(n) for n in input().split()]
ans = [0] * N
for i in set(A):
    ans[i-1] = A.count(i)
for n in range(N):
    print(ans[n])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for A in range(1, N + 1):
    print(A_list[A - 1:].count(A))

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 = [int(x) for x in input().split()]


for i in range(1,N+1):
    answer = a.count(i)
    print(answer)

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())
li = list(map(int,input().split()))

count = 0
for j in range(1, n + 1):
    for i in li:
        if i == j:
            count += 1
    print(count)
    count = 0

Submission status: Time Limit Exceeded

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

for i in range(1,n+1):
    count = 0
    for j in all:
        if(i == j ):
            count += 1
    print(count)

Submission status: Time Limit Exceeded

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