TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
import math
def main():
    N = map(int, input())
    l = [int(_) for _ in input().split()]
    count_list = [0] * N
    for i in l:
        index = i - 1
        count_list[index] += 1

    for out in count_list:
        print(out + '\n')
main()

import math
def main():
    N = int(input())
    l = [int(_) for _ in input().split()]
    count_list = [0] * N
    for i in l:
        index = i - 1
        count_list[index] += 1

    for out in count_list:
        print(out)
main()

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))

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


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

def count(N,A):
    for i in range(N):
        print(A.count(i+1))
        A.remove(i+1)
count(N,A)

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

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

N = int(input())
A = list(map(int,input().split()))
Ansbox = [0]*(N+1)

def count(N,A,Ansbox):

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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])

n = int(input())

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

import collections
c = collections.Counter(a)

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

n = int(input())

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

import collections
c = collections.Counter(a)

for i in range(n-1):
    print(c[i+1])
    
print(0)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))

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

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


#  print (a.count(i+1))
#  a= [a[j] for j in range(0, len(a)) if a[j] != i+1]
#
#  print (a)

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

from collections import Counter
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    C = Counter(A)

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

if __name__ == "__main__":
    unittest.main()


from collections import Counter
def resolve():
    N = int(input())
    A = list(map(int, input().split()))
    C = Counter(A)

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

if __name__ == "__main__":
    resolve()

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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])


n = int(input())
a = list(map(int, input().split()))
l = [0] * n

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

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

n = int(input())
a = list(map(int, input().split()))
l = [0] * n

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

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


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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(n-1):
  print(len(t[i]))
print(0)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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))



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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
N=int(input())
A=[int(x) for x in input().split()]


X=[0]*200000
for i in range(N-1):
    tmp=A[i]
    X[tmp]+=1
print(X[1:N+1])


N=int(input())
A=[0,0]
A[2:]=[int(x) for x in input().split()]
dict1={}
for i in range(2,N+1):
    tmp=str(A[i])
    if (not tmp in dict1):
        dict1[tmp]=1
    else:
        dict1[tmp]+=1
for i in range(1,N+1):
    if (str(i) in dict1):
        print(dict1[str(i)])
    else:
        print(0)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
l = list(map(int, input().split()))
ANS = [0]*N

for i in range(N-1):
    k = l[i]
    ANS[k] += 1
for i in range(1,N):
    print(ANS[i])


import sys
def input():
    return sys.stdin.readline()[:-1]
N = int(input())
l = list(map(int, input().split()))
ANS = [0]*N

for i in range(N-1):
    k = l[i]
    ANS[k-1] += 1
for i in range(N):
    print(ANS[i])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = [int(a) for a in input().split()]

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


N = int(input())
A = [int(a) for a in input().split()]
x = [0] * N

for i in A:
    x[i-1] += 1

for i in x:
    print(i)


Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input().strip().split())
arr = [int(i) for i in input().strip().split()]
result = {i:0 for i in range(1, n + 1)}
for i, j in enumerate(arr, 2):
    result[j] += 1
    
for i in result.values():
    print(i)

n = int(input().strip())
arr = [int(i) for i in input().strip().split()]
result = {i:0 for i in range(1, n + 1)}
for i, j in enumerate(arr, 2):
    result[j] += 1
    
for i in result.values():
    print(i)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

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

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


n = int(input())

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

rg = range(1, n + 1)

for i in rg:
    print(ls.count(i))
    ls.remove(i)


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

ls2 =[0 for x in range(n)]


for x in ls:
    ls2[x - 1] += 1

for x in range(n):
    print(ls2[x])

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

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

if __name__ == '__main__':
    main()



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

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

if __name__ == '__main__':
    main()



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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])


N=int(input())
A=list(map(int, input().split()))
A_=list(set(A))
count_=["0\n"]*N

for i in range(len(A_)):
	count_[A_[i]-1]=str(A.count(A_[i]))+"\n"

print("".join(count_))



N = int(input())
K = [0]*N
A = [int(i) for i in input().split()]

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


Verdicts: Wrong Answer

Time Limit Exceeded

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))

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

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



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

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
lst = list(map(int,input().split()))
lst2 = [0 for i in range(n)]
for i in range(n):
  x = lst[i]
  lst2[x - 1] = lst2[x - 1] + 1
for i in range(n):
  print(lst2[i])

n = int(input())
lst = list(map(int,input().split()))
lst2 = [0 for i in range(n)]
for i in range(n - 1):
  x = lst[i]
  lst2[x - 1] = lst2[x - 1] + 1
for i in range(n):
  print(lst2[i])


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
A = list(map(int,input().split()))

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

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
i = 1

print(i)

num_sub  = int(input())
sub_boss = input().split()

num_boss = [0]*(num_sub)

for i in sub_boss:
	num_boss[int(i)-1] += 1

for i in num_boss:
	print(i)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(n-1):
  b[a[i]] += 1
  
for e in b:
  print(e)

n = int(input())
a = list(map(int, input().split()))
b = [0]*n
for i in range(1, n):
  b[a[i]] += 1

for e in b:
  print(e)

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
import collections

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


ac = collections.Counter(a)

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

import collections

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


ac = collections.Counter(a)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

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

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

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


Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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])

import collections 

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

c = collections.Counter(a)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

n=int(input())
a=[int(x) for x in input().split()]
s=[0]*n
for c in a:
    s[c-1]+=1
for c in range(n):
    print(s[c])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
liste = list(map(int, input().split()))

from collections import Counter
countedList = Counter(liste)

for i in range(N):
  if i in countedList:
    print(countedList[i])
  else:
    print('0')

N = int(input())
liste = list(map(int, input().split()))
 
from collections import Counter
countedList = Counter(liste)
# print(

for i in range(N):
  if i+1 in countedList:
    print(countedList[i+1])
  else:
    print('0')

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
num_all = int(input())
list = input().split(" ")
list_int = []
for i in list:
  list_int.append(int(i)) 
print(list_int)

for j in range(num_all):
  a = list_int.count(j)
  print(a)

n=int(input())

list = input().split(" ")
list_int = []
for i in list:
  list_int.append(int(i)) 
k = [0]*n                         
for i in list_int:
  k[i-1] = k[i-1]+1
for j in range(n):
  print(k[j])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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])


N = int(input())
A = list(map(int, input().split()))
cnt = [0]*N
for a in A:
    cnt[a-1] += 1
for c in cnt:
    print(c)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import numpy as np
N = int(input())
A_list = list(map(int, input().split()))
index = np.arange(1, N+1)
ans = ["{}\n".format(i) for A_list.count(i) in range(1, N+1)]
print(ans)

N = int(input())
A_list = list(map(int, input().split()))
ans = ["{}\n".format(A_list.count(i)) for i in range(1, N+1)]
print(ans)

import numpy as np
N = int(input())
A_list = list(map(int, input().split()))
index = np.arange(1, N+1)
ans = ["{}\n".format(A_list.count(i)) for i in range(1, N+1)]
print(ans)

import collections
N = int(input())
A_list = list(map(int, input().split()))
ans = collections.Counter(A_list)
for i in range(N):
	print(ans[i])

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

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A_list = list(map(int, input().split()))
A_set = sorted(set(A_list))

A_output = [0 for i in range(N)]

for i in range(len(A_set)):
    A_output[A_set[i]-1] = A_list[A_set[i]:].count(A_set[i])
    
for i in range(len(A_output)):
    print(A_output[i])

N = int(input())
A_list = list(map(int, input().split()))
A_set = sorted(set(A_list), reverse=True)
A_output = []
for i in range(len(A_set)):
    A_output[i] =len(A_list) - len(A_list.remove(A_set[i]))
    
print(A_output.reverse)

N = int(input())
A_list = list(map(int, input().split()))
bosses = [0] * N

for i in A_list:
    bosses[i-1] += 1
for boss in bosses:
    print(boss)

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

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

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

n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

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

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

n = int(input())
a = list(map(int, input().split()))
b = dict()
for i in range(n):
    b[i+1] = 0

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

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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
ans = []
for i in range(N):
  ans.append.(0)
for i in range(N-1):
  ans[A[i]] += 1
print(ans)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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)

print(0)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
a_ = [int(x) for x in range(1, n+1)]
a += a_
a_count = Counter(a)
for i in range(n):
    print(a_count[i+1])

from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
a_count = Counter(a)
for i in range(n):
    print(a_count[i+1])


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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))

import collections
n = int(input())
A_list = list(map(int, input().split()))
A_cont = collections.Counter(A_list)
for i in range(1, n+1):
    print(A_cont[i])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from collection import counter

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

c = counter(a)

for _ in c:
  print(_)

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

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

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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
li = list(map(int, input().split()))

ma = max(li)
cnts = []
for i in range(0, ma):
    cnt = li.count(i+1)
    cnt = str(cnt)
    cnts.append(cnt)

ans = '\n'.join(cnts)

if ma < n:
    ans += '\n' + '0\n'*(n-ma)
    print(ans)

else:
    print(ans)

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

ma = max(li)
cnts = []
for i in range(0, ma):
    cnt = li.count(i+1)
    cnts.append(cnt)

for i in cnts:
    print(i)

if ma < n:
    ans = '0\n'*(n-ma)
    print(ans)

n = int(input())
list = list(map(int, input().split()))
data = [0] * n

for i in list:
    i -= 1
    data[i] += 1

for j in data:
    print(j)

Verdicts: Time Limit Exceeded

Time Limit Exceeded

Accepted
Problem: 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.

Submission attempts (in order):
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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))


ans =[0] * N


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

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


ans =[0] * N


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


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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])


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
a = list(map(int,input().split()))
a = a.sort()
for i in range(1,n+1):
    print(a.count(i))

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
num = int(input())
boss = input().split()

ans_list = [0] * num

for i_boss in boss:
  ans_list[int(i_boss)-1] += 1
  a = list(map(lambda  x: str(x), ans_list))
  print('\n'.join(a))



num = int(input())
boss = input().split()
ans_list = [0] * num
for i_boss in boss:
    ans_list[int(i_boss)-1] += 1
print('\n'.join(list(map(str, ans_list))))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())

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

dp = [0] * n

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N,K=map(int,input().split())
sum1=0
for k in range(K,N+2,1):
    sum1+=(N-k+1)*k+1
print(sum1%(10**9+7))

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

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):

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

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

result = [0 for i in range(param_n)]

for employee in params1:
    result[employee - 1] += 1

for num in result:
    print(num)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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()

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
a=list(map(int,input().split()))
buka=[0]*n
for i in a:
  buka[i]=buka[i]+1
for i in buka:
  print(i)

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

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

Verdicts: Wrong Answer

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
B = [None for _ in range(N)]
for i in range(1,N+1):
  B[i] = A.count(i)
for j in range(N):
  print(B[j])

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
counter = np.bincount(A)
print(counter)
for i in range(1, N+1):
    if i < len(counter):
        print(counter[i])
    else:
        print(0)

import numpy as np
N = int(input())
A = np.array(list(map(int, input().split())))
counter = np.bincount(A)
for i in range(1, N+1):
    if i < len(counter):
        print(counter[i])
    else:
        print(0)

Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import collections as c
n=int(input())
a=list(map(int,input().split()))
b=c.Counter(a)
for i in range(1,N+1):
    print(b[i])

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

Verdicts: Runtime Error

Accepted