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

answer_dic={}
for a in alist:
  if a in answer_dic:
    answer_dic[a]+=1
  else:
    answer_dic[a]=1
print(answer_dic)

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

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

answer_dic={}
for a in alist:
  if a in answer_dic:
    answer_dic[a]+=1
  else:
    answer_dic[a]=1
#print(answer_dic)

for i in range(1,N+1):
  if i in answer_dic:
    print(answer_dic[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):
N=int(input())
X=[0]*N
for a in map(int,input().split()):
  X[a-1]+=1
for i in range(N-1):
  print(X[i])

N=int(input())
X=[0]*N
for a in map(int,input().split()):
  X[a-1]+=1
for i in range(N):
  print(X[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 = []

for i in range(1,N+1):
    B[i] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)

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


for i in range(N):
    #B[i+1] = 0
print(B)
for j in A:
    #B[j] += 1
print(B)
for k in B.values():
    print(k)


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

for i in range(N):
    B[i] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)

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

for i in range(N):
    B[i] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)

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

for i in range(N):
    B[i+1] = 0
for j in A:
    B[j] += 1
for k in B.values():
    print(k)

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


for i in range(N):
    B[i+1] = 0

for j in A:
    B[j] += 1

for k in B.values():
    print(k)



Verdicts: Runtime Error

Runtime Error

Runtime Error

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

N = int(input())
A = list(map(int,input().split()))
B = [0] * (N - 1)
for i in range(N - 1):
    B[A[i] - 1] += 1
for i in B:
    print(i)
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):
n = int(input())
boss_list = list(map(int, input().split(" ")))

boss_list = sorted(boss_list)


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

    if i == 0:
        boss_num -= 1

    print(boss_num)

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

boss_list = sorted(boss_list)


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

    if i == 0:
        boss_num -= 1

    print(boss_num)

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



#     buf_counter = boss_list.count(i + 1)





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


# n = int("5")

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

boss_list = sorted(boss_list)


for i in range(n):
    boss_num = 0
    boss_num = boss_list.count(i + 1)
    
    del boss_list[:boss_num]

    if i == 0:
        boss_num -= 1

    print(boss_num)


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

boss_list = sorted(boss_list)


for i in range(1, n+1):
    
    boss_count = 0
    while (True):
        index = 0
        if boss_list[index] == i:
            boss_count += 1
        else:
            break

    del boss_list[:boss_count]
    print(boss_count)

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

boss_list = sorted(boss_list, reverse=True)


for i in range(n, 0, -1):
    boss_num = 0
    boss_num = boss_list.index(i-1)
    
    del boss_list[:boss_num]

    if i == 0:
        boss_num -= 1

    print(boss_num)

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)


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

boss_count_list = [0] * n


for val in boss_list:
  boss_count_list[val - 1] += 1

for val in boss_count_list:
  print(val)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Time Limit Exceeded

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

for em in range(employeeCount):
    directJuniorCount = 0

    
    for bo in DirectBosses:
        if em == bo :
            directJuniorCount += 1

    print(directJuniorCount)

employeeCount = int(input())
directBosses = list(map(int, input().split()))
directJuniorCounts = [0] * employeeCount

for boss in directBosses:
    directJuniorCounts[boss - 1] += 1

for jc in directJuniorCounts:
    print(jc)

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
for i in range(N-1):
    ans[A[i]] += 1
for i in range(1,N):
    print(ans[i])

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(0,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())
s = list(map(int,input().split()))
l =[0]*n
while i < n-2 :
     l[s[i]-1] += 1
     i += 1
for _ in range(n):
     print(l[_])

n, m =map(int,input().split())
s = list(map(int,input().split()))
a = [input() for __ in range(n)]

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

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

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())
t= [0]*(n+1)
l=[int(i) for i in input().split()]
for i in range(2, n+1):
  t[l[i]]+=1
for i in range(1,n+1):
  print(t[i])

n=int(input())
t= [0]*(n+1)
l=[int(i) for i in input().split()]
for i in l:
  t[i]+=1
for i in range(1,n+1):
  print(t[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 i in A:
    ans[i] += 1
for a in ans[1:]:
    print(a)

N = int(input())
A = list(map(int, input().split()))
ans = [0] * (N+1)
for i in A:
    ans[i] += 1
for a in ans[1:]:
    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):
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])


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

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


N = int(input())
A = list(map(int,input().split()))
m = [0]*N #0~N-1

for i in A:
    m[i-1] += 1
# print(m)
for i in range(N):
    print(m[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=[int(i) for i in input().split()]
lis=[0 for i in range(N)]
for i in A:
    lis[i-1]+=1
print(lis)

N=int(input())
A=[int(i) for i in input().split()]
lis=[0 for i in range(N)]
for i in A:
    lis[i-1]+=1
for t in lis:
    print(t)

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 for i in range(n)]

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

for j in range(n-1):
  print(b[j])
  

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

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

for j in range(n):
  print(b[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
for i in range(n-1):
  ans[a[i]-1] += 1
print(a)
[print(i) for i in ans]

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

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

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


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

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

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

n = int(input())

a = list(map(int,input().split()))
 
res = [0] * n
 
for i in a:
  res[i - 1] += 1
  
for i in res:
  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 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()


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


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

    import collections

    C = collections.Counter(A)
    m = max(A)
    for i in range(m):
        print(C[i+1])

    for _ in range(N-m):
        print(0)


if __name__ == '__main__':
    main()


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

out = [0]*n

for aa in a:
  out[a] += 1

for o in range(len(out)):
  print(o)

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

out = [0]*n

for aa in a:
  out[aa-1] += 1

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

result = [0] * N

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

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

result = [0] * N

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

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

for i in range(n):
    print(d[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()))

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

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


#    print(A.count(i))

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


for i in ans:
   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]*len(A)

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

N=int(input())

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

B=[0]*len(A)

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

N=int(input())

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

B=[0]*len(A)

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

N=int(input())

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

B=[0]*(len(A)+1)

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

Verdicts: 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(int(i) for i in input().split())

p = [0] * n

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

for i in p:
  print(i)


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

p = [0] * n

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

for i in p:
  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):
import collections
n=int(input())
a=list(map(int,input().split()))
b=list(collections.Counter(a).values())
for i in b:
  print(i)

import collections
n=int(input())
c=collections.Counter(list(map(int,input().split())))
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=list(map(int, input().split()))
for i in [1:N+1]:
  print(len([1 for x in A if x==i]))

import numpy as np
N=int(input())
A_np = np.zeros(N)
A=list(map(int, input().split()))
for Ai in A:
  A_np[Ai-1] = A_np[Ai-1] + 1
for i in range(N):
  print('{:.0f}'.format(A_np[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):
import sys

n, *a = map(int, sys.stdin.read().split())
print(a)
graph = [[] for _ in range(n)]
for i in range(n - 1):
    graph[a[i]-1].append(i)
def main():
    for i in range(n):
        print(len(graph[i]))


if __name__ == '__main__':
    main()

import sys

n, *a = map(int, sys.stdin.read().split())
graph = [[] for _ in range(n)]
for i in range(n - 1):
    graph[a[i]-1].append(i)
def main():
    for i in range(n):
        print(len(graph[i]))


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 = [int(i) for i in input().split()]
from collections import defaultdict as ddict
for n in range(N-1):
  A.append(int(input()))

B = ddict(int)
for a in A:
  B[a-1] += 1
for n in range(N):
  print(B[n])


N = int(input())
A = []
from collections import defaultdict as ddict
for n in range(N-1):
  A.append(int(input()))

B = ddict(int)
for a in A:
  B[a-1] += 1
for n in range(N):
  print(B[n])


N = int(input())
A = []
from collections import defaultdict as ddict
for n in range(N):
  A.append(int(input()))

B = ddict(int)
for a in A:
  B[a] += 1
for n in range(N):
  print(B[n])

N = int(input())
A = [int(i) for i in input().split()]
from collections import defaultdict as ddict

B = ddict(int)
for a in A:
  B[a-1] += 1
for n in range(N):
  print(B[n])


Verdicts: Runtime Error

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()))
x = [0]*(2*10**5)
for i in range(2, N):
  x[A[i]] += 1
for i in range(N):
  print(x[i])


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

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

N = int(input())
A = list(map(int, input().split()))
x = [0]**(2*10**5)
for i in range(N):
  x[A[i]] += 1

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

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

Verdicts: Runtime Error

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()))
D = [0 for i in range(N)]

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

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

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

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

for i in range(len(D)):
    print(D[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):
 -*- coding: utf-8 -*-

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


for i in range(N):
    print("{}".format(sheet[i]))


# -*- coding: utf-8 -*-

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


for i in range(N):
    print("{}".format(sheet[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 = [int(elem) for elem in input().split()]
count = [0]*N
for i in A:
    count[i-1] = count[i-1]+1   
print(count)

import math
if __name__ == '__main__':
    N = int(input())
    A = [int(elem) for elem in input().split()]
    count = [0]*N
    for i in A:
      #  print("i", i)
      #  print("A",A[i-1])
        count[i-1] = count[i-1]+1
    
    [print (i) for i in count]

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

jyoshi=[0]*n
for i in range(n-1):
  jyo=a[i]
  jyoshi[jyo-1]=jyoshi[jyo-1]+1
  
for k in jyoshi:
  print k


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

jyoshi=[0]*n
for i in range(n-1):
  jyo=a[i]
  jyoshi[jyo-1]=jyoshi[jyo-1]+1
  
for k in jyoshi:
  print(k)


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())
nl = [0] * n
for a in a_list:
    nl[a] += 1
for v in nl:
    print("{}".format(v))

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

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

for i in nl:
    print("{}".format(i))

n = int(input())
a_list = map(int input().split())
nl = {str(i):0 for i in range(n)}
for a in a_list:
    nl[str(a-1)] += 1
for v in nl.values():
    print("{}".format(v))

n = int(input())
a_list = [int(i) for i in input().split()]
nl = [0] * n
for a in a_list:
    nl[a-1] += 1
for v in nl:
    print("{}".format(v))

Verdicts: Wrong Answer

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

for i in range(n) :
    print(i)
    for j in range(n-1) :
        if i+1 == a1[j] :
            a2[i] += 1
    print(a2[i])
    

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

for i in range(n -1) :
    a2[a1[i]-1] += 1
for j in range(n) :
    print(a2[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):
a = int(input())
l = list(map(int, input().split()))
l_2 = list(set(l))
l_2.sort()
if l_2[0] == 1:
    for i in range(len(l_2) - 1):
        print(l.count(l_2[i]))
        word = '0\n' * (l_2[i + 1] - l_2[i])
        if l_2[i + 1] - l_2[i] - 1 > 0:
            print(word[:-3])
    print(l.count(l_2[-1]))
    word = '0\n' * (a - max(l_2))
    print(word[:3 * (a - max(l_2) - 1) + 1])

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


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

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


def CountFrequency(my_list,n): 
  
    # Creating an empty dictionary  
    freq = {}
    for  i in range(1,n+1):
    	freq[i]=0

    for item in my_list: 
        if (item in freq): 
            freq[item] += 1
        else: 
            freq[item] = 1
  
    for key, value in freq.items(): 
        print (value)
  
# Driver function 
if __name__ == "__main__":  
    n=int(input())
    l=list(map(int,input().split())) 
  
    CountFrequency(l,n) 


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 = []

for i in range(N-1):
    A.append(int(input()))

B = []

for j in range(N-1):
    temp = 0
    for i in A:
        if i-2 == j:
            temp += 1
    B.append(temp)        
for j in range(N-1):
    print(B[j])

N = int(input())

A = []

for i in range(N-1):
    A.append(int(input()))

B = []

for j in range(N-1):
    temp = 0
    for i in A:
        if i-2 == j:
            temp += 1
    B.append(temp)        
for j in range(N-1):
    print(B[j])

N = int(input())

A = []

for i in range(N-1):
    A.append(int(input()))

B = []

for j in range(N-1):
    temp = 0
    for i in A:
        if i-2 == j:
            temp += 1
    B.append(temp)        
for j in range(N-1):
    print(B[j])

import collections

N = int(input())

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

c = collections.Counter(A)

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

Verdicts: Runtime Error

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):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N = INT()
A = LIST()
CNT = [0]*N

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

for i in range(N-1):
	print(CNT[i])

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
 
N = INT()
A = LIST()
CNT = [0]*N

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

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


n = int(input())
l = [int(i) for i in input().split()]
d = [0]*n
for i in l:
  d[i-1] += 1
for i in d:
  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 = np.array(list(map(int, input().split())))
ans = np.zeros(N)
for a in A:
    ans[a-1] += 1
for o in ans:
    print(int(o))

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

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

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)

n = int(input())
a = list(map(int, input().split()))
sub = []
for i in range(0, n):
    sub.append(0)
for j in a :
    sub[j - 1] += 1
for i in sub:
    print(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 - 1)
for a in A:
    ans[a-1] += 1
for x in ans:
    print(ans)

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

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(n) for n in input().split()]

b = [0] * n

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

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

boss = 1
li = []

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

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

for sth in li:
    print(sth)

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

b = [0] * n

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

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: 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 = [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)

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

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

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

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

Verdicts: Wrong Answer

Runtime Error

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())
L = list(map(int,input().split()))
M = [0]*n
for i in range(n-1):
    M[L[i]-1] +=1
print(M)

n = int(input())
L = list(map(int,input().split()))
M = [0]*n
for i in range(n-1):
    M[L[i]-1] +=1
for j in range(n):
    print(M[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(int(i) for i in input().split())
l = [0] * (n - 1)

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

for i in l:
    print(i)



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

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

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


from collections import deque as dq

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

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

for i in l:
    print(i)


from collections import deque as dq

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

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

for i in l:
    print(i)



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

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

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


Verdicts: Wrong Answer

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

ans=''
for i in range(n):
    ans+=str(a.count(i+1))+'\r\n'

print(ans)

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

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

for i in ans:
    print(i)

Verdicts: Time Limit Exceeded

Accepted