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: Wrong Answer

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
l = 0
for x in range(N):
  for y in range(len(As)):
    if As[y] < shine[x]:
      continue
    elif shine[x] < As[y]:
      l += 1
      break
    elif shine[x] == As[y]:
      c += 1
  print(c)
  c = 0
  del As[:l]
  l = 0

Submission status: Wrong Answer

Solution code:
import math
if __name__ == "__main__":
	n =  int(input())

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

	res = [0]*(n)

	val = 1
	gidx = 0
	for i in range(1,len(ass)):
		if  ass[i] == ass[i-1]:
			val +=1
		else:
			res[gidx] = val
			val = 1
			gidx +=1
	res[gidx] = val






	print(res)

Submission status: Wrong Answer

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
l = 0
for x in range(N):
  for y in range(len(As)):
    if As[y] < shine[x]:
      continue
    elif shine[x] < As[y]:
      l += 1
      break
    elif shine[x] == As[y]:
      c += 1
  print(c)
  c = 0
  del As[:l]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
n=int(input())
a=[int(i) for i in input().split()]
new=Counter(a)
for i in new.values():
    print(i)
[print(0) for j in range(1,n-len(new)+1)]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A_i = list(map(int, input().split()))
uq_A_i = list(set(A_i))
C = np.array(["0\n"] * N)
for i in uq_A_i:
    C[i - 1] = "{}\n".format(A_i.count(i))
print("".join(C.tolist()))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input()
S = A.replace(' ','a')
S = S + 'a'

for i in range(N-1):
  j = str(i+1) + 'a'
  k = S.count(j)
  print(k)

Submission status: Wrong Answer

Solution code:
N = int(input())
A1 = [0]
Ai = [int(a) for a in input().split()]
A = A1+Ai
B = [b+1 for b in A]

for b in B:
    print([a==b for a in A].count(True))

Submission status: Wrong Answer

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


if __name__ == '__main__':
    q3()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A.insert(0,0)
keys = set(A)
values = [A.count(i+1) for i in keys]
d = dict(zip(keys, values))
for i in A:
        print(d[i])

Submission status: Wrong Answer

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

A.sort()

before = 0
tmp = 0
for i in range(N-1):
    if A[i] == before:
        tmp += 1
    else:
        print(tmp)
        before += 1
        tmp = 1

print(tmp)

for i in range(N-before):
    print(0)

Submission status: Wrong Answer

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

i = int(1)
for i in a:
    if i > n:
        break
    else:
        print(a.count(i))

Submission status: Wrong Answer

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

c = collections.Counter(a)

for i in c.values():
    print(i)

l=N-len(c)
for j in range(l):
    print("0")

Submission status: Wrong Answer

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

l_a = [int(x) for x in a]
s_a = set(l_a)

dc = {}

l_s = []
for i in s_a:
  dc[i] = l_a.count(i)
  
index = 1
k = 0
for i in dc.keys():
  while i + k < index:
    print(0)
    k += 1
  print(dc[i])
  index += 1
  
while index <= num:
  print(0)
  index += 1

Submission status: Wrong Answer

Solution code:
size = int(input())
li = list(map(int,input().split()))
ans = [0]*size
for i in li:
    if i not in ans:
        ans[i-1] = 1
    else:
        ans[i-1] += 1
for i in ans:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input().split()
B = sorted(set(A))
for i in B:
    print(A.count(str(i)))
for i in range(N - len(B)):
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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)

for i in range(1,N):
    
    keisan(A,i)
    #ans = A.count(i)
    #print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
syain = []
for i in range(N):
	syain.append(0)
x =(input()).split(" ")
xid = [int(s) for s in x]
for t in xid:
	syain[t-1]+=1
print(syain)

Submission status: Wrong Answer

Solution code:
from sys import stdin

def main():
  N = int(input())
  l = list(map(int, input().split(" ")))
  
  _ = [print(l.count(n+1))for n in range(N)]
  
  
  
if __name__ == "main":
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
n=int(input())
a=[int(i) for i in input().split()]
new=Counter(a)
for i in new.values():
    print(i)
[print(0) for i in range(1,n-len(new)+1)]

Submission status: Wrong Answer

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

for i in range(1,n):
    nmb_cnt = 0
    idx_cnt = 0
    for j in a:
        if j == i:
            del a[idx_cnt]
            nmb_cnt += 1
        else:
            idx_cnt += 1
    print(nmb_cnt)

print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

a = int(input())
lists = list(map(int, input().split())) #１行の入力をi[0],i[1]というように空白で分けてを取得し、iに値を入れる

num = [0]*a

def mi(x):
    return int(x-1)
y = list(map(mi,lists))
for i in y:
    #print(i)
    num[y[i]] += 1
for i in range(a):
    print(num[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
x.sort(reverse = False)
ans = 0
while len(x)>1:
    if x[0]==x[1]:
        cnt = 0
        while len(x)>1 and x[0]==x[1]:
            cnt += 1
            del x[0]
        cnt += 1 
        print(cnt)
        ans += 1
        del x[0]
    else:
        if x[1]-x[0]==1:
            print(1)
            ans += 1
            del x[0]
        else:
            for s in range(x[1]-x[0]):
                print(0)
                ans += 1
            del x[0]
if len(x)>0 and n - x[0]==1:
    print(1)
    ans +- 1
for i in range(n - ans):
    print(0)

Submission status: Wrong Answer

Solution code:
count = int(input())

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

total = 0

for i in range(count):
    a =data.count(i + 1)
    print(a)
    if total + a+1 == count:
        print("0 \n" *(count - i))

Submission status: Wrong Answer

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

j=1
t=[0]*n
for i in range(n-1):
    if j == int(ali[i]):
        t[j-1]+=1
    else:
        t[j]+=1
        j+=1
for i in range(n):
    print(t[i])

Submission status: Wrong Answer

Solution code:
# n = int("5")
# boss_list = list(map(int, "1 1 2 2".split(" ")))
n = int(input())
boss_list = list(map(int, input().split(" ")))

boss_list = sorted(boss_list)


for i in range(n):
    boss_num = 0
    boss_num = boss_list.count(i + 1)
    # boss_list = boss_list[boss_num:]
    del boss_list[:boss_num]

    if i == 0:
        boss_num -= 1

    print(boss_num)

Submission status: Wrong Answer

Solution code:
import collections

n = input()
n = int(n)
alist = input().split(" ")
intalist = [int(s) for s in alist]

setalist = list(set(intalist))
# print(setalist)
c = collections.Counter(intalist)
# print(c)
if n == 1:
    print(0)
else:
    for i in range(0,n):
        try:
            print(c[setalist[i]])
        except IndexError:
            print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
an = input().split()
An =[]
for a in an:
    An.append(int(a))
buka = []
for i in range (1,N):
    buka.append(An.count(i))
for b in buka:
    print(b)

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=list(map(int,(stdin.readline().strip().split())))
A.sort()
moji=A[0]
count=1
i=0
length=len(A)-1
j=0
sougou=0
while(i!=length):

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

Submission status: Wrong Answer

Solution code:
in1 = input()
A = input().split(" ")
for i in range(1, int(in1)):
    sum = 0
    for j in A:
        if int(j) == i:
            sum += 1
    print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from itertools import groupby
m = int(input())
a = list(map(int, input().split(' ')))
f = [len(list(group)) for key, group in groupby(a)]
for i in range(0, m):
    if i < len(f):
        print(f[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input()) # 5人
    An = list(map(int, input().split(' '))) # A2, A3,...
    
    # N = 5
    # An = [1, 1, 2, 2]
    
    # N = 7
    # An = [1, 2, 3, 4, 5, 6]

    NUM = An.copy()
    out = []
    counter = []
    
    start_index = 0
    
    for n in range(1, N+1):
        count = 0
        for an_i in range(start_index, len(An)):
            an = An[an_i]
            if n >= an:
                if len(NUM) > 0 :
                    count += 1
                    start_index += 1
                    NUM.pop(0)
                # print(n, an, NUM)
        counter.append(count)
        out.append(count)
        
        # print('counter:', counter, 'out:', out)
        
    # print('counter:', counter)
    for i in counter:
        print(i)
            
    
main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A.sort()

before = 1
tmp = 0
for i in range(N-1):
    if A[i] == before:
        tmp += 1
    else:
        print(tmp)
        before += 1
        tmp = 1

print(tmp)

for i in range(N-before):
    print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = input()
S = A.replace(' ','a')
for i in range(N):
  j = str(i+1) + 'a'
  k = S.count(j)
  print(k)

Submission status: Wrong Answer

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

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

# 連続する要素をグループ化する
for key, group in groupby(A):
    print(len(list(group)))
    con += 1
for i in range(con,M):
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(list(map(int, input().split())))
least = A[0]
count = 0
result = [0] * N
for a in A:
    if a == least:
        count += 1
    else:
        result[a-1] = count
        least += 1
        count = 1
if result[0] == 0:
    result[0] = count

length = len(result)
for i in range(N-length):
    result.append(0)

for r in result:
    print(r)

Submission status: Wrong Answer

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

boss_list = sorted(boss_list)


for i in range(n):
    boss_num = 0
    boss_num = boss_list.count(i + 1)
    boss_list = boss_list[boss_num:]

    if i == 0:
        boss_num -= 1

    print(boss_num)

Submission status: Wrong Answer

Solution code:
import collections

n = input()
n = int(n)
alist = input().split(" ")
intalist = [int(s) for s in alist]

setalist = list(set(intalist))
# print(setalist)
c = collections.Counter(intalist)
# print(c)
for i in range(0,n):
    try:
        print(c[setalist[i]])
    except IndexError:
        print(0)

Submission status: Wrong Answer

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

o = '\n'.join([str(A.count(i)) for i in range(1, N+1)])
print(0)#print(o)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np

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

all = np.zeros(n+1)

for j in range(1,n+1):         #Ai
    for i,a_i in enumerate(a):
        if i + 1 < a_i:
            pass
        else:
            if j == a_i:
                all[a_i] += 1

for i in range(1,len(all)):
        print(all[i])

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

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

buka_num = []

for i in range(1,N):
    tmp_A = A[i:]
    buka_num.append(tmp_A.count(i))
    
buka_num.append(0)
print(buka_num, sep='\n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8
n = int(input())
a = input().split()
lis = [0 for i in range(n)]
count = 0

for i in a:
    lis[int(i)] += 1

for i in lis:
    if count == 0:
        count = 1
        continue
    print("{}".format(i))

Submission status: Wrong Answer

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

A_dict = [[i, 0] for i in range(A_max+1)]
A_dict[0][1] = 1
for i in range(N-1):
    A_dict[A[i]][1] += 1

for i in range(len(A_dict)):
    if i == len(A_dict) - 1:
        for j in range(A_dict[i][1]):
            print(0)
    else:
        for j in range(A_dict[i][1]):
            if j == 0:
                print(A_dict[i+1][1])
            else:
                print(0)

Submission status: Wrong Answer

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

A.sort()
if A[0]==0:
    A.remove(0)

l=len(A)
k=0

ans=1

m=max(A)

for i in range(l-1):
    if A[i+1]>A[i]:
        k=A[i]
        print(ans)
        while A[i+1]!=k+1:
            k=k+1
            print(0)
        ans=0
    else:
        ans=ans+1
if A[l-1]==A[l-2]:
    print(ans)
else:
    print(ans+1)
    
   
for j in range(m+1,N+1):
    print(0)

Submission status: Wrong Answer

Solution code:
from itertools import zip_longest
N = int(input())
A = [int(n) for n in input().split()]
o  = {}
for a in A:
    c = o.setdefault(a, 0)
    o[a] += 1
[print(o[k] if idx==k else 0) for idx, k in zip_longest(range(1, N+1), o.keys())]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import bisect

man_count = int(input())

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

infos.sort()

next_num = 0
end = 0
for i in range(len(infos)+1):
    if i != next_num:
        print(0)
        continue
    # 速度を上げるために添え字を吹き飛ばそう。
    # print(infos.count(i+1))
    start = bisect.bisect_right(infos, i+1, end)  # iが始まる添え字を得る。
    # end   = bisect.bisect_left(infos, i+1, start)  # iが終わる添え字を得る。
    print(start - end)
    end = start
    next_num = infos[start-1]
#for i in ans:
#    print(i)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A = list(map(int, input().split()))
L = np.zeros(N)
for x in A:
    L[x-1] =+ 1
for y in L:
    print(int(y))

Submission status: Wrong Answer

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

for ai in A:
    print([(a==ai+1) for a in A].count(True))

Submission status: Wrong Answer

Solution code:
from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=list(map(int,(stdin.readline().strip().split())))
moji=A[0]
count=1
i=0
length=len(A)-1
j=0
sougou=0
while(i!=length):

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

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split(' ')))
S=[]
u=0
for i in range(N-1):
    k=0
    if A[i]==1:
        u=u+1
    if i<N:
        if A[i]!=A[i-1] or i==0:
            for j in range(1,N-i):
                if A[i+j-1]-A[i]==1:
                    k=k+1
                if A[i+j-1]-A[i]==0:
                    continue
                if A[i+j-1]-A[i]!=1:
                    break
    S.append(k)
print(u)
for i in range(len(S)):
    print(S[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
import collections
b=input().split()
c = collections.Counter(b)
c=list(c.values())


for i in range(N) :
	if len(c)>i :
		print(c[i])
	else :
		print('0')

Submission status: Wrong Answer

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

i = 0
for target_val in range(1, n + 1):
    cnt = 0
    while target_val == a_list[min(i, len(a_list) - 1)] and i < len(a_list):
        i += 1
        cnt += 1
    print(cnt)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import collections
member = int(input())
subcount = list(map(int, input().split()))
count = collections.Counter(subcount)
for i in count:
  print(count[i])
for i in range(member - len(count)):
  print(0)

Submission status: Wrong Answer

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

A.sort()
if A[0]==0:
    A.remove(0)

l=len(A)
k=0

ans=1

m=max(A)

for i in range(l-1):
    if A[i+1]>A[i]:
        k=A[i]
        print(ans)
        while A[i+1]!=k+1:
            k=k+1
            print(0)
        ans=0
    else:
        ans=ans+1
ans=ans+1
print(ans)
    
   
for j in range(m+1,N+1):
    print(0)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
a = list(map(int, input().split()))
d = Counter(a)
for i in d:
    print(d[i])
for i in range(n-len(d)):
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections

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

c = collections.Counter(M)

#print(c)

for i in c.values():
    print(i)

for j in range(N-len(c)):
    print("0")

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
import collections
c=collections.Counter(A)
values,counts=zip(*c.most_common())
x=0
for i in range(1,N+1):
    if(i in values):
        print(counts[x])
        x+1
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import math
if __name__ == "__main__":
	n =  int(input())

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

	res = [0]*(n+1)

	count = dict((x,ass.count(x)) for x in set(ass))

	idx = 0
	for i in count:
		res[idx] = count[i]
		idx +=1




	print(res)

Submission status: Wrong Answer

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

boss_list = sorted(boss_list)


for i in range(n):
    boss_num = boss_list.count(i + 1)
    boss_list = boss_list[:boss_num]

    if i == 0:
        boss_num -= 1

    print(boss_num)

Submission status: Wrong Answer

Solution code:
import collections
from collections import Counter
n=int(input())
d=collections.deque()
l=list(map(int,input().split()))
d.extend(l)
d.appendleft(0)
c=dict(Counter(d))
s=set(d)
for x in d:
    if x+1 in s:
        print(c[x+1])
        s.remove(x+1)
    else:print(0)

Submission status: Wrong Answer

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

for i in range(len(A)):
    cnt=0
    for j in range(len(A)):
        if A[i]-A[j]==-1:
            cnt+=1
            continue
    print(cnt)

Submission status: Wrong Answer

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

L = []
for i in range(N-1):
  L.append(0)

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

for j in range(N-1):
  print(L[j])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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)

print(one_a)

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

    # print('iは')
    # print(i)

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

    # buka_list.append(one_a.count('i'))

Submission status: Wrong Answer

Solution code:
import numpy as np

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

b = np.zeros(shape=(n), dtype=np.int)

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

for i in range(n):
  if i == 0:
    continue
  print(b[i])

Submission status: Wrong Answer

Solution code:
import collections
N=int(input())
A=list(map(int,input().split()))
c=collections.Counter(A)
d=c.values()
for i in d:
  print(i)
for j in range(N-len(d)):
  print(0)

Submission status: Wrong Answer

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

from collections import Counter
S=Counter(A)

a=[0]*N
for x, v in S.items():
  a[x] += v

for ans in a:
  print(ans)

Submission status: Wrong Answer

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

d = dict()

for i in range(len(a)):
    if a[i] in d:
        d[a[i]] += 1
    else:
        d[a[i]] = 1

for i in sorted(d.values(), reverse=True):
    print (i)

for i in range(n - len(d)):
    print (0)

Submission status: Wrong Answer

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

for i in range(len(A)):
    cnt=0
    for j in range(len(A)):
        if A[i]-A[j]==-1:
            cnt+=1
            continue
    B.append(cnt)

print(B)

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
A = [0] + A
checked = [0] * N
for i, a in enumerate(A):
    count = 0
    for j in range(i, N):
        if A[j] == a+1 and checked[j] == 0:
            count += 1
            checked[j] = 1
        elif A[j] > a+1:
            break
    print(count)

Submission status: Wrong Answer

Solution code:
import numpy as np

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

all = np.zeros(n+1)

for j in range(1,n+1):
    for i,a_i in enumerate(a):
        if j == a_i:
            all[a_i] += 1
for i in range(len(all)):
    if i >= 1:
        print(all[i])

Submission status: Wrong Answer

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

print(0)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
j=0
c=0
import sys

for i in range(1,n+1):
    while 1:
        if j==n-1:
            
            break
        if i!=a[j]:
            break
        else:
            c+=1
            j+=1
    print(c)
    c=0

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n = int(input())
l = list(map(int, input().split()))
l_uni = np.unique(l)
ans = n - 1
for i in range(n):
  if ans > 0: 
    print(l.count(l_uni[i]))
    ans -= l.count(l_uni[i])
  else:
    print(0)

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

def main():
    N, *A = map(int, read().split())
    ans = [0] * (N + 1)
    print(ans)
    for a in A:
        ans[a] += 1
    ans = list(map(str, ans))
    print('\n'.join(ans[1:]))
    return

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

l = [int(i) for i in input().split()]
c = 1
ans = []
f = 1
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: Wrong Answer

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

boss_dict = [0] * N
for i in range(N - 1):
    boss_num = int(numbers[i])
    boss_dict[boss_num] += 1
    
for boss in boss_dict:
    print(boss)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
D = Counter(A)
for i in D:
    print(D[i])
for i in range(N-len(D)):
    print(0)

Submission status: Wrong Answer

Solution code:
from collections import Counter
a=int(input())
b=input().split()
l=[]
for i in b:
  l.append(int(i))
counter = Counter(l)
la=list(counter.values())
l=[0]*(a-len(la))
lf=la+l
i=0
while i<a:
    print(lf[i])
    i+=1

Submission status: Wrong Answer

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

for ai in A:
    print([(a==ai+1) for a in A].count(True))

Submission status: Wrong Answer

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

n = N-1
for i in range(N):
    if len(A)>0:
        ans =0
        while i+1==A[0]:
            x = A.popleft()
            ans += 1
            n -= 1
            if n ==0:
                break
        print(ans)
    else:
        print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import collections
num = int(input())
line = list(map(int,input().split()))
clist = collections.Counter(line)
for i in range (1,num):
    print(clist[i])

Submission status: Wrong Answer

Solution code:
# coding: utf-8
init = [int(s) for s in input().rstrip().split(' ')]
data = [int(s) for s in input().rstrip().split(' ')]

uniq = list(set(data))
print(uniq)

values = [0] * init[0]
for c in uniq:
    values[c-1] = data.count(c)

for p in values:
    print(p)

Submission status: Wrong Answer

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

b[0] = a.count('1')
for i in range(1, n):
  b[i] = a.count(str(i))