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())
w=list(map(int,input().split()))
a=[0]*(n)

for i in range(n-1):
    a[w[i]-1]+=1

for j in range(n):
    print(a)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# import math
# import statistics
a=int(input())
#b,c=int(input()),int(input())
# c=[]
# for i in a:
#    c.append(i)
# e1,e2 = map(int,input().split())
f = list(map(int,input().split()))
#g = [input() for _ in range(a)]

f.sort()
count=1
ans=[0 for i in range(len(f))]

for i in range(len(f)-1):
    if f[i]==f[i+1]:
        count+=1
    else:
        ans[f[i]-1]=count
        count=1
if count>1:
    ans[f[-1]-1]=count
for i in ans:
    print(i)

Submission status: Wrong Answer

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

sub= [0 for i in range(N)] # Number of sub of No. i
for i in range(N-1):
  for j in range(N):
    if(A[i]-1 == j):
      sub[j] += 1
print(sub)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

for x in range(1,n):
  print(p.count(x))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split())) # <- note that this has (N - 1) elements
print(A)
A_0 = [x - 1 for x in A]
print(A_0)
ans = [0] * N # <- represents number of immediate subordinates of each person

for i in range(0, N - 1):
    ans[A_0[i]] += 1

for i in range(0, N):
    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(1,n+1):
  b[i-1]=a.count(i)
for i in b:
  print(b)

Submission status: Wrong Answer

Solution code:
import heapq
import bisect

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

heapq.heapify(a)
for i in range(n):
    l = bisect.bisect_right(a, i+1)
    r = bisect.bisect_left(a, i+1)
    print(l-r)

Submission status: Wrong Answer

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


A.sort()
A.append(N + 1)
ans = [0] * (N+1)
count = [0, 0]

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

print(ans[1:N+1])

Submission status: Wrong Answer

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

member_list = [0]*N
for rel in rel_list:
    member_list[rel-1] += 1

print([i for i in member_list])

Submission status: Wrong Answer

Solution code:
import bisect
N = int(input())
A = [int(x) for x in input().split()]
index = 0
for i in range(1, N+1):
    now = bisect.bisect_right(A, i)
    print(now - index)
    index = now

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

import bisect

for i in range(1,N+1):
    print(bisect.bisect_right(A,i)-bisect.bisect_left(A,i))

Submission status: Wrong Answer

Solution code:
N=int(input())

list=list(map(float,input().split()))

max(list)

for i in range(1,int(max(list))+1):
	print(list.count(float(i)))

for i in range(N-int(max(list))-1):
	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):
    if a[i] > 0:
        l[a[i] - 1] += 1

for i in range(n - 1):
    print(l[i])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, A: "List[int]"):
    c = collections.Counter(A+[i+1 for i in range(N)])
    return "\n".join([str(v-1) for v in c.values()])


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N - 2 + 1)]  # type: "List[int]"
    print(solve(N, A))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

m = Counter(a)

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

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
ls = list(map(int,input().split()))
count = collections.Counter(ls)
for i in range(1,N+1):
    if i in count.items():
        print(count[i])
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
ls = list(map(int,input().split()))
count = collections.Counter(ls)
for i in count.values():
    print(i)
print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = list(range(1,N+1)) + list(map(int, input().split())) 
c = collections.Counter(A)
values, counts = zip(*c.most_common())

for i in range(len(counts)):
    print(counts[i]-1)

Submission status: Wrong Answer

Solution code:
import collections
N = int(input())
A = list(map(int, input().split())) + list(range(1,N+1))
c = collections.Counter(A)
values, counts = zip(*c.most_common())

for i in range(len(counts)):
    print(counts[i]-1)

Submission status: Wrong Answer

Solution code:
import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
A = list(map(int,input().split()))
countstop = False
for i in range(N+1)[1:]:
	if countstop:
		print(0)
		continue
	ni = A[i+1:].count(i)
	print(ni)
	N = N - ni
	if N == 1:
		countstop = True

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
s=int(input())
e_list=list(map(int,input().split()))
 
m_list=[]
for i in range(1,s):
  a=e_list.count(i)
  m_list.append(a)

for j in m_list:
 print(m_list[s-2-j])

Submission status: Wrong Answer

Solution code:
import collections 

n = int(input())
a = list(map(int, 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()))
b=list(set(a))
for i in range(1,n+1):
  if i in b:
    print(0)
  else:
    print(a.count(i))

Submission status: Wrong Answer

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

for i in range(n-1):
    print(len(list(a & set([i+1]))))

print(0)

Submission status: Wrong Answer

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

man=1
cnt=0
man_list=[0]*N
A += [0]

for a in A:
  if a != man:
    man_list[man-1] = cnt
    man = a
    cnt=0
  cnt+=1

for l in man_list:
  print(l)

Submission status: Wrong Answer

Solution code:
def main():
  n = int(input())
  A = list(map(int, input().split()))
  
  num = [0] * n
  
  for i in range(0, n-1):
    for k in range(0, len(A)):
      if A[k] == i+1:
        num[i] += 1
      
  print(num)
  
main()

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:

def main():
    n = int(input())
    a = list(map(int, input().split(' ')))
    buka = [0]*n
    print(a)

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

    for i in buka:
        print(i)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

ans = [0]*num
print(ans)
print(indexes)

for i in range(num-1):
  ans[indexes[i]-1] +=1
print(ans)

Submission status: Wrong Answer

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

ans = [0]*n
for a in A:
  ans[a-1]+=1
print(ans)

Submission status: Wrong Answer

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

for i in range(len(A)):
    worker[A[i] - 1] += 1
    print(worker)

for i in worker:
    print(i)

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] += 1

print(l)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

num.sort()
cnt = 0
work = 0
sum = 0
flg = 0
for i in num:
  if work != i:
    if work != 0:
      print(cnt)
      sum += 1
    cnt = 1
    mae = work + 1
    work = i
    if mae != work:
      for i in range(mae,work):
        print(0)
  elif work == i:
    cnt += 1
  

print(cnt)
sum += 1
sum = int(n) - sum
for i in range(sum):
  print(0)

Submission status: Wrong Answer

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

num.sort()
cnt = 0
work = 0
sum = 0
flg = 0
for i in num:
  if work != i:
    if work != 0:
      print(cnt)
      sum += 1
    cnt = 1
    work += 1
  elif work == i:
    cnt += 1

print(cnt)
sum += 1
sum = int(n) - sum
for i in range(sum):
  print(0)

Submission status: Wrong Answer

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

cnt = 0
work = 0
sum = 0
flg = 0
for i in num:
  if work != i:
    if work != 0:
      print(cnt)
      sum += 1
    cnt = 1
    work += 1
  elif work == i:
    cnt += 1

print(cnt)
sum += 1
sum = int(n) - sum
for i in range(sum):
  print(0)

Submission status: Wrong Answer

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

s=0
for i in a:
    print(a.count(s+1))
    s+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [0]
A += list(map(int, input().split(' ')))
last_time = -1
for a in A:
    if a != last_time:
        print(A.count(a + 1))
        last_time = a
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split(' ')))
A.insert(0, 0)
last_time = -1
for a in A:
    if a != last_time:
        print(A.count(a + 1))
        last_time = a
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
l=[0]*(n+1)
check=[False]*(n+1)

for i in a:
  l[i]+=1
print(l[1])
for i in a:
  if check[i+1]:
    print(0)
  else:  
    print(l[i+1])
    check[i+1]=True

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def main():
  N = int(input())
  A = [int(x) for x in input().split()]
  
  B = [0] * N    
  for i in range(N-1):
      B[A[N-i-2]] += 1
  
  for i in range(N):
    print(B[i])
    
if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(N+1):
  print(M.count(i))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
s = list(map(int, input().split()))
t = []
cnt = 2
for a in s:
  try:
    t[a-1].append(cnt)
  except IndexError:
    for _ in range(a-len(t)):
      t.append([])
      t[-1].append(cnt)
for i in range(len(t)):
  print(len(t[i]))
for _ in range(n-len(t)):
  print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(1, n + 1):
    b = a.count(i)
    if b > 0:
        a = a[a.index(i):]
    if b == 0:
        print('0\n' * (n-i+1))
        break
    else:
        print(b)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
count = []
for i in range(1, n+ 1):
    if len(count) >= 1:
        count.append(0)
    else:
        
        count.append(a.count(i))
        a = a[a.index(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()))
for i in range(n):
  print(a.count(i))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

k = 0
j = 1
cnt = 0
for i in range(n):
    if i == n-1:

        print(cnt)
        for _ in range(n - j):
            print(0)
    elif j == l[i]:
        cnt += 1
    elif l[i] - j >= 1:
        print(cnt)
        cnt = 1
        a = l[i] - j
        for _ in range(a-1):
            print(0)
        j += l[i] -j

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

n = int(readline())
a = list(map(int, readline().split()))
l = [0]*n
for i in a:
    l[i - 1] += 1
print(l, sep="/n")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
values = list(map(int, input().split()))
values_dict = {}

for value in values:
    values_dict[value] = values_dict.get(value, 0) + 1

print(values_dict.get(i, 0) for i in range(1, N+1))

Submission status: Wrong Answer

Solution code:
N = int(input())

a = list(map(int, input().split()))
anslst = [0]*(N-1)

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

for ans in anslst:
  print(ans)

Submission status: Wrong Answer

Solution code:
#n, m, q = map(int, input().split())
#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]
#print(ans[j], end = "") 改行無しで出力
#ans = [0]*n
n = int(input())
a = list(map(int, input().split()))
print(a)
ans = [0]*n

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

for j in ans:
    print(j)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for i in range(1,N):
    print(sum(x == i for x in A))

Submission status: Wrong Answer

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

ans = [A.count(j) for j in range(1, N)]
ans.append(0)
print(ans)

for k in range(N):
    print(ans[k])

Submission status: Wrong Answer

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

ans = [0]*n
counter = 0
for i in range(n):
    ans[a[i-1]] += 1

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

Submission status: Wrong Answer

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

ans = [0]*n
a.sort()
a = collections.deque(a)
counter = 0
tem = a[0]
for i in range(1, n+1):
    while i == tem and len(a) != 0:
        tem = a.popleft()
        if i != tem: 
            break
        counter += 1    
    print(counter)
    counter = 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:
N = int(input())
A = [0]
B = list(map(int, input().split()))
A += B
#print(A)

sig = [0] * N

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

#print(sig)
for i in sig:
  print(i)

Submission status: Wrong Answer

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

sig = [0] * N

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

print(sig)
for i in sig:
  print(i)

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 pprint
N=int(input())
A=list(map(int,input().split()))
s=[]
for i in range(N-1):
  b=A.count(i+1)
  s.append(b)
pprint.pprint(s)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
s=[]
for i in range(N-1):
  b=A.count(i+1)
  s.append(b)
  s.append("\n")
print(s)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
p=list(map(int,input().split()))
li=[]
for i in range(1,n):
    q=p.count(i)
    li.append(q)
for result in li:
    print(result,"\n")

Submission status: Wrong Answer

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

A1 = set(A)
A2 = list(A1)
list(A2).sort()

for i in A2:
    print(A.count(i))

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

Submission status: Wrong Answer

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

A1 = set(A)
A1 = list(A1)
list(A1).sort()

for i in A1:
    print(A.count(i))

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

Submission status: Wrong Answer

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

A1 = set(A)
A1 = list(A1)
list(A1).sort()

for i in A1:
    counter = 0
    for j in range(len(A)):
        if A[j] == i:
            counter += 1
    print(counter)

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

Submission status: Wrong Answer

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

        l = []
        last = A[N-2]

        for i in range(last):
                l.append(A.count(i+1))
        for i in range(N-last):
                l.append(0)

        #[print(n) for n in l]
        for x in l:
                print(x)

if __name__=="__main__":
        main()

Submission status: Wrong Answer

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

        l = []
        last = A[N-2]

        for i in range(last):
                l.append(A.count(i+1))
        for i in range(N-last):
                l.append(0)

        [print(n) for n in l]
        #print(l)

if __name__=="__main__":
        main()

Submission status: Wrong Answer

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

employ = {}

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

#print(employ)
for i in range(1, n):
    if str(i) in employ:
        print(employ[str(i)])
    else:
        print(0)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

count = [0]*(N-1)

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

for i in count:
    print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int,input().split()))
T = {}
for i in A:
    if i not in T:
        T[i] = 0
    T[i] = T[i] + 1
T = T.values()
for i in T:
    print(i)

Submission status: Wrong Answer

Solution code:
from collections import Counter
n = input()
l = input().split()
lt = [int(i) for i in l]
f = Counter(l)
for i in lt:
    print(f[str(i+1)])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n = int(rl())
	A = list(rli())
	cnt = defaultdict(lambda: 0)
	for i, boss in enumerate(A):
		cnt[boss] += 1
	for i in range(1, n):
		print(cnt[i])
	stdout.close()

if __name__ == "__main__":
	main()

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

for i in range(N):
    print(str(worker_list[i]))

Submission status: Wrong Answer

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

for i in range(N):
    print(str(worker_list[i]) + '\n')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

for _ in p:
  print(p[_])

Submission status: Wrong Answer

Solution code:
n = int(input())

A = [int(x) for x in input().split()]
B = {}

for a in A:
    if a not in B:
        B[a] = 0
    B[a] += 1

for i in range(n):
    if i in B:
        print(B[i])
    else:
        print(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
 
def calculate_num_boss(num_person, boss):
    boss_count = np.zeros([num_person])
    result, num = np.unique(boss, return_counts=True)
    for idx in range(result.shape[0]):
        ids = result[idx]
        boss_count[ids-1] = num[idx]
 
    return boss_count
 
 
if __name__ == "__main__":
    num_person = int(input().split()[0])
    bosses = np.array([int(i) for i in input().split()])

Submission status: Wrong Answer

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

print(0)
for i in range(len(a)):
    print(a.count(i))

Submission status: Wrong Answer

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

print(0)
for i in range(len(a)):
    print(a.count(i))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import defaultdict

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

d=defaultdict(int)
for item in a:
    d[item-1]+=1
print(d)
for i in range(n):
    print(d[i])

Submission status: Wrong Answer

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

for i in range(N-1):
  print(List.count(i+1))
print(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
# print(N)
List = list(map(int, input().split()))
print(List)

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

print(0)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
a_count = Counter(map(lambda x: int(x), input().split()))
sorted_count = dict(sorted(a_count.items(), key=lambda x:x[0]))
for i in range(len(sorted_count)+1, n+1):
    sorted_count[i] = 0
for num in sorted_count.values():
    print(num)

Submission status: Wrong Answer

Solution code:
from collections import Counter
N = int(input())
counts = Counter(map(int, input().split())).values()
print(*counts, sep="\n")
print(*(0 for _ in range(N - len(counts))), sep="\n")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

AA=[0]*N
for j in A:
    AA[j-1]+=1

print(i for i in AA)

Submission status: Wrong Answer

Solution code:


import sys
read = sys.stdin.buffer.read # 全読み込み
readline = sys.stdin.buffer.readline # 一行読み込み
readlines = sys.stdin.buffer.readlines # 一行ずつ全読み込み
sys.setrecursionlimit(10**7) # 再帰限界変更（デフォルトは1000）

N = int(readline().rstrip()) 
A = list(map(int,readline().rstrip().split()))

buka=[0]*N

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

print(buka)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(i) for i in input().split()]
ans = [0]*N

for a in A:
    ans[a-1] += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
for x in range(n):
	print(a.count(x+1))
	if a.count(x+1) == 0:
		for y in range(n-x-1):
			print("0")
		break
	else:
		pass

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
x = 1
y = 1
for x in range(n):
	x = x+1
	print(a.count(x))
	z = a.count(x)
	if z == 0:
		break
	else:
		for y in range(z):
			a.remove(x)
y = 1
for y in range(n-x):
	if y<(n-x):
		print("0")
	else:
		break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
l = [int(i) for i in input().split()]
d = {i: 0 for i in range(n)}
for i in l:
  d[i] += 1
for i in d:
  print(d[i])

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

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

ans = [0]*n
for i in range(len(ai)):
    ans[ai[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()))
l =[0]*N
for i in A:
  l[i-1]+=1
print(l)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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