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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(n):
  answer[a[i]] += 1
    
for i in range(n):
  print(answer[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

import numpy as np

n = int(readline())
a = np.array(readline().split(), np.int16)

a -= 1
ans = np.bincount(a, minlength=n)
print(*ans, sep="\n")

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
a = np.array(input().split())
buka = [0 for i in range(n)]

for i in a:
    buka[i] += 1

for i in buka:
    print(i)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

dict={}
dict[max(A)+1]=0
dict[1]=0
for a in A:
    if a in dict.keys():
        dict[a]+=1
    else:
        dict[a]=1
        if a+1 not in dict.keys():
            dict[a+1]=0

print(dict[1])
for a in A:
    print(dict[a+1])
    dict[a+1]=0

Submission status: Runtime Error

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

dict={}
dict[max(A)+1]=0
for a in A:
    if a in dict.keys():
        dict[a]+=1
    else:
        dict[a]=1
        if a+1 not in dict.keys():
            dict[a+1]=0

print(dict[1])
for a in A:
    print(dict[a+1])
    dict[a+1]=0

Submission status: Runtime Error

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

dict={}
dict[max(A)+1]=0
for a in A:
    if a in dict.keys():
        dict[a]+=1
    else:
        dict[a]=1
        if a+1 in dict.keys():
            dict[a+1]=0

print(dict[1])
for a in A:
    print(dict[a+1])
    dict[a+1]=0

Submission status: Runtime Error

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

dict={}
dict[max(A)+1]=0
for a in A:
    if a in dict.keys():
        dict[a]+=1
    else:
        dict[a]=1

print(dict[1])
for a in A:
    print(dict[a+1])
    dict[a+1]=0

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

dp = [0] * n

for i in a:
  b[i-1] += 1
  
for _ in b:
  print(_)

Submission status: Runtime Error

Solution code:
n,k=map(int,input().split())
num=0
for i in range(k,n+2):
    num+=i*(n-i+1)+1
print(num%(10**9+7))

Submission status: Runtime Error

Solution code:
n=int(input())
buka = [0]*n
for i in range(n):
  buka[int(input())-1] += 1
print(*buka,sep='/n')

Submission status: Runtime Error

Solution code:
N,K=map(int,input().split())
sum1=0
for k in range(K,N+2,1):
    sum1+=(N-k+1)*k+1
print(sum1%(10**9+7))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
As = list(map(int, input().split()))
ans = [0 for _ in range(N)]
 
for a in As
    ans[a-1] += 1

print(ans, sep="\n")

Submission status: Runtime Error

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

ac = Counter(a)
ad = list(ac.values())
ad.sort()
for i in range(n-1):
  print(ad[i])

Submission status: Runtime Error

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

ac = Counter(a)
ad = list(ac.values())
ad.sort()
for i in range(n):
  print(ad[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collection import counter

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

c = counter(a)

for _ in c:
  print(_)

Submission status: Runtime Error

Solution code:
N=int(input())
arr=[0]*N
for i in range(1,N):
    A=int(input())
    arr[A-1]+=1
for i in range(0,N):
    print(arr[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import collections
n = int(input)
A = list(map(int, input().split()))
cnt = collections.Counter(A)
for i in range(n):
  print(cnt[i])

Submission status: Runtime Error

Solution code:
import collections
n = input()
a = list(map(int, input().split()))
a = Counter(a)
for i in range(n):
  print(a[i])

Submission status: Runtime Error

Solution code:

from collections import Counter
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    C = Counter(A)

    for i in range(1, N+1):
        print(C[i])

if __name__ == "__main__":
    unittest.main()

Submission status: Runtime Error

Solution code:
n=int(input())
A = [int(x) for x in input().split()]
list=[]*(n+2)

for i in range(n-1):
  list[A[i]]+=1
for i in range(n+1):
  print(list[i])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
A = [int(x) for x in input().split()]
list=[]
for i in range(n):
  list.append(0)
for i in range(n-1):
  list[A(i)]+=1
for i in range(n):
  print(list[i])

Submission status: Runtime Error

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

N=int(input())
A = [0] * N
for i in range(N-1):
  C=int(input())
  A[C-1] = A[C-1] + 1
for i in A:
    print(i)

Submission status: Runtime Error

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

result = [0] * N
for a in A:
    result[a - 1] += 1
print('\n'.join(result))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
import collections
import numpy as np
n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
CountList = list(Col) 
for i in range(n-len(CountList)):
    CountList.append(0)
#padding = np.zeros_like(list(range(n-len(CountList))))
#print(padding)
#CountList2 = CountList + padding

for i in CountList:
    print(i)

#for i in range(n):
#    CountList[i] = List.count(i+1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
M = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
#print(B)
#print(B[])
num = 1

while num <= M:
    print(B[num])
    num += 1

Submission status: Runtime Error

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

Submission status: Runtime Error

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] = "{}".format(A_i.count(i) + "\n")
print("".join(C))

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N-2):
  m=list.count(str(i)
  answer.append(m)
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())
A =  list(map(int,input().split()))
for i in range(1,N+1):
    if A[a-1] < i:
        print(0)
    else:
        print(A.count(i)

Submission status: Runtime Error

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

i = 1
while i <= n  and len(l) != 0:
    count= 0
    kas=[]
    for j in range(n -1):
        if i == l[j]:
            count += 1
            kas.append(j)
        
    for  x  in kas:
        del l[x]
    i += 1
    print(count)

Submission status: Runtime Error

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

for i in range(n):
    print(a.count(i+1))
    l = [j for j in l if j != i+1]

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import Counter

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


d = Counter(x)

c = list(d.values())

for i in c:
  if len(c) == a:
  	c.append(0)

print('\n'.join(map(str, c)))

Submission status: Runtime Error

Solution code:
x=int(raw_input())
l=[int(i) for i in input().split()]
d={}
count=0
for i in l:
	if d.get(i) is not None:
		count+=1
		d[i]=count
	else:
		count=1
		d[i]=count

for i in range(1,x+1):
	if d.get(i) is not None:
		print(d[i])
	else:
		print("0")

Submission status: Runtime Error

Solution code:
N = int(input())
A = [int(input()) for i in range(N - 1)]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
if n %2 == 0:
    print(n-1)
else:
    print(n//2)
for i in a:
    ans = a[i]-a[i-i]
    print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N):
	answer.append(str(list.count(str(i))))
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
if n %2 == 0:
    print(n-1)
else:
    print(n//2)
for i in range(n):
for i in a:
    ans = a[i]-a[i-i]
    print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
import collections

b = input().split()
c = collections.Counter(b)
d = list(c.values())
e = list(c.keys())

current = 0
for i in range(N):
    print(i+1)

    if len(c) >= i:
        if e[current] == str(i + 1):
            print(d[current])
            
            current += 1
        else:
            print('0')
            
    else:
        print('0')

Submission status: Runtime Error

Solution code:
zimport itertools
import sys
import math
sys.setrecursionlimit(4100000)

n, k = map(int, input().split())
n += 1
if (n //2) >= k:
    k = k // 2
#n += 1
mod = 10**9 + 7
flag = 1
sum = 0

def Comborution(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

while n > k:
    sum += Comborution(n, k)
    k += 1
    flg = 0

if flag ==1:
    print(1)
else:
    print(sum % mod)

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
an = n%3
print(an)
for i in range(n):
for i in a:
    ans = a[i]-a[i-i]
    print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(str,input().split()))
 
a_unique = list(set(a))
a_sort = sorted(a,reverse=True)
 
for i in range(1,n+1):
    if str(i) in a_unique:
        ind = a_sort.index(str(i))
        print(len(a_sort[ind:]))
        a_sort = a_sort[:ind]
    else:
        print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int, input().split()))
an = n -a[-1]
print(an)
for i in a:
    ans = a[i]-a[i-i]
    print(ans)

Submission status: Runtime Error

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

leadnum = 1

'''
for _ in range(N):
  print(A.count(leadnum))
  leadnum += 1
'''

def countmin(L):
  global N,leadnum
  while leadnum < N + 1:
    print(L.count(leadnum))
    leadnum += 1
    return countmin(L)

countmin(A)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N-2):
	answer.append(list.count(str(i)))
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

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

for n in A:
    if n > A[n]+1:
        print("error")

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

Submission status: Runtime Error

Solution code:
def management(N,array):
	res = []
	for i in range(N):
      res[array[i]] += 1
    for j in range(len(res)):
      print(res[j])
     
    
    
N = int(input())
array = list(map(int,input().split())
managememt(N,array))

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N-2):
	answer.append(list.count(i))
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

Solution code:
a = int(input())
arr = list(map(int, input().split()[:a-1]))
list = [0]*a
for i range(a):
    list[i-1] += 1
    print(list)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
N = int(input())
emp = list(map(int,input().split()))
list.sort()
for i in range(N):
    print(emp.index(i+2)-emp.index(i+1))

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split()))
l.sort()
distinct_list = set(l)
count_list = []
count = 0
for d in distinct_list:
      count_list.append(l.count(d))
while count < n:
    if len(count_list) >= count:
        print(count_list[count])
    else:
        print(0)
    count += 1

Submission status: Runtime Error

Solution code:
N = int(input())
A = input().split()
c = collections.Counter(A)

import collections
for i in range(1,N+1):
    print(c[str(i)])

Submission status: Runtime Error

Solution code:
def management(N,array):
	res = []
	for i in range(N):
      res[array[i]] += 1
    for j in range(len(res)):
      print(res[j])
     
    
    
N = int(input())
array = list(map(int,input().split())
mamagememt(N,array))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N):
	answer.append(list.count(i))
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from collections import deafualtdict
n=int(input())
ar=list(map(int,input().split()))
d=defaultdict(int)
for i in ar:
  d[i]+=1
for i in range (1,n+1):
  if i in d.keys():
    print(d[i])
  else:
    print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
 n=int(input())
    boss=[int(x) for x in input().split()]
    mem=list(range(1, n+1))
    h_map = dict.fromkeys(mem, 0)
    for i in boss:
      h_map[i]+=1
    for i in mem:
      print(h_map[i])

Submission status: Runtime Error

Solution code:
N = int(input())
l=[]
l = [0]*N
for i in range(N-1):
    ai = int(input())
    l[ai-1]=l[ai-1] + 1
print('\n'.join(map(str, l)))

Submission status: Runtime Error

Solution code:
n = int(input())
de = deque(int(x) for x in input().split())
count = 0
for x in set(de):
  print(de.count(x))
  count += 1
for i in range(n-count):
  print(0)

Submission status: Runtime Error

Solution code:
import sys
import os
import math

def file_input():
    f = open('input.txt', 'r')
    sys.stdin = f

def main():
    file_input()

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

    for i in A:
        N[i-1]+=1

    for i in N:
        print(i)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
li = [int(x) for x in input().split()]
count = 0
for x in set(de):
  print(de.count(x))
  count += 1
for i in range(n-count):
  print(0)

Submission status: Runtime Error

Solution code:
# -*- coding UTF-8 -*-
n = int(input())
a = [int(x) for x in input(). split()]

ans = [0]*n
while True:
    x = a.pop(0)
    ans[x-1] = ans[x-1] + 1
    if not ans or sum(ans)>n:
        break
while ans:
    print(ans.pop(0))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0]*N
for i in [int(s) for s in input().split()]:
    A[i-1] +=1

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

Submission status: Runtime Error

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

for i in a:
    ans = n -a[-1]
    ans = a[i-1]-a[i]
    print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
A = [0]*N

print(A)
for i in [int(s) for s in input().split()]:
    A[i-1] +=1

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split))
l.sort()
distinct_list = set(l)
count_list = []
count = 0
for d in distinct_list:
      count_list.append(l.count(d))
while count < n:
    if len(count_list) > count:
        print(count_list[count])
    else:
        print(0)
    count += 1

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N+1):
	m=0
	for j in range(0, len(list)):
  		if list[j] is str(i):
      		m=m+1
    	else:
      		m=m+0
	answer.append(m)
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

Solution code:
N = int(input())
li = list(map(int,input().split()))+[2000001]

for i in range(N+1):
    a = min(li)
    if a == 200001:
        print(0)
    else:
        print(len([s for s in li if s == a]))
        li = [s for s in li if s != a]

Submission status: Runtime Error

Solution code:
import os

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

if __name__ == "__main__":
        main()

Submission status: Runtime Error

Solution code:
def function(n, list1):
  ans = [0] * n
  for i in list1:
    ans[i - 1] += 1
  string = ""
  for i in range(len(ans)):
    if i < len(ans) - 1:
      string += ans[i] + "\n"
    else:
      string += ans[i]
  return string

n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list1))

Submission status: Runtime Error

Solution code:
import numpy as np


if __name__ == '__main__':
    List = [list(map(int, input().split())) for i in range(2)]
    N = List[0][0]
    buka = np.array(List[1][:])


    l_out = np.zeros(N,dtype=int)

    for i in range(N):
        l_out[buka[i]-1] += 1

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

Submission status: Runtime Error

Solution code:
num = input()
hoge = list(map(int, input().split()))
count = 0
fuga = 0
 
for i in range(1, len(hoge)):
	if hoge[i] != hoge[i - 1]:
		print(i - count)
		fuga += 1
		count = i
		if i == len(hoge) - 1:
			print(i + 1- count)
			fuga += 1
	else:
		if i == len(hoge) - 1:
			print(i + 1- count)
			fuga += 1
for i in range(fuga, num):
	print(0)

Submission status: Runtime Error

Solution code:
import os

def main():
        n = int(input())
        a_list = tuple(map(int, input().split()))
        list_set = set(a_list)
        zero_list = [0]*n
        print(a_list)
        for l in list_set:
                zero_list[i-1] = a_list[i]
        for i in zero_list:
                print(i)
        """
        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: Runtime Error

Solution code:
n = int(input())
l = list(map(int, input().split))
l.sort()
distinct_list = set(l)
count_list = []
count = 0
for d in distinct_list:
      count_list.append(l.count(d))
while count < len(l):
    if len(count_list) > count:
        print(count_list[count])
    else:
        print(0)
    count += 1

Submission status: Runtime Error

Solution code:
import sys

a=int(input())
li=list(map(int,input().split()))
li.append(99999)
for i in range(1,a+1):
  count = 0
  for j in range(0, sys.maxsize):
    if li[j] == 99999:
      break
    elif li[j] == i:
      count += 1
  li = [s for s in li if s != i]
  print(count)

Submission status: Runtime Error

Solution code:
num = input()
hoge = list(map(int, input().split()))
count = 0
fuga = 0

for i in range(1, len(hoge)):
  if hoge[i] != hoge[i - 1]:
    print(i - count)
    fuga += 1
    count = i
    if i == len(hoge) - 1:
      print(i + 1- count)
      fuga += 1
    else:
      if i == len(hoge) - 1:
        print(i + 1- count)
        fuga += 1
for i in range(fuga, num):
  print(0)

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer={}
for i in range(1, N+1):
	m=0
	for j in range(0, len(list)):
  		if list[j] is str(i):
      		m=m+1
    	else:
      		m=m+0
	answer.append(m)
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

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

c = collections.Counter(a_list)
[print(c[i+1]) for i in range(n)]

Submission status: Runtime Error

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

for i in range (1,n+1):
    ans = a.count(i)
    print(ans)
    p = p + ans
    a.remove(i)
    if p == n-1:
        break
for s in range (n-i):
    print(0)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
m = input().split()
m = [int(i) for i in m]
 
for i in range(n):
  l.append(0)
for i in m:
  ind = i-1
  l[ind] += 1
for i in l:
  print(i)

Submission status: Runtime Error

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

def print_sub(A, m, c):
    A -= 1
    print(m - np.nonzero(A)[0].size)
    c +=1
    if c < m:
        print_sub(A, m, c)
    else:
        print("0")
        

n= int(input())
A = [int(a) for a in input().split()]
A = np.array(A)
c = 0
print_sub(A, n-1, c)

Submission status: Runtime Error

Solution code:
N=map(int, input())
list=list(map(str, input().split()))
answer={}
for i in range(1, N+1):
  m=0
  for j in range(0, len(list)):
  	if list[j] is str(i):
      m=m+1
    else:
      m=m+0
answer.append(m)
a_s='\n'.join(answer)
print(a_s)

Submission status: Runtime Error

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

count= [0] * N

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

Submission status: Runtime Error

Solution code:
N = int(input())
array = list(map(int, input().strip().split()))
array.sort
ansarray = []
ansnum = 1
ans = 0
ansindex = 0
for i in range (1,N+1):
    for j in range(ansindex,N-1):
        if (array[j] == i):
            ans += 1
            ansindex += 1
        else:
            ansarray.append(ans)
            ans = 0
            break
        if(j == N-2):
            ansarray.append(ans)
for i in range(N-ansindex):
    ansarray.append("0")
for i in range(N):
    print(ansarray[i])

Submission status: Runtime Error

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

# if N >= sum(A):
#     print(N-sum(A))
# else:
#     print(-1)
count= [0] * N

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