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:
import itertools
N=int(input())
listA=list(map(int,input().split()))
listA.sort()
listA2=[0]*N
for i in listA:
  listA2[i-1]+=1
for i in range(1,N+1):
  if i in listA:
    print(listA2[i-1])
  else:
    print(0)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
listA=list(map(int,input().split()))
listA.sort()
listA2=[0]*N
for i in listA:
  listA2[i-1]+=1
for i in range(1,N+1):
  if i in listA:
    print(listA2[i-1])
  else:
    print(0)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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())
ms = list(map(int, input().split()))
for i in range(1, n+1):
    print(ms.count(i))

Submission status: Time Limit Exceeded

Solution code:
def counting(a,j):
    s=0
    while a[0]==j:
        s+=1
        if len(a)>1:
            del a[0]
        else:
            a[0]=N+1
    return s
N=int(input())
a=list(map(int,input().split()))
a.sort()
remaining=N-1
for i in range (1,N+1):
    print(counting(a,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())
list1=list(map(int,input().split()))
for i in range(n):
    print(list1.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lst = [int(x) for x in input().split()]
lst_new = [lst.count(i) for i in range(1,N)]
lst_new.append(0)
for k in range(N):
    print(lst_new[k])

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 j in range(i-1, N-1):
        if A[j] == i:
            count += 1
    print(count)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
lst = [int(x) for x in input().split()]
lst_new = [lst.count(i) for i in range(1,N)]
lst_new.append(0)
for k in range(N):
    print(lst_new[k])

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())
list1=list(input().split())
for i in range(n):
  print(list1.count(str(i+1)))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
lena = len(a)+1
l = []
for i in range(1, lena):
  l.append(a.count(str(i)))
for i in l:
  print(i)
print(0)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
for i in range(1, len(a)+1):
  print(a.count(str(i)))
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):
    print(sum(a == i for a in a_list[i - 1:]))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().split()
for j in range(1, n):
  count = 0
  for i in range(0, n-1):
    if j == int(a[i]):
      count += 1
  print(count)
print(0)

Submission status: Time Limit Exceeded

Solution code:
#########行列読み込み ##############################################
"""
from sys import stdin
n = int(stdin.readline().rstrip())
data = [stdin.readline().rstrip().split() for _ in range(n)]
print(data)
print(*data, sep='\n')
"""
##################################################################
#########入力系####################################################
"""
s =input()
s=list(input())
a=int(input())
x,y = map(int,input().split())	
li = input().split()	
li = list(map(int,input().split()))	
li = input().split('T')	
"""
##################################################################
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())
ai = list(map(int, input().split()))

for i in range(n):
    print(ai.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:
import numpy as np

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

A = np.sort(A)

for i in range(1, N+1):
    ans = np.count_nonzero(A == i)
    print(ans)
    A = A[ans:]

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N = int(input())
A = np.array(list(map(int, input().split())))
#print(A)

for i in range(1, N+1):
    print(np.count_nonzero(A == i))

Submission status: Time Limit Exceeded

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

A.sort()
A_ = list(set(A))

for i in range(1, N+1):
    if i in A_:
        print(A.count(i))
        A = A[A.count(i):]
    else:
        print(0)

Submission status: Time Limit Exceeded

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

A.sort()

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=[]
for i in range(N-1):
    ans.append(A.count(i+1))
ans.append(0)
print("\n".join(list(map(str, ans))))

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=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 = 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 = list(map(int, input().split()))
for i in range(1, n+1):
    print(A_list.count(i))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

l=[]
for i in range(n,0,-1):
  l.append(syain.count(i))
  syain = [s for s in syain if s != i]

for i in range(n):
  print(l[n-1-i])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(n):
  print(syain.count(i+1))
  syain = [s for s in syain if s != i+1]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int,input().split(" ")))
 
managelist = [0] *n
 
for i in range(n-1):
   a_count = a.count(i+1)
   managelist[i] = a_count

for i in range(n):
    print(managelist[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())
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()))
b = [0]*N

for i in range(N):
  for j in range(N-1):
    if a[j]-1==i:
      b[i]=b[i]+1
for h in range(N):
  print(b[h])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#2020-05-01
n = int(input())
lst = list(map(int,input().split()))
for i in range(n):
    print(lst.count(i+1))

Submission status: Time Limit Exceeded

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

A_max = max(A)

for i in range(A_max):
  print(A.count(i+1))
for i in range(N-A_max):
  print(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:].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:
n = int(input())
a = list(input())
x = [print(a.count(str(i+1))) for i in range(n)]

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
A_r=list(input().split())
A=[int(x) for x in A_r]
for i in range(N):
    print(len([j for j,x in enumerate(A) if x==i+1]))

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    A = [x for x in input().split()]
    l = [0] * N
    C = list(set(A))
    for i in C:
        l[int(i)-1] = A.count(i)
    for i in range(N):
        print(l[i])
        
main()

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    A = [x for x in input().split()]
    l = [0] * N
    B = set(A)
    C = list(B)
    for i in C:
        l[int(i)-1] = A.count(i)
    for i in range(N):
        print(l[i])
        
main()

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    A = [x for x in input().split()]
    for i in range(1, N+1):
        print(A.count(str(i)))
main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    A = [x for x in input().split()]
    l = [0] * N
    B = set(A)
    C = list(B)
    for i in C:
        l[int(i)-1] = A.count(i)
    for i in range(N):
        print(l[i])
        
main()

Submission status: Time Limit Exceeded

Solution code:
def main():
    N = int(input())
    A = [x for x in input().split()]
    for i in range(1, N+1):
        print(A.count(str(i)))
main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read
 

# n,m = map(int,input().split())

# a = list(map(int, input().split()))  # n個の文字列がリストに格納される

N = int(input())

A = list(map(int, input().split()))  # n個の文字列がリストに格納される

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

print('0')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
# import sys
# readline = sys.stdin.readline
# read = sys.stdin.read
 

# n,m = map(int,input().split())

# a = list(map(int, input().split()))  # n個の文字列がリストに格納される

N = int(input())

A = list(map(int, input().split()))  # n個の文字列がリストに格納される

for i in range(N-1):
    ans = 0
    for j in range(len(A)):
        if A[j] == i+1:
            ans +=1
    print(ans)
    while i+1 in A:
        A.remove(i+1)

print('0')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

A = list(map(int, input().split()))  # n個の文字列がリストに格納される

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

print('0')

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

n = 1

while n <= N :
    print(A.count(n))
    n = n+1

Submission status: Time Limit Exceeded

Solution code:
# Nの形で社員数を受け取る
N = int(input())

# 上司の社員番号をリストで受け取る
A = list(map(int, input().split()))

# 繰り返しで探索する

n = 1

while n <= N :
    print(A.count(n))
    n = n+1

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read
 

# n,m = map(int,input().split())

# a = list(map(int, input().split()))  # n個の文字列がリストに格納される

N = int(input())

A = list(map(int, input().split()))  # n個の文字列がリストに格納される

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

print('0')

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
import sys
readline = sys.stdin.readline
read = sys.stdin.read
 

# n,m = map(int,input().split())

# a = list(map(int, input().split()))  # n個の文字列がリストに格納される

N = int(input())

A = list(map(int, input().split()))  # n個の文字列がリストに格納される

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

print('0')

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import collections

N = int(input())

Ninzu = []
for x in input().split():
	Ninzu.append(int(x))

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

print(0)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

N = n[0].pop(0)
A = n[1]

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

Submission status: Time Limit Exceeded

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

N = n[0].pop(0)
A = n[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()))

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 q in range(1, n + 1):
    print(a.count(q))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

Ninzu = []
for x in input().split():
	Ninzu.append(int(x))

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

for n in range(N):
    print(A.count(n+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:
import numpy as np
N = int(input())
A = np.array(list(map(int,input().split())))
for i in range(N-1):
    output = np.count_nonzero(i+1 == A)
    print(output)
print(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()))
print(*[A.count(n+1) for n in range(N)],sep="\n")

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())
funcionarios = list(map(int,input().split()))
for x in range(1,N+1):
    print(funcionarios.count(x))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import sys
input=sys.stdin.readline
N=int(input())
A=list(map(int,input().split()))
for x in range(N):
    y=x+1
    
    print(A.count(y))

Submission status: Time Limit Exceeded

Solution code:
import sys
input=sys.stdin.readline
N=int(input())
A=list(map(int,input().split()))
for x in range(N):
    y=x+1
    z=len([n for n in A if n==y])
    print(z)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = input().replace(" ", "")

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

print(0)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
N = int(input())
A_list = list(map(int, input().split()))
index = np.arange(1, N+1)
for i in index:
  print(A_list.count(i))

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
n = int(input())
Al = list(input().split())
count = Counter(Al)
for i in range(n):
    if str(i + 1) in Al:
        print(count[str(i+1)])
    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 = 0
    for j in range(len(a)):
        if a[j] == i+1:
            ans = ans + 1
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

#data = np.array(input().split(), dtype=np.int64)


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


data = read()

#count = collections.Counter(data)

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
boss_num = input()

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int,input().split()))
ans=0
for i in range(1,len(b)+2):
    for j in range(len(b)):
        if i==b[j]:
            ans+=1
    print(ans)
    ans=0

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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())
list1=list(map(int, input().split()))
list2=[0]*n
for i in list1:
      list2[i-1]=list1.count(i)
for j in list2:
      print(j,"\n")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = input()
a_list = s.split()
k = 1
while k <= n:
  a = a_list.count(str(k))
  print(a)
  k += 1

Submission status: Time Limit Exceeded

Solution code:
syain=int(input())
syain2=syain-1
wariate=input().split(' ')
x=[]

for j in range(syain2):
    tmp=0
    for i in wariate:
        if j==int(i)-1:
            tmp+=1
        else:
            pass
    x.append(tmp)
x.append(0)

for i in x:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
syain=int(input())
syain2=syain-1
#print(syain2)
wariate=input().split(' ')
x=[]

for j in range(syain2):
    #print(j+1)
    tmp=0
    for i in wariate:
        #print(i)
        #if i==syain2-1:
            #print(tmp)
            #x.append(tmp)
        
        if j==int(i)-1:
            tmp+=1
            #print(tmp)
            #x.append(tmp)
        else:
            pass
    x.append(tmp)
x.append(0)

for i in x:
    print(i)

Submission status: Time Limit Exceeded

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

for i in range(1,len(A)+2):
    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,len(A)+2):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# スペース区切りの整数の入力
strs = input().split()
zyousi = []
for s in strs:
    zyousi.append(int(s))

for i in range(a-1):
    buka_num = zyousi.count(i+1)
    # for j in range(i, a-1):
    #     # print(j)
    #     if i+1 == zyousi[j]:
    #         buka_num += 1
    print(buka_num)
print(0)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a = int(input())
# # スペース区切りの整数の入力
# b, c = map(int, input().split())
# スペース区切りの整数の入力
strs = input().split()
zyousi = []
for s in strs:
    zyousi.append(int(s))

for i in range(a-1):
    buka_num = 0
    for j in range(i, a-1):
        # print(j)
        if i+1 == zyousi[j]:
            buka_num += 1
    print(buka_num)
print(0)

Submission status: Time Limit Exceeded

Solution code:
from collections import deque
import math; floor,ceil = math.floor,math.ceil
import sys; input = lambda: sys.stdin.readline().rstrip()
aint = lambda: int(input()); ints = lambda: list(map(int, input().split()))
Yes = lambda boolean: print('Yes') if boolean else print('No')
YES = lambda boolean: print('YES') if boolean else print('NO')
is_even = lambda x: True if x%2==0 else False

def main():
    n = aint()
    a = ints()
    for i in range(n):
        print(a.count(i+1))

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):
    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):
    j=i
    k=0
    while j<n-1:
        if i+1==a[j]:
            k=k+1
        j=j+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:
n = int(input())
l = list(map(int, input().split()))

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

e.append(0)

for i in e:
    print(i)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 0
c = collections.Counter(a)
c_value = c.values()
c_key = c.keys()


i = 1
flag = True
count = 0
while flag:
  if i in list(c_key):
    print(c[i])
    if count == n-1:
      flag = False
  else:
    print(0)
    if count == n-1:
      flag = False
  i += 1
  count += 1

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
target = list(map(int,input().split()))
resultMap = {}

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

Submission status: Time Limit Exceeded

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

#5sub = [A.count(i) for i in range(N)]

[print(j) for j in [A.count(i+1) for i in range(N)]]

Submission status: Time Limit Exceeded

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

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

[print(i) for i in sub]

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int,input().split(" ")))
# print(n,a)
for j in range(1,n+1):
	a1=[i for i in a if i == j]
	print(len(a1))

Submission status: Time Limit Exceeded

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

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

for i in range(len(sub)):
    print(sub[i])

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 26 16:50:16 2020

@author: hiroki
"""


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

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

for i in range(len(sub)):
    print(sub[i])

Submission status: Time Limit Exceeded

Solution code:
def management():
    N=int(input())
    static_list=list(map(int,input().split()))
    result_list=[]
    for i in range(0,N):
        result_list.append(0)
    for i in range(0,len(static_list)):
        for j in range(0,N):
            if static_list[i]==j+1:
                result_list[j]=result_list[j]+1
    for i in range(0,N):
        print(result_list[i])


if __name__=="__main__":
    management()

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=b.copy()
d=0
e=[]
for m in range(a):
    tmp=0
    d+=1
    for i in range(m,len(b)):
        if d==b[i]:
            try:
                c.remove(b[i])
                tmp+=1
            except ValueError:
                break
    e.append(str(tmp))

f='\n'.join(e)
print(f)

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
b=list(map(int,input().split()))
c=b.copy()
d=0
e=[]
for m in range(a):
    tmp=0
    d+=1
    for n,i in enumerate(b):
        if d==i:
            try:
                c.remove(i)
                tmp+=1
            except ValueError:
                break
    e.append(str(tmp))

f='\n'.join(e)
print(f)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

b_list = list(range(1, N+1))
c_list = []
for i in range(N):
    sr = b_list[i]
    g = int(a.count(sr))
    c_list.append(g)

print(*c_list, sep='\n')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans=[0]*n

for i in range(n-1):
    s=str(i+1)
    ans[i]=a.count(s)

print(*ans, sep='\n')

Submission status: Time Limit Exceeded

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

ans=[0]*n

for i in range(n-1):
    s=str(i+1)
    ans[i]=a.count(s)

print(*ans, sep='\n')

Submission status: Time Limit Exceeded

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

ans=[0]*n

for i in range(n-1):
    s=str(i+1)
    ans[i]=a.count(s)

for m in range(n):
    print(str(ans[m]))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

ans=[0]*n

for i in range(n-1):
    ans[i]=0

    for m in range(n-1):

        if a_int[m] == i+1:
            ans[i]=ans[i]+1

for i in range(n):
    print(str(ans[i]))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = list(map(int, input().split()))
 
b_list = list(range(1, N+1))
c_list = []
for i in range(N):
    sr = b_list[i]
    g = int(a.count(sr))
    c_list.append(g)

for i in c_list:
    print(i)