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())
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()))
print(A.count(1))
for i, num in enumerate(A):
    ORG = A[:]
    ORG.pop(i)
    me = i + 2
    print(ORG.count(me))

Submission status: Time Limit Exceeded

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

from itertools import groupby
A = sorted(A)
con =0

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

Submission status: Time Limit Exceeded

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

for i in range(n):
    under = list_a.count(i+1)
    print(under)
    del list_a[:under]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
l=list(map(int,input().split()))
d={}
for i in set(l):
  d[i]=l.count(i)
for i in range(1,n+1):
    if i in d:
      print (d[i])
    else:
      print (0)

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
    if shine[x] < As[y]:
      break
  print(c)
  c = 0

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a = [int(x) for x in input().split()]
L = len(a)
for i in range(1,N+1):
    answer = 0
    for j in range(L):
        if i == a[j]:
            answer += 1
    print(answer)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
# 文字列の入力
s = input()
t = s.split(" ")
ans = []

for i in range(N):
    num = 0
    for j in range(len(t)):
        if int(t[j]) == i+1:
            num=num+1
    ans.append(num)

for i in ans:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
import os

def main():
        n = int(input())
        a_list = list(map(int, input().split()))
        result = [0]*n
        list_set = set(a_list)
        for i in list_set:
                result[i-1] = a_list.count(i)
        for i in result:
                print(i)

if __name__ == "__main__":
        main()

Submission status: Time Limit Exceeded

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

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 = []
for i in range(N):
    li.append(a.count(i + 1))
    print(li[i])

Submission status: Time Limit Exceeded

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

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

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
    cnt += 1
    print(a)
    a = 0

Submission status: Time Limit Exceeded

Solution code:


N = input()
N = int(N)
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()))

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

ans=''
for i in range(n):
    ans+=str(a.count(i+1))+'\r\n'

print(ans)

Submission status: Time Limit Exceeded

Solution code:
input_line = int(input())
ans = [0] * input_line

inputs = input().split(' ')
inputs = list(map(int, inputs))
for e in inputs:
  for i in range(1, input_line):
    if e == i:
      ans[i-1] += 1

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

Submission status: Time Limit Exceeded

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

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

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

Submission status: Time Limit Exceeded

Solution code:
N = input()
S = input()

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

Submission status: Time Limit Exceeded

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

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

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))
    A=[s for s in A if s != i+1]

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
joushiList = list(map(int, input().split()))
        
bukaList = {}
for no in range(1,N+1) :
    bukaList[no] = joushiList.count(no)

for o in bukaList :
    print(bukaList[o])

Submission status: Time Limit Exceeded

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

list_ = []
for i in range(N):
  list_.append(sum([1 for a in A if a==i]))

list_.append(0)
for j in list_[1:]:
  print(j)

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())
ip2 = input()
A_sub = ip2.split(" ")
A = []
for a in A_sub:A.append(int(a))

l = [0]*N
for i in range(max(A)):
    l[i] = A.count(i+1)
for sl in l:
    print(sl)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/evn python3

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())
mentors = input().split(" ")

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

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())
li=list(map(int,input().split()))
for i in range(n):
    x=0
    for s in range(len(li)):
        if i+1==li[s]:
            x+=1
    print(x)

Submission status: Time Limit Exceeded

Solution code:
import sys
N = int(input())
A = list(map(int,input().split()))
t = 0
for i in range(1,N+1):
    print(A.count(i))
    t += A.count(i)
    if t == N-1:
        for j in range(i+1,N+1):
            print(0)
        sys.exit()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import collections

def main(A):
    return collections.Counter(A)


if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    # N = 7
    # A = list(map(int, "1 2 3 4 5 6".split()))
    [print(main(A)[i + 1]) for i in range(N)]

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)
    del a[:count]
    print(count)

Submission status: Time Limit Exceeded

Solution code:

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:
num = int(input())
hoge = list(map(int, input().split()))
fuga = 0
for i in range(num - 1):
  count = 0
  for j in range(fuga, num - 1):
    if hoge[j] == i + 1:
      count += 1
  fuga += count
  print(count)
print(0)

Submission status: Time Limit Exceeded

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

a_set = set(a_li)

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
ip1 = input()
ip1list = ip1.split(" ")
N = int(ip1list[0])
ip2 = input()
A_sub = ip2.split(" ")
A = []
for a in A_sub:A.append(int(a))

l = [0]*N
for i in range(max(A)):
    l[i] = A.count(i+1)
for sl in l:
    print(sl)

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))
    if i != n:
        a.pop(0)

for i in nums:
	print(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):
  s[i] = A.count(i+1)
  print( s[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=input()
for i in range(n):
  print(a.count(str(i+1),i,))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
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()))
print(len([n for n in A if n == 1]))
for i, num in enumerate(A):
    ORG = A[:]
    ORG.pop(i)
    me = i + 2
    print(ORG.count(me))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

from collections import Counter
from functools import lru_cache

ans = [0]*(N+1)

@lru_cache(maxsize=1000)
def main(i):
    ans[i] = A.count(i)
    print(ans[i])

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

Submission status: Time Limit Exceeded

Solution code:
sh = int(input())
b = input()

id = [int(n) for n in b.split(" ")]
id_list = set(id)

for i in range(1,sh+1):
    if  {i} <= id_list:
        print(id.count(i))
    else:
        print(0)

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(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):
    cnt = 0
    for j in a:
        if i == j:
            cnt += 1
        else:
            pass
    print(cnt)

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):
    if n+1 in A:
        print(A.count(n+1))
    else:
        print(0)

Submission status: Time Limit Exceeded

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

list_A_int = [int(s) for s in list_A]

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

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

for i in range(1,N+1):
  ans = data.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)):
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
mentors = input().split(" ")
mentors = [int(mentors[i]) for i in range(len(mentors))] 

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

Submission status: Time Limit Exceeded

Solution code:
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
c = Counter(A)
for i in range(1,N + 1):
    if (i) not in A: print(0)
    else: print(c[i])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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[i-1:].count(i))

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 19 21:27:49 2020

@author: arute
"""


from sys import stdin

import time
import numpy as np

############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])

data = []
write = stdin.readline().split()
for i in range(N-1):
    data.append(int(write[i]))

data = np.asarray(data)

out = ""
for i in range(N):
    out+=str((np.sum(data==(i+1))))+"\n"

print(out)

Submission status: Time Limit Exceeded

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

a = [int(i) for i in a]

for i in range(n):
  buka = [j for j in a if j==i+1]
  print(len(buka))

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
l = [0]
l.extend(list(map(int, input().split(" "))))

for d, i in enumerate(l):
    print(sum(map(lambda x: x == d + 1, l)))

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

Submission status: Time Limit Exceeded

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

if __name__ == '__main__':
    main()

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

AnStr = input().split(' ')
zyosiList = []
for v in AnStr:
  zyosiList.append(int(v))

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

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)
    if ans > 0:
        a.remove(i+1)

Submission status: Time Limit Exceeded

Solution code:

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

buka = [0] * N
for i in range(1, N, 1):
    buka[i-1] = A.count(i)

for elem in buka:
    print(f'{elem:1d}', end='\n')

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

l = [int(i) for i in input().split()]
c = 1
ans = []
f = 0
for j in range(1,n):
    c = l.count(j)
    f += c
    ans.append(c)
    if f == n:
        break
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()))
li = []
for i in range(N):
    li.append(a.count(i + 1))
    print(li[i])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
str = input()
line = input().split()

count = []
for i in range(int(str)):
    temp = 0
    for k in range(len(line)):
        if (i+1) == int(line[k]):
            temp = temp + 1
    count.append(temp)

[print(i) for i in count]

Submission status: Time Limit Exceeded

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

for j in ans:
    print(j)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = input().split()
A.insert(0,0)
x = [0]*N
for j in range(N):
    print(A.count(str(j+1)))

Submission status: Time Limit Exceeded

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

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):
    if s < n:
        c = a.count(i)
        s = s + c
        print(c)
    elif s >= n:
        print('0')

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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):
    print(A.count(n+1))

Submission status: Time Limit Exceeded

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

N = int(input())

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a_list = list(map(int, input().split()))
result_str = ''

for i in range(1, N+1):
    result_str += str(a_list.count(i)) + '\n'

# 最後の改行を削除
result_str = result_str[:-1]
print(result_str)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import Counter


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

    for i in range(N):
        print(Counter(A)[i + 1])


if __name__ == "__main__":
    main()

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

print(0)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
#immediate boss and immediate subordinate
AS = input()
Ai = AS.split(" ")
output = []


for i in range(N):
    output.append(0)
    
for j in Ai:
    temp = int(output[int(j) - 1])
    temp = temp + 1
    output[int(j) - 1] = str(temp)


x = ""
for A in output:
    x = x+str(A)+" "
print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

employee = input().split(" ")

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
  res.append(list.count(i))
  i+=1

j=0
for j in range(0,len(res)):
  print(str(res[j]))
  j+=1

Submission status: Time Limit Exceeded

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

ma = max(li)
cnts = []
for i in range(0, ma):
    cnt = li.count(i+1)
    cnts.append(cnt)

for i in cnts:
    print(i)

if ma < n:
    ans = '0\n'*(n-ma)
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Your code here!
N = int(input())
A = list(map(int, input().split()))

#NMAX = max(A)

def keisan(A,i):
    ans = A.count(i)
    print(ans)

i=1
while i<=N:
    
    keisan(A,i)
    #ans = A.count(i)
    #print(ans)
    i+=1

Submission status: Time Limit Exceeded

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

max_A = max(A)

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

for i in range(max_A + 1, N+1):
    print(0)

Submission status: Time Limit Exceeded

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split()]
del a[n:len(a)-1]
result = []
for i in range(n):
    print(a.count(i+1))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

for i in range(n):
  	print(s[i+1])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
def CountFrequency(my_list,n1): 
    count1 = 0
    freq = {} 
    for items in my_list: 
        freq[items] = my_list.count(items) 
    for key, value in freq.items():
    	print(value)
    	count1+=1
    if(count1!=n1):
        for i in range(n1-count1):
            print("0")
CountFrequency(a,n)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8

import sys
import math
import collections
import itertools
from inspect import currentframe
INF = 10 ** 10
MOD = 10 ** 9 + 7
def input() : return sys.stdin.readline().strip()
def gcd(x, y) : return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y) : return (x * y) // gcd(x, y)
def I() : return int(input())
def LI() : return [int(x) for x in input().split()]
def RI(N) : return [int(input()) for _ in range(N)]
def LRI(N) : return [[int(x) for x in input().split()] for _ in range(N)]

N = I()
A = LI()

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a=list(map(int, input().split()))
nagasa=len(a)
count=0
for i in range(1,n+1):
    for j in range (nagasa):
        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()))
buka_num=[]
for i in range(1,len(a)+1):
  buka_num.append(str(a.count(i)))
buka_num.append("0")
joined = "\n".join(buka_num)
print(joined)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun Apr 19 21:27:49 2020

@author: arute
"""


from sys import stdin

import time
import numpy as np

############################################

# read data for n sequences.
temp = stdin.readline().split()
N = int(temp[0])

data = []
write = stdin.readline().split()
for i in range(N-1):
    data.append(int(write[i]))

data = np.asarray(data)

for i in range(N):
    print(np.sum(data==(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):
    print(A.count(i+1))

Submission status: Time Limit Exceeded

Solution code:
from sys import stdin


def main():

    N = int(input())
    Alists = [int(x) for x in stdin.readline().rstrip().split()]

    for n in range(1, N+1):
        a = len(Alists)
        Alists = [i for i in Alists if not i == n]
        print(a-len(Alists))


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
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()))
B = [0]*N
for a in A:
    if a in A:
        B[a-1] += 1
for a in B:
    print(a)

Submission status: Time Limit Exceeded

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

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

print("0")

Submission status: Time Limit Exceeded

Solution code:
from collections import deque

n = int(input())
a = input()
ans = deque()

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

for j in ans:
    print(j)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
Alist = list(map(int,input().split()))
ans=[]
for i in range(N):
    if int(i+1) in Alist:
        a=i+1
        #ans.append(str(Alist.count(a))+"\n")
        ans.append(str(Alist.count(a)))
        #print(Alist.count(a))
    else:
        #print(0)
        #ans.append(str(0)+"\n")
        ans.append(str(0))

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

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):
  counter = 0
  for j in range(n-1):
    if a[j] == i:
      counter += 1
  print(counter)

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

if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
member=["0"]+input().split()
for i,x in enumerate(member):
    print(member.count(str(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):
    if (i) not in A: print(0)
    else: print(A[i - 1:].count(i))