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())
A = list(map(int,input().split()))
A.append(N)
A.sort()
for i in range(1,N):
    count = 0
    while A[0] == i:
        A.pop(0)
        count += 1
    print(count)
    

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

count = [0]*(N-1)

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

for i in count:
    print(i)


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

count = [0]*N

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

for i in count:
    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())

boss_list = map(int, input().split())

employee_list = [0] * (n - 1)

for boss in boss_list:
	employee_list[boss - 1] += 1
	
for employee in employee_list:
	print(employee)


n = int(input())

boss_list = map(int, input().split())

employee_list = [0] * n

for boss in boss_list:
	employee_list[boss - 1] += 1

for employee in employee_list:
	print(employee)


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

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

c = collections.Counter(A)
print(c)

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

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

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

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

for i in range(B):
    print(i)

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

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

for i in B:
    print(i)

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

B = [0 for i in range(len(A))]
for i in A:
    B[i-1] =B[i-1] + 1

for i in B:
    print(i)

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

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

for i in B:
    print(i)

Verdicts: Runtime Error

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):
from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=list(map(int,(stdin.readline().strip().split()))).sort()
moji=A[0]
count=1
i=0
length=len(A)-1
j=0
sougou=0
while(i!=length):

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

from sys import stdin
import numpy as np
N=list(map(int,(stdin.readline().strip().split())))[0]
A=list(map(int,(stdin.readline().strip().split())))
num_list=[0]*N
moji=A[0]
i=0
length=len(A)-1
for i in A:
    num_list[i-1]+=1
for num in num_list:
    print(num)

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

n=int(input())
a=list(map(int, input().split()))
b= [0]*n
for i in a:
  b[i-1]+=1
for i in b:
  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 numpy as np
n = int(input())
jousi = list(map(int, input().split()))
a = np.zeros(n)
for i in jousi :
    a[jousi[i] -1] += 1
    print(int(a[jousi[i] - 1]))

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

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

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

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

Verdicts: Runtime Error

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):
from collections import Counter
n =int(input())
a = list(map(int, input().split()))
s = Counter(a)
for v in s.values():
    print(v)
for i in range(n - len(ans)):
    print(0)



from collections import Counter
n =int(input())
a = list(map(int, input().split()))
s = Counter(a)
ans = [0] * n
for k, v in s.items():
    ans[k - 1] = v
for i in ans:
    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())
A=list(map(int,input().split()))
for i in range(N-1):
    print(A.count(i))
print("0")


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


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


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


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


N=int(input())
A=[int(n) for n in input().split()]
sub=[0]*N
for index in A:
    sub[index-1]+=1
print("\n".join(map(str,sub)))

Verdicts: Wrong Answer

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

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

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

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

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

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

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

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

l = [0]*(n+1)
for i in range(n-1):
  l[a[i]] += 1
  
print(*l[1:], sep = '\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):
import collections

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

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

import collections
 
N = int(input())
A = list(map(int,input().split()))
a = collections.Counter(A)
 
for i in range(N):
  print(a[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):
#C
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
m=max(a)
a = Counter(a)
print(a)

for i in range(1, n + 1):
    if i <= m:
        print(a[i])
    else:
        print(0)


#C
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
m = max(a)
a = Counter(a)
# print(a)

for i in range(1, n + 1):
    if i <= m:
        print(a[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())

Ninzu = []
for x in input().split():
	Ninzu.append(int(x))

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

import collections

N = int(input())

Ninzu = []
for x in input().split():
	Ninzu.append(int(x))

l = collections.Counter(Ninzu)

for i in range(1,N):
	print(l[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())
dict = {}
for i in map(int, input().split(" ")):
	dict[i] = dict.get(i, 0) + 1

for i in range(n):
	print(dict.get(i, 0))

n = int(input())
dict = {}
for i in map(int, input().split(" ")):
	dict[i] = dict.get(i, 0) + 1
 
for i in range(0, n + 1):
	print(dict.get(i, 0))

n = int(input())
dict = {}
for i in map(int, input().split(" ")):
	dict[i] = dict.get(i, 0) + 1
 
for i in range(1, n + 1):
	print(dict.get(i, 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):
10
1 1 1 1 1 1 1 1 1

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

k = [0]*N

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

for i in k:
  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):
def main():
  N = int(input())
  A = [int(x) for x in input().split()]
  
  B = [0] * N
  for i in range(N):
    e = A[N-i-1]
    B[e] += 1
  
  for i in range(N):
    print(B[i])
    
if __name__ == '__main__':
  main()

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

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

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

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

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

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


def main():
    N = int( input())
    A = list( map( int, input().split()))
    B = [0]*(N)
    for a in A:
        
        B[a-1] += 1
        print(B)
    print("\n".join( map( str, B)))
if __name__ == '__main__':
    main()


def main():
    N = int( input())
    A = list( map( int, input().split()))
    B = [0]*(N)
    for a in A:
        B[a-1] += 1
    print("\n".join( map( str, B)))
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().split()))

L = []
for i in range(N-1):
  L.append(0)

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

for j in range(N-1):
  print(L[j])

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

L = []
for i in range(N-1):
  L.append(0)

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

for j in range(N-1):
  print(L[j])

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

L = []
for i in range(N):
  L.append(0)

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

for j in range(N):
  print(L[j])

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)



# print(A)

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


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



N = int(input('')) 

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)


print(subordinate)
print(A)

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


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


N = int(input('')) 

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)



# print(A)

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


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



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):
def function(n, list1):
  ans = [0] * n
  for i in list1:
    ans[i - 1] += 1
  string = ""
  for i in range(len(ans)):
    if i < len(ans) - 1:
      string += ans[i] + "\n"
    else:
      string += ans[i]
  return string

n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list1))
    

def function(n, list1):
  ans = [0] * n
  for i in list1:
    ans[i - 1] += 1
  string = ""
  for i in range(len(ans)):
    if i < len(ans) - 1:
      string += str(ans[i]) + "\n"
    else:
      string += str(ans[i])
  return string
 
n = int(input())
list1 = input().split()
list1 = [int(i) for i in list1]
print(function(n, list1))

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


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

for i in range(n):
  if (i+1) in b:
    c=0
    for j in range(len(b)):
      if b[j]==i+1:
        c += 1
      else:
        break
    print(c)
  else:
    print(0)

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

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

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

N = int(input())
A = list(map(int,input().split()))
L = [0] * (N+1)
for i in range(N-1):
  L[A[i]]+=1
for i in range(1,N+1):
  print(L[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=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N):
	answer.append(list.count(i))
a_s='\n'.join(answer)
print(a_s)

N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N):
	answer.append(str(list.count(str(i))))
a_s='\n'.join(answer)
print(a_s)

N=map(int, input())
list=list(map(str, input().split()))
answer={}
for i in range(1, N+1):
  m=0
  for j in range(0, len(list)):
  	if list[j] is str(i):
      m=m+1
    else:
      m=m+0
  answer.append(m)
a_s='\n'.join(answer)
print(a_s)

N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N+1):
	m=0
	for j in range(0, len(list)):
  		if list[j] is str(i):
      		m=m+1
    	else:
      		m=m+0
	answer.append(m)
a_s='\n'.join(answer)
print(a_s)

N=map(int, input())
list=list(map(str, input().split()))
answer={}
for i in range(1, N+1):
	m=0
	for j in range(0, len(list)):
  		if list[j] is str(i):
      		m=m+1
    	else:
      		m=m+0
	answer.append(m)
a_s='\n'.join(answer)
print(a_s)

N=int(input())
list=list(input().split())
ans=[]
for i in range(1,N):
  ans.append(list.count(str(i)))
print(ans)

N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N+1):
	answer.append(list.count(i))
a_s='\n'.join(answer)
print(a_s)

N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N-2):
	answer.append(list.count(i))
a_s='\n'.join(answer)
print(a_s)

N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N-2):
  m=list.count(str(i)
  answer.append(m)
a_s='\n'.join(answer)
print(a_s)

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 n in ans:
print(n)

N=map(int, input())
list=list(map(str, input().split()))
answer={}
for i in range(1, N+1):
  m=0
  for j in range(0, len(list)):
  	if list[j] is str(i):
      m=m+1
    else:
      m=m+0
answer.append(m)
a_s='\n'.join(answer)
print(a_s)

N=map(int, input())
list=list(map(str, input().split()))
answer=[]
for i in range(1, N-2):
	answer.append(list.count(str(i)))
a_s='\n'.join(answer)
print(a_s)

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

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

#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]


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

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

for j in ans:
    print(j)



#List = list(map(int, input().split()))
#req = [list(map(int, input().split())) for _ in range(q)]
#t = t[:-1]


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)


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(input()) for i in range(N - 1)]
for i in range(1, N + 1):
  print(A.count(i))

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

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

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

num = input()
hoge = list(map(int, input().split()))
count = 0
fuga = 0

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

num = int(input())
hoge = list(map(int, input().split()))
fuga = 0
for i in range(num):
  count = 0
  for j in range(fuga, num):
    if hoge[j] == i + 1:
      count += 1
  fuga += count
  print(count)

num = input()
hoge = list(map(int, input().split()))
count = 0
fuga = 0
 
for i in range(1, len(hoge)):
	if hoge[i] != hoge[i - 1]:
		print(i - count)
		fuga += 1
		count = i
		if i == len(hoge) - 1:
			print(i + 1- count)
			fuga += 1
	else:
		if i == len(hoge) - 1:
			print(i + 1- count)
			fuga += 1
for i in range(fuga, num):
	print(0)

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

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

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

fuga = [0] * num

for i in hoge:
  fuga[i - 1] += 1
for i in fuga:
  print(i)

Verdicts: Wrong Answer

Runtime Error

Runtime Error

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

ans = [0 for i in range(n)]

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

print(ans)


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

ans = [0 for i in range(n)]

for i in range(n - 1):
  b = a[i]
  ans[b - 1] = ans[b-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())
Alist = list(map(int,input().split()))

result = [0]*N

for i in range(N-1):
    result[Alist[i]-1] +=1

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


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

result = [0]*N

for i in range(N-1):
    result[Alist[i]-1] +=1

for i in range(N):
    print(result[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 numpy as np


if __name__ == '__main__':
    List = [list(map(int, input().split())) for i in range(2)]
    N = List[0][0]
    buka = np.array(List[1][:])


    l_out = np.zeros(N,dtype=int)

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

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



import numpy as np
 
 
if __name__ == '__main__':
    List = [list(map(int, input().split())) for i in range(2)]
    N = List[0][0]
    buka = np.array(List[1][:])
 
 
    l_out = np.zeros(N,dtype=int)
 
    for i in range(N-1):
        l_out[buka[i]-1] += 1
 
    for i in range(N):
        print(l_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().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
    if sum(ans) == n-1:
        for k in range(1,n-i):
            ans.append(0)
            break
for j in ans:
    print(j)

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)


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

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

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

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

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

previous=1
count=0
for j in a+[n+1]:
    if j==previous:
        count+=1
    else:
        print(count)
        count=1
        for _ in range(j-previous-1):
            print(0)
        previous=j

Verdicts: 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 = [int(x) for x in input().split()]
count = 0
for i in N-1:
  if 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(n):
    print(ans[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())
numbers = input().strip().split(' ')

boss_dict = [0] * N
for i in range(N - 1):
    boss_num = int(numbers[i])
    boss_dict[boss_num] += 1
    
for boss in boss_dict:
    print(boss)

N = int(input())
numbers = input().strip().split(' ')

boss_dict = [0] * N
for i in range(N - 1):
    boss_num = int(numbers[i])
    boss_dict[boss_num - 1] += 1

for boss in boss_dict:
    print(boss)

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  = list(input().split())
fact_count = Counter(a)
for i in range(1, N+1)
	try:
    	print(fact_count[i])
	except:
    	print(0)

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

from collections import Counter
N = int(input())
a  = list(input().split())
fact_count = dict(Counter(a))
for i in range(1, N+1):
    try:
        print(fact_count[str(i)])
    except:
        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):
n = int(input())
A = list(map(int, input().sprit()))
for i in range(1,n):
  print(A.count(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: 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):
ar = [0]*n

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

tmp = ar.pop(0)
ar.append(tmp)
for i in range(n):
    print(ar[i])


n  = int(input())
a = input().split()
a = [int(x) for x in a]
ar = [0]*n

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

tmp = ar.pop(0)
ar.append(tmp)
for i in range(n):
    print(ar[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 = [0]*(n+1)
A[a] +=0   for a in input().split()

for e in A[1:]:
  print(e)

import sys
input = sys.stdin.readline

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

sub_list = [0] *n

for a in A:
  sub_list[a] +=1

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

import sys
input = sys.stdin.readline


n = int(input())
A = [0]*(n+1)
for a in input().split():
    A[int(a)] +=1 

for e in A[1:]:
  print(e)


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

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

for i in range(n):
  l.append(0)

for i in m:
  ind = i-1
  l[ind] += 1

for i in l:
    print(i)
  
  

n = int(input())
m = input().split()
m = [int(i) for i in m]
 
for i in range(n):
  l.append(0)
for i in m:
  ind = i-1
  l[ind] += 1
for i in l:
  print(i)
  

n = int(input())
m = input().split()
m = [int(i) for i in m]
 
l =[]
for i in range(n):
  l.append(0)
for i in m:
  ind = i-1
  l[ind] += 1
for i in l:
  print(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 collections

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

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

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

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

print("0")

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


N = int(input())
A_list = list(map(int, input().split()))
ans_list = [0] * (N + 1)
for i in range(N-1):
    ans_list[A_list[i]] += 1
for j in range(N):
    print(ans_list[j + 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=list(map(int,input().split()))#N-1
count=0

L=len(A)

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


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

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

for i in range(0,N):
    print(list[i])


Verdicts: Wrong Answer

Accepted