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


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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

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

#list = [1, 5, 5, 10, 10, 10, 15, 15, 15,  20]

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

Submission status: Time Limit Exceeded

Solution code:
from math import gcd
from functools import reduce
from itertools import product

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, list(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()))#N-1

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:

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

buka = []


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

    buka.append(b)
    
# 出力
for i in range(N):
    print(buka[i])

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    a = list(map(int,input().split()))
    l = []
    for i in range(N):
        l.append(a.count(i+1))

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



if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

N = int(input())

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
a= [int(i) for i 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()))

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:

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


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

Submission status: Time Limit Exceeded

Solution code:

n = int(input())

a_list = list(map(int, input().split()))
buka_list = []

one_a = ''.join([str(n) for n in a_list])

one_a = str(one_a)

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

    print(one_a.count(str(i)))

Submission status: Time Limit Exceeded

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

count_lst = []
# print(lst.count(1))
for i in range(n):
    # print(i)
    print(lst.count(i + 1))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

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

rg = range(1, n + 1)

for i in rg:
    print(ls.count(i))
    if ls.count(i) != 0:
        ls.remove(i)

Submission status: Time Limit Exceeded

Solution code:
def get_subordinate(n, members):
    for i in range(1, n+1):
        count = 0
        for member in members:
            if i == member:
                count += 1
        print(count)


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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

a = []
s = [0] * n
a.append(input().split())

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

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

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

Submission status: Time Limit Exceeded

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

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

aa = N - 1
bb = N
for a in range(1,N+1):
    print(A.count(a))
    aa -= A.count(a)
    bb -= 1
    if aa == 0:
        break
        
for i in range(bb):
    print(0)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=list(map(int,input().split()))
b=[]
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()))

k=0
t=1
for i in range(1,N):
    print(A.count(i))
print(0)

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, 1):
    buka[i-1] = str(A.count(i))

print("\n".join(buka))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a_list = input().split()
for a_num in range(len(a_list)):
    ans = a_list.count(str(a_num+1))
    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):
    cnt = 0
    flg = False
    for j in a:
        if i == j:
            flg = True
            cnt += 1
        elif i != j and flg == True:
            break
    print(cnt)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np


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

count = 0
num = len(a)
for k in range(num + 1):
    print(a.count(k+1))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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))
    for j in range(A.count(i+1)):
        A.remove(i +1)
        #print(A)


print("0")

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

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 = list(map(int, input().split()))
counter = 0
for x in range(2, n+2):
    for i in a:
        if i == x-1:
            counter += 1
    print(counter)
    counter = 0

Submission status: Time Limit Exceeded

Solution code:
n= int(input())

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

ls = list(map(int, input().split()))
ls.sort()

rg = range(1, n + 1)

for i in rg:
    print(ls.count(i))
    if ls.count(i) != 0:
        ls.remove(i)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

for i in range(N):
    if i+1 not in joushi_no_bangou:
        ans.insert(i,0)
    else:
        ans.insert(i,joushi_no_bangou.count(i+1))
for i in range(N):
    print(ans[i])

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
ans = []
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 = input()
line = input()
n = int(n)
a_list = line.split(" ")
a_list = [int(a) for a in a_list]

set_list = list(set(a_list))

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
Worker = [i for i in range(1, int(input())+1)]
UnderWorker = [int(n) for n in input().split()]

for n in Worker:
  print(UnderWorker.count(n))

Submission status: Time Limit Exceeded

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

def main(i):
  a = 0
  for j in A:
    if i == j:
      a = a+1
  print(a)


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

Submission status: Time Limit Exceeded

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

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

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

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
A = list(map(int,input().split()))
A.sort(reverse = True)
for i in range(1,N+1):
    try:
        if A[-1]==i:
            B = A.index(i)
            print(N-(B+1))
            del A[B:]
            N=B+1
        else:
            print(0)
    except:
        print(0)

Submission status: Time Limit Exceeded

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

ans = [0]

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

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

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 i in range(1, N+1):
    if i == 1:
        if A.count(i) == 0:
            print("1")
    print(A.count(i))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

list_ = []
for i in range(N):
  if i != 0:
	  print(A.count(i))
print(0)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np

N=int(input())

A=np.array(input().split(),dtype=np.int32)

result=[]
for sid in range(1,N+1):
    cnt=0
    for a in A:
        if(sid==a):
            cnt+=1
        elif(sid<a):
            break
    result.append(cnt)

for r in result:
    print(r)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

ans = [0] * n
c = a_list2.count(1)
a_list2 = [i for i in a_list2 if i != 1]
ans[0] = c

for i in range(n-1):
    a_buka = a_list[i] + 1
    count = a_list2.count(a_buka)
    a_list2 = [j for j in a_list2 if j != a_buka]
    ans[i+1] = count

for x in ans:
    print(x)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

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

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

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:
from collections import deque

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

for i in range(1,n+1):
    if i == 1:
        ans = str(a.count(str(i)))
    else:
        ans = ans + "\n" + str(a.count(str(i)))

print(ans)

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
    count=0
    for a in A:
        if str(i) in a:
            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:
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
      break

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()))
B = []

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

Submission status: Time Limit Exceeded

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

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


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
num = int(input())
list = [str(x) for x in input().split()]
list2 = []
l = "".join(list)

for x in range(1,num+1):
    a = l.count(str(x))
    list2.append(a)

for i in range(num):
    print(list2[i])

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
member=["0"]+input().split()
answer=""
for i,x in enumerate(member):
    answer=answer+str(member.count(str(i+1)))+"\n"
print(answer[:-1])

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
a = int(input())
num = np.array(list(map(int,input().split())))
for i in range(1,a+1):
    print(len(num[num==i]))

Submission status: Time Limit Exceeded

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

for i in range(1,N+1):
  j=list.count(i)
  res+=j
  print(j)
  if(res>N):
    break
  i+=1

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import gc
n = int(input())
num = list(map(int,input().split()))

for i in range(1,n+1):
    print(num.count(i))
del num
gc.collect()

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))
    else:
        print(0)

Submission status: Time Limit Exceeded

Solution code:
import collections

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

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


for j in range(n):
  print(answer[j])

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

arr = [0] * N

for i in range(len(A)):
   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"] * N
for i in uq_A_i:
    C[i - 1] = "{}\n".format(A_i.count(i))
print("".join(C))

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)
    cnt = str(cnt)
    cnts.append(cnt)

ans = '\n'.join(cnts)

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

else:
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np


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

count = 0
num = len(a)
for i in range(num + 1):
    count = 0
    for k in range(num):
        if a[k] == i+1:
            count += 1
    print(count)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

Solution code:
import math

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

list_ = []
for i in range(N):
  list_.append(A.count(i))

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

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))))
    arg = list(filter(lambda x: x != n + 1, arg))

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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


    
for j in range(N+1):
    x = Ai.count(str(j))
    output.append(x)
output.pop(0)

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

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

Submission status: Time Limit Exceeded

Solution code:
import sys

lines = sys.stdin.readlines()

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

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

ans = 0
k = -1

for i in range (1,N):

    k += 1
    
    for j in range(k,N-1):

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

    print(ans)

    ans = 0

print("0")

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
a  = list(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=input().split()

result=[]
for sid in range(1,N+1):
    result.append(A.count(str(sid)))

for r in result:
    print(r)

Submission status: Time Limit Exceeded

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

count = 0
for j in range(n):
    print(li.count(j+1))

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = list(map(int, input().split()))
li = [0] * (n+1)
for i in range(len(a)):
	if li[a[i]] == 0:
		li[a[i]] = a.count(a[i])
#print(li)
li = li[1:]
print(*li, sep = "\n")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

for i in range(N):
  n = A.count(i)
  number.append(n)
  if n != 0:
    A.remove(i)
  n = 0

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

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

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

print(0)

Submission status: Time Limit Exceeded

Solution code:
#!/usr/bin/env python3
import sys


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    N = int(input())
    a = list(map(int,input().split()))
    l = []
    for i in range(N):
        l.append(a.count(i+1))

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



if __name__ == '__main__':
    main()

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 = []
[print(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()))

leadnum = 1
counter = 0

for _ in range(N):
  for i in A:
    if i == leadnum:
      counter += 1
  print(counter)
  counter = 0
  leadnum += 1

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(N) :
        n_cycle = n_cycle + 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:
n=int(input())
li = list(map(int,input().split()))
import numpy as np

a = np.array(li)
for i in range(n):
  print(np.count_nonzero(a == i+1))

Submission status: Time Limit Exceeded

Solution code:
a=int(input())
c=input().split()
for i in range(a-1):
    c[i]=int(c[i])
max1=max(c)
for j in range(max1):
    print(c.count(j+1))
for k in range(a-max1):
    print(0)

Submission status: Time Limit Exceeded

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

an = []
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()))
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()))
A.sort(reverse = True)
for i in range(1,N+1):
    try:
        B = A.index(i)
        print(N-(B+1))
        del A[B:]
        N=B+1
    except:
        print(0)

Submission status: Time Limit Exceeded

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

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

arr = [0] * N

for i in range(len(A)):
    arr[i] = A.count(i+1)

for v in arr:
    print(v)