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:
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 = len(A)
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())
li = [int(x) for x in input().split()]
count = 0
for x in set(li):
  print(li.count(x))
  count += 1
for i in range(n-count):
  print(0)

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))
print(yn_num)
for x in sup_num:
  yn_num[x-1] +=1
print(list(yn_num))

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

Submission status: Wrong Answer

Solution code:
from collections import deque
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: Wrong Answer

Solution code:
from collections import deque as dq

n = int(input())
a = dq(int(i) for i in input().split())

for i in range(1, n + 1):
    cnt = 0
    while a:
        if a[0] == i:
            cnt += 1
            a.popleft()
        else:
            break
    print(cnt)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = set(a)
c = n-len(b)
for i in b:
    if i in a:
        num = a.count(i)
        print(num)
    elif not i in a:
        print(0)

ans = '0\n'*c
print(ans)

Submission status: Wrong Answer

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

for i in range(1,N+1):
    print(L[:i].count(i))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
b = dict(Counter(a))
c = list(b.keys())
c.sort()
a.sort()
d = [b[i] for i in c] + [0]
d1 = defaultdict(lambda:-1)
c = [0]+c[:]
for i,j in enumerate(d):
    d1[c[i]] = j
e = defaultdict(lambda: 1)
print(d[0])
for i in range(n-1):
    #print(a[i],d,e)
    if e[a[i]]==1:
        e[a[i]]=0
        print(d1[a[i]])
    else:
        print(0)

Submission status: Wrong Answer

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

C = collections.Counter(t)
ans = [0]*N
for i in range(N):
    ans[i] = C[i+1]
    
print(ans)

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
for i in dc.keys():
  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
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
b = dict(Counter(a))
c = list(b.keys())
c.sort()
d = [b[i] for i in c] + [0]
d1 = defaultdict(lambda:-1)
c = [0]+c[:]
for i,j in enumerate(d):
    d1[c[i]] = j
e = defaultdict(lambda: 1)
print(d[0])
for i in range(n-1):
    #print(a[i],d,e)
    if e[a[i]]==1:
        e[a[i]]=0
        print(d1[a[i]])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
ans = []
for i in range(0,N-1):
    if A[i] != A[i-1]:
        B = A[i]
        ans.append(A.count(B))
    else:
        ans.append(0)
ans.append(0)
ans.sort()
ans.reverse()
for w in ans:
    print(w)

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:
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:
num = int(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
if num == 2:
	print(1)
for i in range(hoge[-1], num):
	print(0)

Submission status: Wrong Answer

Solution code:
import collections

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

c = list(collections.Counter(a).values())
r = c + [0] * (n - len(c))

for i in r:
    print(i)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from collections import Counter

n=int(input())
a=list(map(str,input().split()))
b=Counter(a)
b=list(b.values())

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

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

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
a={}
for i in A:
  if i not in a.keys():
    a.update({i:1})
  else:
    a[i]+=1
b=a.values()
for j in b:
  print(j)
for k in range(N-len(b)):
  print(0)

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)
    p = p + ans
    a.remove(i)
    if p == n-1:
        break
for s in range (n-i):
    print(0)

Submission status: Wrong Answer

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

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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

pre = 1
nums = 1
cnt = 0
top = 1
for jyoushi in jyoushis:
  if top == jyoushi:
    cnt+=1
  else:
    print(cnt)
    if top+1 != jyoushi:
      sabun = jyoushi - top - 1
      for i in range(sabun):
        print(0)
        nums+=1
    top = jyoushi
    cnt = 1
    nums+=1
print(cnt)
if nums < n:
  sabun = n - nums
  for i in range(sabun):
    print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

p = [0] * n

for i in p:
  for j in a:
    if(i == j - 1):
      p[i] += 1

for i in p:
  print(i)

Submission status: Wrong Answer

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

a.sort()
x = a[0]
counter = 1
for i in range(1, n-1):
  if x == a[i]:
    counter += 1
    continue
  else:
    print(counter)
    if x+1 == a[i]:
      x += 1
      counter = 1
    else:
      print(0)
      x += 1
      counter = 1
print(counter)
while x < n:
  print(0)
  x += 1

Submission status: Wrong Answer

Solution code:
import collections

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

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

Submission status: Wrong Answer

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

a.sort()

x = 1
y = []
for i in range(n):
    y.append(0)
    
for j in range(1, n-1):
    if a[j-1] == a[j]:
        x += 1
    else:
        y[a[j-1]-1] = x
        x = 1
        
y[-2] = x

print(' '.join(map(str,y)))

Submission status: Wrong Answer

Solution code:
num = int(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(hoge[-1], num):
	print(0)

Submission status: Wrong Answer

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

s_a = set(a)

dc = {}

for i in s_a:
  dc[int(i)] = a.count(i)
  
index = 1
k = 0
for i in dc.keys():
  print('0\n'*(index - i), end='')
  print(dc[i])
  index += 1
 
print('0\n' * (num-(index-1)), end='')

Submission status: Wrong Answer

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

print('0\n' * (N-k-1))

Submission status: Wrong Answer

Solution code:
import collections
n=int(input())
c=list(map(int,input().split()))
k=n
u=n
c1 = collections.Counter(c)
if len(c1)==len(c):
    while k>1:
        k=k-1
        print(1)
    print(0)
else:
    for i in range(1,n):
        p=(c.count(i))
        print(p)
        k=k-p
        u=u-1
        if k<2:
            break
            while u>0:
                print(0)
                u=u-1

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N
print(li)

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
a=int(input())
l=list(map(int,input().split()))
d=Counter(l)
print(d)
for i in range(1,a+1):
    if i in d:
        print(d[i])
    else:
        print("0")

Submission status: Wrong Answer

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

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

m=[i[1] for i in c2]

for k in m:
    print(k)
        
l=N-len(c)

for j in range(l):
    print("0")

Submission status: Wrong Answer

Solution code:
import numpy as np
import collections

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

all = np.zeros(n+1)

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:
from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
for i in range(1,n+1):
    a.append(i)
a_counter = Counter(a)
for i in a_counter:
    print(a_counter[i]-1)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = [0] * (n)
for i in range(len(a)):
    count[a[i] % n] += 1
count.sort(reverse=True)
for i in range(len(count)):
    print(count[i])

Submission status: Wrong Answer

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

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(1, n+1):
    if len(boss_list) > 0:
        try:
            boss_count = boss_list.index(i + 1)
        except:
            if i in boss_list:
                boss_count = boss_list.count(i)
    else:
        boss_count = 0
    del boss_list[:boss_count]
    print(boss_count)

Submission status: Wrong Answer

Solution code:
from collections import Counter
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = dict(Counter(a))
c = list(b.keys())
c.sort()
d = [b[i] for i in c] + [0]
d1 = defaultdict(lambda:-1)
c = [0]+c[:]
for i,j in enumerate(d):
    d1[c[i]] = j
e = defaultdict(lambda: 1)
print(d[0])
for i in range(n-1):
    if e[a[i]]==1:
        e[a[i]]=0
        print(d1[a[i]])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = [0] * (len(a) + 1)
for i in range(len(a)):
    count[a[i] % n] += 1
count.sort(reverse=True)
for i in range(len(count)):
    print(count[i])

Submission status: Wrong Answer

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




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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = []
A = input().split()
A.sort()

s = []
for i in range(N):
    if i == 0:
        s.append(A.count('1'))
    else:
        if A.count(str(i+1)) == 0:
            s += [0] * (N-i)
            break
        else:
            s.append(A.count(str(i+1)))
for i in s:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
emp = list(map(int,input().split()))
emp.sort()
def rem_val(arr, value):
    while value in arr:
        try:
            arr.remove(value)
        except:
            break
for i in range(N):
    if(len(emp)!=0):
        print(emp.count(i+1))
        rem_val(emp,i+1)
    print(0)

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 range(a-1):
    num[y[i]] += 1
for i in range(a-1):
    print(num[i])

Submission status: Wrong Answer

Solution code:
from collections import Counter
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
b = dict(Counter(a))
c = list(b.keys())
c.sort()
d = [b[i] for i in c] + [0]
d1 = defaultdict(lambda:-1)
c = [0]+c[:]
for i,j in enumerate(d):
    d1[c[i]] = j
e = defaultdict(lambda: 1)
print(d[0])
for i in range(n-1):
    if e[a[i]]==1:
        e[a[i]]=0
        print(d1[a[i]])
    else:
        print(0)

Submission status: Wrong Answer

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

l = len(set(a))

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

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
l = list(map(int, input().split()))
counter = Counter(l)
for i in counter.values():
    print(i)
for i in range(N-len(counter)):
    print(0)

Submission status: Wrong Answer

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

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

for i in range(1, N+1):
    ans = A.count(i)
    if ans > 0:
        print(ans)
    else:
        break
    cnt += 1
print('\n'.join(map(str, [0]*(N-cnt))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for _ in Counter(a).values():
  print(_)

Submission status: Wrong Answer

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

for i in range(1, N):
  print(A[i:].count(i))
print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
n = input()
n = int(n)
array_1 = list(map(int, input().strip().split()))
ans_list=[]
 
for i in range(n):
  ans_list.append(array_1.count(i+1))
  
print(ans_list)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

sum = 0
for i in range(N):
    print(A.count(i+1))
    sum += A.count(i+1)
    if sum == (N-1):
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(input().split())
for i in range(N):
    countA = A.count(str(i+1))
    NN = N-1-countA
    print(countA)
    if NN > 0:
        pass
    else:
        print(0)

Submission status: Wrong Answer

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



A = sorted(A)
con = 0

for i in range(1,M+1):
    con += 1
    print(A.count(i))
    if A.count(i) == 0:
        break
for i in range(con,M):
    print(0)

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

Submission status: Wrong Answer

Solution code:
N=int(input())
Boss=list(map(int, input().split()))
Boss.insert(0, 0)
N_B=[]
for i in range(N):
    if Boss[i] in N_B:
        print("0")
    else:
        print(Boss.count(Boss[i]+1))
        N_B.append(Boss[i])

Submission status: Wrong Answer

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

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(0,s0):
    if s0-f1*j > 1:
        print(f1)
    else:
        print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
num= map(int, input().split())
list1=[]
for x in num:
    list1.append(x)
for i in range(1,N):
    counti=list1.count(i)
    print(counti)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
D = [int(x) for x in input().split()]
D = np.array(D)

for i in range(1, N):
    num = np.sum(D == i+1)
    print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A_List = list(map(int, input().split()))
i_before=1
i_count=0
i_put=0
for i in range(N-1):
  if(i_before==A_List[i]):
    i_count+=1
  else:
    print(i_count)
    i_put+=1
    i_count=1
  i_before=A_List[i]
  if(i==N-2):
    print(i_count)
    i_put+=1

for i in range(N-i_put):
  print('0')

Submission status: Wrong Answer

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

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

bossNums=[]

for i in range(Num):
  bossNums.append(0)


for i in range(Num-1):
  bossNums[bossNumsList[i]-1] += 1

print(bossNums)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
a  = list(input().split())
fact_count = dict(Counter(a))
print(fact_count)
for i in range(1, N+1):
    try:
        print(fact_count[str(i)])
    except:
        print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
import collections

n = int(input())
mentors = input().split(" ")

a = collections.Counter(mentors)
print(a.keys())

for i in range(1, n+1):
    if str(i) in a.keys():
        print(a[str(i)])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
#--management

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

ans = []

ans = [0] * member
print(ans)

for j in range(1,member):
  k = mem_number.count(j)
  ans[j-1] = k

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

Submission status: Wrong Answer

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

B = [0] * N

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

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
    for i in range(len(res)):
  
        print(res[i])

Submission status: Wrong Answer

Solution code:
N=int(input())
a=(input())
sum=0
for i in range(1,N+1):
    b=a.count(str(i))
    sum+=b
    print(b)
    if sum==N:
        for i in range(N-sum):
            print(0)
        break

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)
    total += a
    print(a)
    if total == count - 1:
        print("0\n" * (count - i))
        break

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
D = [int(x) for x in input().split()]
D = np.array(D)
D_unique = np.unique(D)

for i in range(1, N):
    num = np.sum(D == i)
    print(num)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
l = [str(0) for i in range(n)]
key = list(c.keys())
for i in range(len(list(c.keys()))):
    l[key[i]-1] = str(c[i+1])
print('\n'.join(l))

Submission status: Wrong Answer

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

a.sort()
x = a[0]
counter = 1
for i in range(1, n-1):
  if x == a[i]:
    counter += 1
    continue
  else:
    if x+1 == a[i]:
      print(counter)
      x += 1
      counter = 0
    else:
      print(0)
      x += 1
print(counter)

Submission status: Wrong Answer

Solution code:
from collections import deque
N=int(input())
A = deque(list(map(int, input().split())))
for i in range(N):
    ans =0
    while len(A)>0:
        
        if A[0] == i+1:
            A.popleft()
            ans +=1
        else:
            break
    print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
M = N
 
mydict = {}
for i in range(N):
    mydict[i] = 0
 
 
for i in range(len(a)):
    if M-a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1
 
for i in range(M):
    print(mydict[i])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = set(a)
c = len(b)
for i in b:
    if i in a:
        num = a.count(i)
        print(num)
    elif not i in a:
        print(0)

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

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
shainno=1
sougou=0
while(i!=length):
    if moji==A[i+1]:
        count+=1
        i+=1
        j+=1
    else:

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

Submission status: Wrong Answer

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

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

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
p_count=0
for i in range(0,N-1):
    if i==N-2:
        print(count)
        for i in range(0,N-p_count-1):
            print(0)
    elif A[i]!=A[i+1]:
        print(count)
        count=1
        p_count=p_count+1
    else:
        count=count+1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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
shainno=1
sougou=0
while(i!=length):
    if moji==A[i+1]:
        count+=1
        i+=1
        j+=1
    else:

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

Submission status: Wrong Answer

Solution code:
n=int(input())
li=list(map(int,input().split()))
li.sort()
li2=[]
for i in range(len(li)+1):
    li2.append(li.count(i+1))
    if li.count(i+1)==0:
        break
for s in li2:
    print(s)

Submission status: Wrong Answer

Solution code:
import numpy as np
N = int(input())
A_i = list(map(int, input().split()))
uq_A_i = np.array(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 = list(map(int,input().split()))
M = N

mydict = {}
for i in range(N):
    mydict[i] = 0


for i in range(len(a)):
    if a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1

for i in range(M):
    print(mydict[i])

Submission status: Wrong Answer

Solution code:
employeeCount = int(input())
DirectBosses = list(map(int, input().split()))

for em in range(employeeCount):
    directJuniorCount = 0

    # 自分のことを直属の上司だと言う社員は直属の部下
    for bo in DirectBosses:
        if em == bo :
            directJuniorCount += 1

    print(directJuniorCount)

Submission status: Wrong Answer

Solution code:
people = int(input()) - 1
boss = input().split(' ')
boss = list(map(int,boss))
dict_boss = {}
for i in range(people):
	if boss[i]-1 not in dict_boss:
		dict_boss[boss[i]-1] = 1
	else:
		dict_boss[boss[i]-1] += 1
boss = [0] * people
for key in dict_boss:
	boss[key] = dict_boss[key]
for i in boss:
	print(i)

Submission status: Wrong Answer

Solution code:
#--management

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

ans = []

for i in range(member):
  ans.append(0)

print(ans)

for j in range(1,member):
  k = mem_number.count(j)
  ans[j-1] = k

for i in  range(member):
  print(ans[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))
print(0)

Submission status: Wrong Answer

Solution code:
worker_num=int(input())
num_director=input().split()
print(num_director)
count_director=[]
for j in range(len(num_director)+1):
    count_director.append(int(0))

for i in num_director:
    count_director[int(i)-1] +=1

for out in num_director:
    print(out)

Submission status: Wrong Answer

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