TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

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

N, M = map(int, input().split())
A = np.array(list(map(int, input().split())))
tot = np.sum(A)

if tot > N:
	print(-1)
else:
	print(N-tot)

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

N = int(input())
A = np.array(list(map(int, input().split())))
B = np.zeros(N+1, dtype = np.int64)

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

for b in B[1:]:
	print(b)


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

def main(i):
  a = 0
  for j in A:
    if i = j:
      a = a+1
  print(a)
  

for i in range(1,n+1):
  main(i)

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

def main(i):
  a = A.count(i)
  b = A.pop(0)
  print(a)


for i in range(1,n+1):
  main(i)

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

def main(i):
  a = count(A.count(i))
  print(a)


for i in range(1,n+1):
  main(i)

from collections import Counter
n = int(input())
A = list(map(int,input().split()))

mycounter = Counter(A)

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

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

print(l)


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

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

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

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

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: Runtime Error

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):
worker_num=int(input())
num_director=input().split()
print(num_director)
count_director=[]
for j in range(len(num_director)+1):
    count_director.append(int(0))

for i in num_director:
    count_director[int(i)-1] +=1

for out in num_director:
    print(out)

worker_num=int(input())
num_director=input().split()
count_director=[]
for j in range(len(num_director)+1):
    count_director.append(int(0))

for i in num_director:
    count_director[int(i)-1] +=1

for out in count_director:
    print(out)

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

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

print([i for i in member_list])

N = int(input())
rel_list = map(int, input().split())

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

[print(i) for i in member_list]

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

S = [0] * N

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

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


N = int(input())

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

S = [0] * (N+1)

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

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


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

res = [0] * N
for a in As:
    res[a-1] += 1
for r in res:
    print(r)

N = int(input())
As = map(int, input().split())

res = [0] * N
for a in As:
    res[a-1] += 1
for r in res:
    print(r)

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 numpy as np

n = input()
a = np.array([int(i) for i in input().split()])
for i in range(int(n)):
    print(a.count(i+1))

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

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


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

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


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

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

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


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

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


n = input()
#a = list(map(int, input().split()))
a = np.array([int(i) for i in input().split()])
for i in range(int(n)):
    print(a.count(i+1))


num = int(input())
h_numbers = list(map(int, input().split()))
s = [0] * num
for i in h_numbers:
    s[i-1] += 1
[print(i) for i in s]

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

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=input()
A=list(input().split(" "))
for n in range(1,int(N)):
    print(A.count(n))

N=int(input())
A=input().split(" ")
for n in range(1,N):
    print(A.count(str(n)))

N=int(input())
A=list(input().split(" "))
for n in range(1,N):
    print(A.count(str(n)))

N,A=int(input()),input().split(" ")
for n in range(1,N):
    print(A.count(str(n)))

N=input()
A=list(input().split(" "))
count=[0]*int(N)
for a in A:
    idx=int(a)-1
    count[idx]= count[idx]+1
for c in count:
    print(c)

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):
import collections
N = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
print(B)
for i in range(1,N):
   print(B[i])
print('0')

import collections
N = int(input())
A = list(map(int, input().split()))
B = collections.Counter(A)
for i in range(1,N):
   print(B[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())
A=[int(y) for y in input().split()]

dic={}

for e in A:
    if e in dic:
        dic[e]+=1
    else:
        dic[e]=1
        
for r in A:
    if (r+1) in dic:
        print(dic[r+1])
    else:
        print(0)


N=int(input())


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

dic={}
for e in A:
    if e in dic:
        dic[e]+=1
    else:
        dic[e]=1
        
for i in range(1,N+1):
    if i in dic:
        print(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())
A=list(map(int, input().split()))

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

import collections

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

c = collections.Counter(A)

i=1

for j in range(N):
  print(c[i])
  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):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
ans = np.zeros(N)
for i in A:
    ans[i-1] =+1
for i in ans:
    print(int(i))

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

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

result = [0] * N
for a in A:
    result[a - 1] += 1
print('\n'.join(result))


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

result = [0] * N
for a in A:
    result[a - 1] += 1
#print('\n'.join(map(str, result)))
print(*result, sep='\n')


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


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

Verdicts: Wrong Answer

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Submission attempts (in order):
from collections import Counter

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

ct = Counter(As)

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

from collections import Counter

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

ct = Counter(As)

for i in range(1,n+1):
	if i in ct.keys():
		print(ct[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())
list1=list(map(int, input().split()))
list2=[0]*n
for i in list1:
      list2[i-1]=list1.count(i)
for j in list2:
      print(j,"\n")

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


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

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

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

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

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

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: 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())) # <- note that this has (N - 1) elements
print(A)
A_0 = [x - 1 for x in A]
print(A_0)
ans = [0] * N # <- represents number of immediate subordinates of each person

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

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


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

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

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


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

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

print(0)

from collections import defaultdict
import collections

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


#   print(List.count(i+1))
# print(0)

c = collections.Counter(List)
# print(c)
for i in range(1,N+1):
  # print(i)
  print(c[i])
  # print()

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())
nums = [int(e) for e in input().split()]
nums.sort()

for i in range (1,N+1):
    j = 0
    c = 0
    while j < len(nums) and nums[j] == i:
        c = c + 1
    del nums[:c]
    print(c)

import collections as col

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

List = col.Counter(List)
Count_List = [0]*n
for i in List:
    Count_List[i-1] = List[i]

for i in Count_List:
    print(i)

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


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

ans = [0 for _ in range(N)]

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

for j in ans:
    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):
N = int(input())
a = list(map(int,input().split()))
buka_num=[]
for i in range(1,len(a)):
  buka_num.append(str(a.count(i)))
buka_num.append("0")
joined = "\n".join(buka_num)
print(joined)

N = int(input())
a = list(map(int,input().split()))
buka_num=[]
for i in range(1,len(a)):
  buka_num.append(a.count(i))
buka_num.append(0)
print(buka_num)

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

N = int(input())
a = list(map(int,input().split()))
buka_num=[0 for _ in range(N+1)]

for i in a:
  buka_num[i]+=1
buka_num.pop(0)
buka_num.append(0)
for j in buka_num:
  print(j)

N = int(input())
a = list(map(int,input().split()))
buka_num=[0 for _ in range(N+1)]

for i in a:
  buka_num[i]+=1
buka_num.pop(0)
for j in buka_num:
  print(j)

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

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

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

c = [0] * N

for i in range(N-1):
    c[A[i]-1] = c[A[i]-1] + 1
   
for j in c:
    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 = input().split()
B = [0]*(N)
for i in range(0, len(A)):
    A[i] = int(A[i])
    B[A[i]-1] += 1

print(B)


N = int(input())
A = input().split()
B = [0]*(N)
for i in range(0, len(A)):
    A[i] = int(A[i])
    B[A[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):
# coding: utf-8
# Your code here!
line= list(map(int,input().split()))
N = line[0]
K = line[1]


answer = 0
for i in range (K,N+2):
    minit = i*(i-1)/2
    maximum = (2*N-i+1)*i/2
    
    num = maximum-minit+1
    answer += num
 
if answer >=(10**9+7):
    print(int(answer%(10**9+7)))
    
else:
    print(int(answer))

# coding: utf-8
# Your code here!
import collections
num = int(input())
line = list(map(int,input().split()))
clist = collections.Counter(line)
for i in range (1,num):
    print(clist[i])

# coding: utf-8
# Your code here!
import collections
num = int(input())
line = list(map(int,input().split()))
clist = collections.Counter(line)
for i in range (1,num+1):
    print(clist[i])


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

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

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

for i in range(1,n):
    nmb_cnt = 0
    idx_cnt = 0
    for j in a:
        if j == i:
            del a[idx_cnt]
            nmb_cnt += 1
        else:
            idx_cnt += 1
    print(nmb_cnt)

print(0)

import numpy as np
n = int(input())
a = list(map(int,input().split()))

rsl = np.zeros(n)

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

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

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num,dtype=np.int16))
print(yn_num)
for x in sup_num:
  yn_num[x-1] +=1
print(list(yn_num))


import numpy as np

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num))
print(yn_num)
for x in sup_num:
  yn_num[x-1] +=1
print(list(yn_num))

import numpy as np

num = int(input())
sup_num = list(map(int,input().split()))
yn_num = list(np.zeros(num,dtype=np.int16))

for x in sup_num:
  yn_num[x-1] +=1
for x in yn_num:
  print(x)


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


ans = [0] * n

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

for i in ans:
    print(i)


n = int(input())


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


ans = [0] * n

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

for i in 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):
from collections import Counter


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

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

from collections import Counter


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

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

Verdicts: Wrong Answer

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Submission attempts (in order):
import collections

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

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

import collections

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

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

Verdicts: Wrong Answer

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

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

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

Verdicts: Wrong Answer

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Submission attempts (in order):
 n=int(input())
    boss=[int(x) for x in input().split()]
    mem=list(range(1, n+1))
    h_map = dict.fromkeys(mem, 0)
    for i in boss:
      h_map[i]+=1
    for i in mem:
      print(h_map[i])

n=int(input())
boss=[int(x) for x in input().split()]
mem=list(range(1, n+1))
h_map = dict.fromkeys(mem, 0)
for i in boss:
    h_map[i]+=1

for i in mem:
    print(h_map[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())
list1=list(map(int,input().split()))
for i in range(n):
  print(count.list1(i))

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

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

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


from collections import defaultdict

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

d=defaultdict(int)
for item in a:
    d[item-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):
A = list(map(int, input().split()))

m = 0
t = 0

for i in range(1, n):
    count = A.count(i)
    print(count)
    m += count
    t = i
    if m == n - 1:
        break
for _ in range(t, n):
    print(0)


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

m = 0
t = 0

for i in range(1, n):
    count = A.count(i)
    print(count)
    m += count
    t = i
    if m == n - 1:
        break
for _ in range(t, n):
    print(0)


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

# m = 0
# t = 0


#     count = A.count(i)
#     print(count)
#     m += count
#     t = i
#     if m == n - 1:
#         break
# for _ in range(t, n):
#     print(0)

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


Verdicts: Runtime Error

Runtime Error

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Submission attempts (in order):
N = int(input())
A = list(map(int, input().split()))
def count(n, a):
    c = 0
    for i in range(n+1):
        if a[i] == n:
            c += 1
    return c
for j in range(N):
    print(count(j+1, A))

N = int(input())
A = list(map(int, input().split()))
buka = list()
for i in range(N):
    buka.append(0)
for j in range(len(A)):
    buka[A[j]-1] += 1
for k in range(len(buka)):
    print(buka[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()))
b=sorted(b)
for i in range(1,n+1):
  print(b.count(i))
  b=b[b.count(i):]


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


Verdicts: Runtime Error

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

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

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

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

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

def resolve():
    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)
resolve()

def resolve():
    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)
resolve()

def resolve():
	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)
resolve()

Verdicts: Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Submission attempts (in order):
N=int(input())
A=list(map(int,input().split()))
dic={}
for i in range(1,N+1):
  dic[i]=0
for a in A:
  dic[a]=+1
for i in range(1,N+1):
  print(dic[i])

n = int(input())
A = list(map(int, input().split()))
dic = {}
for i in range(1, n+1):
  dic[i] = 0
for a in A:
  dic[a] += 1
for i in range(1, n+1):
  print(dic[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()))
jousi={}
for i in range(N):
    itmp=str(i)
    jousi[itmp]=0
for i in range(N-1):
    atmp=str(a[i])
    jousi[atmp]+=1
for i in range(1,N+1):
    print(jousi[str(i)])


N = int(input())
a = list(map(int, input().split()))
jousi={}
for i in range(N+1):
    jousi[str(i)]=0

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

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

N=int(input())
A=list(map(int, input().split()))
import collections
B=collections.Counter(A)
for i in range(0,N):
    print(B[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())
w=list(map(int,input().split()))
a=[0]*(n)

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

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

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

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

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

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

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

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

ans_l = [0]*N

i = 0
while i < N-1:
  ans_l[A_l[i]-1] += 1
  i += 1

i=0
while i < N-1:
  print(ans_l[i])
  i += 1



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

ans_l = [0]*N

i = 0
while i < N-1:
  ans_l[A_l[i]-1] += 1
  i += 1

i=0
while i < N:
  print(ans_l[i])
  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()))

id = [0 for _ in range(n)]
for i in range(len(a)):
	id[a[i]-1] += 1

for i in id:
	print(i

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

id = [0 for _ in range(n)]
for i in range(len(a)):
	id[a[i]-1] += 1

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

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

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: A company has N members, who are assigned ID numbers 1, ..., N.  Every member, except the member numbered 1, has exactly one immediate boss with a smaller ID number.  When a person X is the immediate boss of a person Y, the person Y is said to be an immediate subordinate of the person X.  You are given the information that the immediate boss of the member numbered i is the member numbered A_i. For each member, find how many immediate subordinates it has.

Submission attempts (in order):
n=int(input())
a=[int(input()) for _ in range(n-1)]

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



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

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


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

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

[print(i) for i in b]


Verdicts: Runtime Error

Wrong Answer

Accepted