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

dict={}
dict[N]=0
base=list(set(A))
base=sorted(base)
base.append(N)

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[base[base.index(a)+1]])
    dict[base[base.index(a)+1]]=0

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
print(B)
for i in range(1,N):
   print(B[i])
print('0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(x) for x in input().split()]
for c in range(n-1):
    s=0
    for d in range(c,n-1):
        if a[d]==c+1:
            s+=1
    print(s)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
A = [int(elem) for elem in input().split()]
count = [0]*N
for i in A:
  count[i-1] = count[i-1]+1
  [print (i) for i in count]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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(len(ad)):
  print(ad[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import deque

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

q = deque()
c = a_list.count(1)
print(c)
q.append(1)

while len(q) > 0:
    a = q.popleft()
    c_buka = a_list.count(a+1)
    if c_buka > 0:q.append(a+1)
    print(c_buka)
    for i in range(c-1):
        print(0)
    c = c_buka

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
a = [0] + a
cnt = defaultdict(lambda :0)

for i in a:
    cnt[i - 1] += 1

for i in a:
    print(cnt[i])
    cnt[i] = 0

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

for i in range(1, n + 1):
    ls2 = ls[i:]
    c = ls2.count(i)
    print(c)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
start=0
last=A[N-2]
if(last!=1):
    for i in range(1,last):
        c=0
        for j in range(start,N-1):
            if(A[j]==i):
                c+=1
            else:
                print(c)
                start=j
                break
    print(A.count(last))
    for i in range(N-last):
        print(0)

else:
    print(N-1)
    for i in range(N-1):
        print(0)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = input().split()
clist = collections.Counter(A)
for i in range(1,N):
  j = str(i)
  print(clist['i'])

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = input().split()
clist = collections.Counter(A)
for i in range(1,N):
  print(clist['i'])

Submission status: Wrong Answer

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

for i in a:
  buka_num[i]+=1
buka_num.pop(0)
buka_num.append(0)
for j in buka_num:
  print(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
a = [0] + a
cnt = defaultdict(lambda :0)

for i in a:
    cnt[i - 1] += 1

for i in a:
    print(cnt[i - 1])
    cnt[i - 1] = 0

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num = [0] * n
for i in range(0,n):
    num[i-1] += 1
print(num[i])

Submission status: Wrong Answer

Solution code:
from numpy.core.defchararray import count

n = int(input())

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

a.insert(0,1)

s = a.count(1) - 1
print(s)

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

Submission status: Wrong Answer

Solution code:
num = int(input())
li = list(int(x) for x in input().split())
li2 = [0] * num
num = len(li)
for i in li:
  li2[i - 1] = li2[i - 1] + 1
for j in range(num):
  print(li2[j])

Submission status: Wrong Answer

Solution code:
num = int(input())
li = list(int(x) for x in input().split())
li2 = [0] * num
num = len(li)
for i in li:
  li2[i - 1] = li2[i - 1] + i
for j in range(num):
  print(li2[j])

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
Col2 = sorted(Col.items())
CountList = []
for i in Col2:
    CountList.append(i[1])

for i in range(n-len(CountList)):
    CountList.append(0)

for i in CountList:
    print(i)

Submission status: Wrong Answer

Solution code:
from collections import deque

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

q = deque()
q.append(0)

while len(q) > 0:
    a = q.popleft()
    count = a_list.count(a+1)
    if count > 0:q.append(a+1)
    print(count)
    for i in range(a_list.count(a)-1):
        print(0)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
Col2 = sorted(Col.items())
CountList = []
for i in Col2:
    CountList.append(i[1])
#CountList = list(Col2.values()) 
for i in range(n-len(CountList)):
    CountList.append(0)

for i in CountList:
    print(i)

Submission status: Wrong Answer

Solution code:
from collections import Counter

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))

    cntA = Counter(A)

    keys = sorted(cntA.keys(), reverse=True)

    if len(keys) == 1:
        print(N - 1)
        [print(0) for _ in range(N - 1)]
        exit()

    maxkey = max(keys)
    acm_cntA = [0 for _ in range(len(keys) + 1)]

    for i, key in enumerate(keys):
        acm_cntA[i + 1] = cntA[key] + acm_cntA[i]

    for a in A:
        if a == maxkey:
            print(0)
        else:
            print(acm_cntA[keys.index(a)])
    print(0)

Submission status: Wrong Answer

Solution code:
import collections
member = int(input())
subcount = list(map(int, input().split()))
count = dict(collections.Counter(subcount))
for i in sorted(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()))
import numpy as np
C=np.zeros(N) #output
for j in range(1,N):  #j=direct boss
    for i in range(0,N-1):
        if A[i]==j:
            C[j-1]=C[j-1]+1
for i in C:
    print(i)

Submission status: Wrong Answer

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

l.append(a.count(1))
for i in range(len(a)):
    if i==0:
        x=a.count(a[i]+1)
        l.append(x)
    else:
        if a[i-1]!=a[i]:
            x=a.count(a[i]+1)
            l.append(x)
        else:
            l.append(0)
for i in range(N):
    print(l[i])

Submission status: Wrong Answer

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

Solution code:
import collections
import numpy as np

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

zero = np.zeros(n+1)
c = collections.Counter(a)

for val,key in c.items():
    zero[val] = key

for i in range(len(zero)):
    if i > 0:
        print(zero[i])

Submission status: Wrong Answer

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

l.append(a.count(1))
for i in range(len(a)):
    if i==0:
        x=a.count(a[i]+1)
        l.append(x)
    else:
        if a[i-1]!=a[i-1]:
            x=a.count(a[i]+1)
            l.append(x)
        else:
            l.append(0)
for i in range(N):
    print(l[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

sub_list = [0] *n

for a in A:
  sub_list[a] +=1

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

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
List = list(map(int, input().split()))
Col = collections.Counter(List)
CountList = list(Col.values()) 
for i in range(n-len(CountList)):
    CountList.append(0)

for i in CountList:
    print(i)

Submission status: Wrong Answer

Solution code:
import collections


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

c = collections.Counter(a)

for ans in c.values():
    print(ans)
o = len(c)

for i in range(n-o):
    print(0)

Submission status: Wrong Answer

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

b = [0] * n

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

Submission status: Wrong Answer

Solution code:
import collections

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)

for i in CountList:
    print(i)

Submission status: Wrong Answer

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):
    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)
            ansindex += 1
for i in range(N-len(ansarray)):
    ansarray.append("0")
for i in range(N):
    print(ansarray[i])

Submission status: Wrong Answer

Solution code:
n=int(input())
arr=[int(x) for x in input().split()]
count=[0]*(n+1)
for i in arr:
  count[i]+=1
for i in count:
  print(count)

Submission status: Wrong Answer

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

boss = 1
li = []

k = 0
for i in a:
    if i == boss:
        k += 1
li.append(k)
del(k)

for i in a:
    k = 0
    for j in a:
        if j > i:
            k += 1
    li.append(k)

for sth in li:
    print(sth)

Submission status: Wrong Answer

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

for i in lst:
    ans[i-1] += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
master = 0
masterA = []

while cnt2 < N-1:
    if A[cnt2] == 1:
        master = master + 1
    cnt2 = cnt2 + 1

masterA.append(master)
cnt2 = 0
master = 0

while cnt1 < N-1:
    while cnt2 < N-1:
        if A[cnt1] < A[cnt2] and (A[cnt1]-A[cnt2] == 1):
            master = master + 1
        cnt2 = cnt2 + 1
    masterA.append(master)
    master = 0
    cnt2 = 0
    cnt1 = cnt1 + 1

for i in masterA:
    print(i)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(4100000)
input = sys.stdin.readline
N = int(input()) #社員数
joushi_no_bangou = [0] #上司の社員番号
ans = []
joushi_no_bangou += map(int,input().split())
# print(joushi_no_bangou.count(i+1))
print(*joushi_no_bangou,sep='\n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s = [input() for i in range(2)] 
li = list(map(int, s[1].split()))
s0 = int(s[0])
f1 = 0
for i in li:
    if i == 1:
        f1 += i
for j in range(1,s0+1):
    if s0-f1*j > 0:
        print(f1)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
n= int(input())

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

Submission status: Wrong Answer

Solution code:
r=int(input())
print(r*2*3.1415)

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
base = input().split()
x = []
for i in base:
    x.append(int(i))
#x.sort(reverse = False)
c = collections.Counter(x)
for i in range(1,n):
    print(c[i])

Submission status: Wrong Answer

Solution code:
N = int(input())
Ai = [int(x) for x in input().split()]
for i in Ai:
    print(Ai.count(i))

Submission status: Wrong Answer

Solution code:
x=int(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: Wrong Answer

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

Submission status: Wrong Answer

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):
    if len(c) > current:
        if e[current] == str(i + 1):
            print(d[current])
            
            current += 1
        else:
            print('0')
            
    else:
        print('0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1

print(A.count(count))

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
li = [int(x) for x in input().split()]
d = Counter(li)
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())
l = list(map(int, input().split()))
l.sort()
distinct_list = set(l)
count_list = []
count = int(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: Wrong Answer

Solution code:
n=int(input())
c=list(map(int,input().split()))
l=0
h=n
for i in range(1,n+1):
    for j in c:
        if i==j:
            l+=1
        else:
            print(l)
            h=h-1
            while l>0:
                c.pop(0)
                l=l-1
            l=0
            break
while h>0:
    print(0)
    h=h-1

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[]
for i in range(1,n+1):
  if a.count(i)>0:
    print(a.count(i))
    exit()
    l.append(a.count(i))
x=n-len(l)
y='0'*x
m=list(str(y))
n='\n'.join(m)
print(n)

Submission status: Wrong Answer

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

a[0:0] = [0, 0]

if n%2==0:
    plus = 0
else :
    plus = 1

for i in range(1, len(a)):
    count = 0
    tmp = a[i]
    tmp2 = a[i]
    first = True
    for j in range(i+1, len(a)):
        if tmp < a[j] and first:
            first = False
            tmp2 = a[j]
            count += 1
        elif tmp < a[j] and tmp2 == a[j]:
            count +=1
        elif tmp == a[j]:
            i += 1
        else:
            i += j
            break

    print(count)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
master = 0
masterA = []

while cnt2 < N-1:
    if 0 < A[cnt2]:
        master = master + 1
    cnt2 = cnt2 + 1

masterA.append(master)
cnt2 = 0
master = 0

while cnt1 < N-1:
    while cnt2 < N-1:
        if A[cnt1] < A[cnt2]:
            master = master + 1
        cnt2 = cnt2 + 1
    masterA.append(master)
    master = 0
    cnt2 = 0
    cnt1 = cnt1 + 1

for i in masterA:
    print(i)

Submission status: Wrong Answer

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

count = 1

print(A.count(count))

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

Submission status: Wrong Answer

Solution code:
num = int(input())
l_a = input().split()
s_a = set(l_a)

dc = {}

l_s = []
for i in s_a:
  dc[i] = l_a[int(i)-1:].count(i)
  
index = 1
k = 0
l_key = sorted(dc.keys())

for i in l_key:
  while int(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:
n = int(input())
a = input().split()

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(x) for x in input().split()]
d={}
for i in range(n-1):
    if a[i] in d:d[a[i]]+=1
    else:d[a[i]]=1
c=[i for i in d.values()]
for i in range(len(c)):print(c[i])
for i in range(n-len(c)):print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
A.sort()
a = [0]
for i in range(len(A)-1):
    if A[i] != A[i+1]:
        a.append(i+1)
a.append(N-1)
# print(a)

for i in range(N):
    if i >= len(a)-1:
        print(0)
    else:
        ans = a[i+1]-a[i]
        print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
master = 0
masterA = []

while cnt2 < N-1:
    if 0 < A[cnt2]:
        master = master + 1
    cnt2 = cnt2 + 1

masterA.append(master)
cnt2 = 0
master = 0

while cnt1 < N-1:
    while cnt2 < N-1:
        if A[cnt1] < A[cnt2]:
            master = master + 1
        cnt2 = cnt2 + 1
    masterA.append(master)
    master = 0
    cnt2 = 0
    cnt1 = cnt1 + 1

print(masterA)

for i in masterA:
    print(i)

Submission status: Wrong Answer

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

for i in list(set(a)):
    ans = a.count(i)
    print(ans)
    a = [s for s in a if s != i]
    p = p + ans
    if p == n-1:
        break
for s in range (n-i):
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
li = [int(x) for x in input().split()]
d = Counter(li)
count = 0
for i in d:
  print(d[i])
  count += 1
for i in range(n-count):
  print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(len(A)):
  print(A.count(str(i)))

Submission status: Wrong Answer

Solution code:
import collections

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

c = sorted(collections.Counter(a).items())

for i in c:
    print(i[1])

for _ in range(n - len(c)):
    print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
input = stdin.readline
N=int(input())
A = list(map(int, input().split()))
for n in range(N):
    print(A.count(str(n+2)))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
new=[0]*n 
i,j,k=0,0,0 
while(i<n-1):
    c=0
    j=i 
    while(j<n-1):
        if(a[i]==a[j]):
            c+=1
        else:
            break
        j+=1 
    i=j
    new[k]=c 
    k+=1 
for i in range(n):
    print(new[i])

Submission status: Wrong Answer

Solution code:
def count(list, num):
    length = len(list)
    if num in list:
        first = list.index(num)
        counts = 0
        idx = first
        while True:
            if idx < length:
                if list[idx] == num:
                    counts += 1
                    idx += 1
                else:
                    return counts
            else:
                return counts
    else:
        return 0


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

a = 0
num = 0
while True:
    print(count(A_list, a+1))
    co = count(A_list, a+1) - 1
    for i in range(co):
        print(0)
    a += 1
    if a > A_list[-1]:
        break

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
A = list(map(int,input().split()))
M = [A.count(x) for x in range(1,N)]
print('\n'.join(map(str,M)))

Submission status: Wrong Answer

Solution code:

n = int(input())
a = list(int(i) for i in input().split())
lst = [0] * (n + 1)

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

for i in range(1, n):
    print(lst[i])

Submission status: Wrong Answer

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

Solution code:
num = int(input())
l_a = input().split()
s_a = set(l_a)

dc = {}

l_s = []
for i in s_a:
  dc[i] = l_a[:(int(i)+1)].count(i)
  
index = 1
k = 0
l_key = sorted(dc.keys())

for i in l_key:
  while int(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:
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):
    if len(c) > i:
        if e[current] == str(i + 1):
            print(d[i])
            current += 1
        else:
            print('0')
    else:
        print('0')

Submission status: Wrong Answer

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

for i in lst:
    ans[i] += 1
ans.remove(0)
ans.append(0)
print(ans)

Submission status: Wrong Answer

Solution code:

n = int(input())
a = list(int(i) for i in input().split())
l = [0] * (n - 1)

for i in a:
    l[i - 1] += 1

for i in l:
    print(i)

Submission status: Wrong Answer

Solution code:
N = int(input())
A_i = list(map(int, input().split()))
num = 1
while num < N:
    print(A_i.count(num))
    num += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(0,len(member) - 1):
  if member[0] == 1 and member.count(member[0]) == len(member):
    for j in range(0, len(member)):
      	sub.append(0)
    break
  else:
    sub.append(member.count(member[i] + 1))
    
sub.insert(0,member.count(1))
sub.append(0)

for k in range(0, len(sub)):
	print(sub[k])

Submission status: Wrong Answer

Solution code:
from collections import deque as dq

n = int(input())
a = dq(int(i) for i in input().split())
l = [0] * (n - 1)

for i in a:
    l[i - 1] += 1

for i in l:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
num = int(input())
l_a = input().split()
s_a = set(l_a)

dc = {}

l_s = []
for i in s_a:
  dc[i] = l_a.count(i)
  
index = 1
k = 0
l_key = sorted(dc.keys())

for i in l_key:
  while int(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:
from collections import Counter


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

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

Submission status: Wrong Answer

Solution code:
from collections import deque as dq

n = int(input())
a = dq(int(i) for i in input().split())
l = [0] * n

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

for i in l:
    print(i)

Submission status: Wrong Answer

Solution code:
def find_first_duplicate(nums):
    num_set = set()
    no_duplicate = 0

    for i in range(len(nums)):

        if nums[i] in num_set:
            return nums[i]
        else:
            num_set.add(nums[i])

    return no_duplicate


N = int(input())
A = [int(x) for x in input().split()]
A = list(sorted(A))
i = N
while i > 0:
    if len(A) > 0:
        b = find_first_duplicate(A)
        print(A.count(b))
        if b in A:
            A.remove(b)
    else:
        print(0)
    i = i - 1

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
cnt1 = 0
cnt2 = 0
master = 0
masterA = []

while cnt1 < N-1:
    while cnt2 < N-1:
        if A[cnt1] < A[cnt2]:
            master = master + 1
        cnt2 = cnt2 + 1
    masterA.append(master)
    master = 0
    cnt2 = 0
    cnt1 = cnt1 + 1

masterA.append(0)

for i in masterA:
    print(i)

Submission status: Wrong Answer

Solution code:
from sys import stdin
input = stdin.readline
N=int(input())
A = list(map(int, input().split()))
for n in range(N):
    print(A.count(str(n-1)))

Submission status: Wrong Answer

Solution code:
import numpy as np

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num,dtype=np.int16))
print(yn_num)
for x in sup_num:
  yn_num[x-1] +=1
print(list(yn_num))

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 in An[start_index:]:
    #         if n >= an:
    #             if len(NUM) > 0:
    #                 count += 1
    #                 start_index += 1
    #                 NUM = An[start_index:]
    #             # print(n, an, NUM)
    #     counter.append(count)
    #     # out.append(count)
        
    #     # print('counter:', counter, 'out:', out)
        
    # # print('counter:', counter)
    
    counter = []
    count = 0
    start_index = 0
    
    for n in range(1, N+1):
        an = An[start_index:]
        for a in an:
            a -= n
            if a == 0:
                count += 1        
        counter.append(count)
        count = 0
                
        
        
        
        
    
    
    for i in counter:
        print(i)
            


    
main()