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:
import sys
input = sys.stdin.readline
import itertools
def print_ans(N, ar):
    """Test Case
    >>> print_ans(5, [1, 1, 2, 2])
    2
    2
    0
    0
    0
    >>> print_ans(10, [1,1,1,1,1,1,1,1,1])
    9
    0
    0
    0
    0
    0
    0
    0
    0
    0
    >>> print_ans(7, [1,2,3,4,5,6])
    1
    1
    1
    1
    1
    1
    0
    """
    ans_list = [0] * N
    gr = itertools.groupby(ar)
    for key, group in gr:
        ans_list[key-1] = (len(list(group)))
    for ans in ans_list:
        print(ans)
    
    



    
    

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

Submission status: Wrong Answer

Solution code:
N = int(input('')) #input()で入力を受け取ってint()で数字型に変換します。

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)
#subordinate[N-1] = 0

# print(subordinate)
# print(A)

for index in range(N, 1, -1):
    subordinate[A[index]] = subordinate[A[index]] + 1


for index in range(1, N, 1):
    print(subordinate[index])

Submission status: Wrong Answer

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


# for i in range(n):
#     buf_counter = boss_list.count(i + 1)
#     if i == 0:
#         buf_counter -= 1

#     buka_list.append(buf_counter)

# for val in buka_list:
#     print(val)

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

    if i == 0:
        boss_num -= 1

    print(boss_num)

Submission status: Wrong Answer

Solution code:
def funcx(a, i):
    cnt = 0
    for num in a:
        if num == i:
            cnt = cnt + 1
    return cnt


def func(a, i, ptr, n):
    cnt = 0
    # print("xxx", i, ptr)
    while ptr < n and a[ptr] == i:
        ptr = ptr + 1
        cnt = cnt + 1
        # print("yyy", ptr)
    return cnt, ptr


n = int(input())
a = list(map(int, input().split()))
ptr = 0
for i in range(n):
    # print(i+1)
    cnt, ptr = func(a, i + 1, ptr, n - 1)
    print(cnt)

Submission status: Wrong Answer

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

print(A)

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

Submission status: Wrong Answer

Solution code:
N = int(input('')) #input()で入力を受け取ってint()で数字型に変換します。

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)
#subordinate[N-1] = 0

print(subordinate)
print(A)

for index in range(N, 1, -1):
    subordinate[A[index]] = subordinate[A[index]] + 1


for index in range(1, N, 1):
    print(subordinate[index])

Submission status: Wrong Answer

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

nums = 1
cnt = 0
top = 1
for jyoushi in jyoushis:
  if top == jyoushi:
    cnt+=1
  else:
    print(cnt)
    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:
n = int(input())
a = list(map(int,input().split()))

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

Submission status: Wrong Answer

Solution code:
input_line = int(input())
ans = [0] * input_line

inputs = input().split(' ')
inputs = list(map(int, inputs))
for e in inputs:
  for i in range(1, input_line):
    if e == i:
      ans[i] += 1

for i in range(len(ans)):
  print(ans[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())
now = 1
sum = 0
for i in sorted(list(map(int,input().split()))):
    if(now == i):
        sum += 1
    else:
        for j in range(i - now -1):
            print(0)
        print(sum)
        sum = 1
        now = i
else:
    print(sum)
while(now < N):
    print(0)
    now += 1

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A =[int(a) for a in input().split()]
def f():
    d = collections.defaultdict(int)
    for i, e in enumerate(A):
        d[e] += 1
    for key in range(1, N+1):
        print(d[key])

Submission status: Wrong Answer

Solution code:
inon = input().split(" ") #社員表
intw = input().split(" ") #上司リスト
numbuka = list()
num = 0
for e in range(int(inon[0])):
  num = 0
  enumt = e + 1 #探す対象の社員番号
  for i, j in enumerate(intw):
    if int(j) == int(enumt):
      if i < enumt: #部下のIndexより社員番号のほうがでかければ
        num+=1 #数追加
  numbuka.append(num)
for ele in numbuka:
  print(ele)

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    J = sorted(set(A))
    for j in J:
        print(A.count(j))
    print(*[0] * (N - len(J)), sep="\n")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

for i in range(1):
	n=int(input());
	l=list(map(int,input().split()))
	d=dict();
	for j in range(n):
		d[j]=0;
	for j in range(len(l)):
		if(d[j]==0):
			d[j]+=1;
		else:
			d[j]+=1;
	for j in d.values():
		print(j,sep="\n")

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

d = {}

for i in a:
    if not i in d.keys():
        d[i] = 1
        continue
    d[i] += 1

if 1 in d.keys():
    print(d[1])
    d[1] = 0
else:
    print(0)
for j in a:
    if not j+1 in d.keys():
        print(0)
    else:
        print(d[j+1])
        d[j+1] = 0

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

L=len(A)

for i in range(1,N):
    if i in A:
            A.remove(i)
            t=L-len(A)
            L=len(A)
            print(t)
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0, 0] + [int(x) for x in input().split()]

buka = [0] * (N + 1)

for i in range(2, N + 1):
    buka[A[i]] += 1
    print("A[{}] = {}".format(i, A[i]))

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

Submission status: Wrong Answer

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

    print(k)
    k=0

Submission status: Wrong Answer

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

print(A_list.count(1))
for a in range(len(A_list)):
    if a == 0:
        print(A_list.count(A_list[a] + 1))
    else:
        if A_list[a] == A_list[a-1]:
            print(0)
        else:
            print(A_list.count(A_list[a]+1))

Submission status: Wrong Answer

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

for item in c :
	print(item)
	N-=1
for i in range(N) :
	print('0')

Submission status: Wrong Answer

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


buka_list = []

for i in range(n):
    buf_counter = boss_list.count(i + 1)
    if i == 0:
        buf_counter -= 1

    buka_list.append(buf_counter)

for val in buka_list:
    print(val)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

s = list(set(a))
#print(s)

ans = [0] * n
for i in (s):
    ans[i] = a.count(i)

[print(ans[i]) for i in range(n)]

Submission status: Wrong Answer

Solution code:
import collections

def main(N, A):
    c = collections.Counter(A)
    return list(c.values()) + [0 for i in range(N - len(c))]

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    # N = 7
    # A = list(map(int, "1 2 3 4 5 6".split()))
    [print(i) for i in main(N, A)]

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
buka_num=[]
for i in range(1,len(a)):
  buka_num.append(str(a.count(i)))
buka_num.append("0")
joined = "\n".join(buka_num)
print(joined)

Submission status: Wrong Answer

Solution code:
# abc163
n = int(input())
members = list(map(int,input().split()))

for i in range(1,len(members)):
    print(members.count(i))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

ct = Counter(As)

for i in range(n):
	if i in ct.keys():
		print(ct[i])
	else:
		print('0')

Submission status: Wrong Answer

Solution code:
N = int(input())
Mgr = [int(num) for num in input().split()]

current = 1
ans = 0
for i in range(len(Mgr)):
    if(Mgr[i] != current):
        print(ans)
        ans = 1
        current = Mgr[i]
    else:
        ans += 1
        if(i == len(Mgr)-1):
            print(ans)

for j in range(i, N+1):
    print('0')

Submission status: Wrong Answer

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

sub = []
for i in range(1, n):
    x = 0
    for j in a :
        if i == j:
            x += 1
    sub.append(x)
sub.append(0)
print(sub)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    import collections

    C = collections.Counter(A)
    for a, b in C.items():
        print(b)
    for _ in range(N-len(C)):
        print(0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

    print(sum)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans_dict = {}
for a in a_list:
    if not(a in ans_dict):
        ans_dict[a] = 0
    ans_dict[a] += 1

for i in range(1, n+1):
    if not(i in ans_dict):
        print(0)
    else:
        print(ans_dict[a])

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)
print(a_counter)
for i in a_counter:
    print(a_counter[i]-1)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = [int(i) for i in input().split()] 
c = collections.Counter(A)
c = c.most_common()
for i in range(N):
  try:
    tmp = c[i][1]
    print(tmp)
  except:
    print(0)

Submission status: Wrong Answer

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

for i in b:
  print(i-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import Counter


def main():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    count = Counter(A).values()

    for i in count:
        print(i)
    for _ in range(N - len(count)):
        print(0)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# 部下の人数を返す
def get_subordinates(my_number):
    counter = 0
    for i, employee in enumerate(params1):
        if employee == my_number:
            counter += 1
    return counter

param_n = 5
params1 = list(map(lambda x: int(x), input().split(' ')))

for i in range(param_n):
    print(get_subordinates(i + 1))

Submission status: Wrong Answer

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

for ai in A:
    print([(a<ai) for a in A].count(True))

Submission status: Wrong Answer

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

for i in range(n-1):
    print(ali.count(str(i+1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections

def main(N, A):
    c = collections.Counter(A)
    return c.values()

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    # N = 7
    # A = list(map(int, "1 2 3 4 5 6".split()))
    ans = main(N, A)
    [print(i) for i in ans]
    [print(0) for i in range(N - len(ans))]

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
print(A)
for aa in a:
    A[int(aa)-1]+=1
for aaa in A:
    print(aaa)

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

d = Counter(A)
count = 1
for k, v in d.items():
    if count == k:
        print(v)
    else:
        print('0')
    count += 1
zero = N - count + 1
for i in range(zero):
    print('0')

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
A = list(map(int, input().split()))

A_diff = np.diff(A)
#print(A_diff)

a=[0]*N
cnt=1
j=0
for i in range(len(A_diff)):
  if A_diff[i] == 0:
    cnt+=1
    continue
  else:
    a[j] += cnt
    cnt=1
    j+=1
a[j] += cnt

for ans in a:
  print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n=int(input())
a=Counter(list(map(int,input().split())))
a=list(a.values())
dif=n-len(a)
for i in range(dif):
	a.append(0)
for j in a:
	print(j)

Submission status: Wrong Answer

Solution code:
N = int(input())
nums = [int(e) for e in input().split()]
ans = []
count = []
nums.sort()
for i in nums:
    if i in ans:
        count[ans.index(i)] += 1
    else:
        ans.append(i)
        count.append(1)
for i in range(0,N-len(count)):
    count.append(0)
for i in range(0,N):
    print(count[i])

Submission status: Wrong Answer

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

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

d = {}
for i in a:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1 

#print(d)

# output
for key, value in list(d.items()):
    print(value)

for i in range(len(list(d.keys())), n): 
    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 A:
    print(A.count(i+1))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from collections import Counter


def main():
    N = int(input())
    A = list(map(int, input().split()))
    count = Counter(A).values()

    for i in count:
        print(i)
    for _ in range(N - len(count)):
        print(0)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

    import collections

    C = collections.Counter(A)
    print(C[1])
    for a in A:
        try:
            print(C[a+1])
        except:
            print(0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

count = []
temp = a[0]
for i in range(1, len(a)):
    if a[i] == a[i-1]:
        temp += a[i]
    else:
        count.append(temp)
        temp = a[i]

count.append(temp)

for x in count:
    print(len(x))

rest = len(a) - len(count)
for x in range(rest+1):
    print(0)

Submission status: Wrong Answer

Solution code:
print(0)

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
A = list(map(int, input().split()))

A_diff = np.diff(A)
print(A_diff)

a=[0]*N
cnt=1
j=0
for i in range(len(A_diff)):
  if A_diff[i] == 0:
    cnt+=1
    continue
  else:
    a[j] += cnt
    cnt=1
    j+=1
a[j] += cnt

for ans in a:
  print(ans)

Submission status: Wrong Answer

Solution code:
import collections

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

A.insert(0, 0)
c = collections.Counter(A)

key = list(c.keys())
value = list(c.values())
key.append(key[-1]+1)
value.append(0)

for i in range(N):
    print(value[key.index(A[i])+1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

S = [0] * N

for i in A:
    S[i] += 1 

for s in S[1:]:
    print(s)

Submission status: Wrong Answer

Solution code:
N = int(input())

A = list(map(int, input().split(' ')))
A_set = set(A)
zeros = N - len(set(A))

for a in A_set:
  print(A.count(a))
  
print('0\n'*zeros)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
 
r = int(input())
print(2*r*math.pi)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = []
for i in B.keys():
  C.append((i,B[i]))
C.sort()
#print(C)
a = 0
for j in range(len(C)):
    print(C[j][1])
    a += 1
for l in range(N-a):
  print(0)

Submission status: Wrong Answer

Solution code:
#整数の入力
N = int(input())
#スペース区切りの整数の入力リスト
A_list = list(map(int, input().split()))

ans = 0
for i in range(len(A_list)):
  ans = A_list.count(i+1)
  print(ans)

Submission status: Wrong Answer

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

    import collections

    C = collections.Counter(A)
    for a in A:
        try:
            print(C[a+1])
        except:
            print(0)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import numpy as np
from collections import defaultdict
from math import gcd
import time
import sys
from collections import Counter
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


start = time.time()
N = int(input())
A = input().split(' ')
c = Counter(A)
print(c)
for i in range(1, N+1):
    if str(i) in c:
        print(c[str(i)])
    else:
        print(0)

Submission status: Wrong Answer

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

l = [0]*n
for i in range(n-1):
  l[a[i]] += 1
  
print(*l[1:], sep = '\n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
s = input().split(" ")
A = []
d = {}
for w in s:
    A.append(int(w))
    if w in d.keys():
        d[w] += 1
    else:
        d[w] = 1

for n in range(N):
    if str(n + 1) in d.keys():
        print(d[w])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split()]
del a[n:len(a)-1]
print(a)
for i in range(n):
    count = 0
    for j in a:
        if i+1 == j:
            count += 1
    print(count)

Submission status: Wrong Answer

Solution code:
n=int(input())
li=[int(x) for x in input().split()]
d={}
for i in range(len(li)):
	if li[i] in d:
		d[li[i]]+=1
	else:
		d[li[i]]=1
c=0
for u,v in d.items():
	print(v)
	c+=1

while c<n:
	print(0)
	c+=1

Submission status: Wrong Answer

Solution code:
n = int(input())

data = input().split()
jousi = [int(s) for s in data]

buka = [0]*n

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

for i in buka:
  print(i)

Submission status: Wrong Answer

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

for i in range(n-1):
    if a[i] in b:
        b[a[i]]+=1
    else:
        b[a[i]]=1
c=0
for i in b.values():
    c+=1
    print(i)
if n-c>0:
    for i in range(n-c):
        print(0)

Submission status: Wrong Answer

Solution code:
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    N = ii()
    A = il()
    J = sorted(set(A))
    ret = {}
    for j in J:
        ret[j - 1] = A.count(j)
    print(*ret.values(), sep="\n")
    print(*[0] * (N - len(J)), sep="\n")


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[0]*n
for i in input().split(" "):
    a[int(i)-1]+=1
print(a)

Submission status: Wrong Answer

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

countzumi=[]
count_=[0]*N

for i in range(len(A_)):
	count_[A[i]-1]=A.count(A_[i])

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

Submission status: Wrong Answer

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

buka_num = []

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

print(buka_num, sep='¥n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

buka = [0]*(int(n))

for i in list:
    buka[i-1] += 1
for j in buka:
    print(buka[j])

Submission status: Wrong Answer

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

for i in range(num):
  count = 0
  for j in hoge:
    if j == i:
      count += 1
  print(count)

Submission status: Wrong Answer

Solution code:
import bisect

n = int(input())
a = list(map(int, input().split()))
for i in range(1, n + 1):
    bisleft = bisect.bisect_left(a, i)
    bisright = bisect.bisect_right(a, i)
    print(bisright - bisleft)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
li = [0 for i in range(N)]

for i in range(len(A)):
    li[A[i]] += 1
for i in range(1, len(li)):
    print(li[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in B:
	print(i)

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

d = Counter(A)
zero = N - len(d)
for k, v in d.items():
    print(v)
for i in range(zero):
    print('0')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(n):
  cnt = (a_lst.count(i+1))
  res_lst.append(cnt)

print(res_lst)

Submission status: Wrong Answer

Solution code:
import collections
n = int(input())
a = list(map(int, input().split()))
c = collections.Counter(a)
for ret in c.values():
    print(ret)
print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

N = [0]*n
for a in A:
  N[a] += 1

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

Submission status: Wrong Answer

Solution code:
import numpy as np
N=int(input())
A=[int(x) for x in input().split()]

# X=np.zeros(2e5)
X=[0]*200000
for i in range(N-1):
    tmp=A[i]
    X[tmp]+=1
print(X[1:N+1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import Counter

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

d = Counter(A)
zero = N - len(d)
print(d)
for k, v in d.items():
    print(v)
for i in range(zero):
    print('0')

Submission status: Wrong Answer

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

inf_list = []
for i in range(1, n+1):
  inf_count = a_list.count(i)
  inf_list.append(inf_count)

print(inf_list)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

import collections
c = collections.Counter(a)

print(c[1])
for i in range(n-1):
    num = a[i]
    print(c[num+1])