TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
N, M = map(int,input().split())
A = list(map(int,input().split()))
print(min(-1,(N-sum(A))))

N, M = map(int,input().split())
A = list(map(int,input().split()))
print(max(-1,(N-sum(A))))

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

def resolve():
    N,M =  map(int,input().split())
    A = list(map(int,input().split()))
    ans = N
    for i in range(M):
        ans = ans - A[i]
    if ans < 0:
        print(-1)
    else:
        print(ans)
resolve()

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
n, _ = map(int, input().split())
nums = list(map(int, input().split()))
total = sum(nums)
ans = total - n
print(ans)

n, _ = map(int, input().split())
nums = list(map(int, input().split()))
total = sum(nums)
ans = n - total
if ans < 0:
    print(-1)
else:
    print(ans)

Verdicts: Wrong Answer

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

Submission attempts (in order):
D, n = map(int,input().split())
l = list(map(int,input().spliy()))
print(D-sum(l))

D, n = map(int,input().split())
l = list(map(int,input().split()))
a = D - sum(l)
if a >-1:
    print(a)
else:
    print(-1)

Verdicts: Runtime Error

Accepted
Problem: Takahashi has N days of summer vacation.  His teacher gave him M summer assignments. It will take A_i days for him to do the i-th assignment.  He cannot do multiple assignments on the same day, or hang out on a day he does an assignment.  What is the maximum number of days Takahashi can hang out during the vacation if he finishes all the assignments during this vacation?  If Takahashi cannot finish all the assignments during the vacation, print `-1` instead.

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

homework = sum(a)

if homework > N:
    print("-1")

else:
    print(N - homework)

N, M = map(int, input().split())
a = [int(input()) for i in range(M)]

homework = sum(a)

if homework > N:
    print("-1")

else:
    print(N - homework)


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

homework = sum(a)

if homework > N:
    print("-1")

else:
    print(N - homework)

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

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

num = [0]*a

def mi(x):
    return int(x-1)
y = list(map(mi,lists))
for i in y:
    #print(i)
    num[y[i]] += 1
for i in range(a):
    print(num[i])

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

num = [0]*a

def mi(x):

    
    return int(x-1)

y = list(map(mi,lists))

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


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

num = [0]*a

def mi(x):

    
    return int(x-1)

y = list(map(mi,lists))

for i in range(a):
    #print('y')
   # print(i)
    num[y[i]] += 1
for i in range(a):
    print(num[i])
    



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

num = [0]*a

def mi(x):

    
    return int(x-1)

y = list(map(mi,lists))
print(y)
for i in range(a):
    #print('y')
   # print(i)
    num[y[i]] += 1
for i in range(a):
    print(num[i])
    

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

num = [0]*a

def mi(x):

    
    return int(x-1)

y = list(map(mi,lists))

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

Verdicts: Wrong Answer

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):
import numpy as np
import math as mt
N=int(input())
#R=map(int, input().split())
A=list(map(int,input().split()))
count=1
for i in range(0,N-1):
    if i==N-2:
        print(count)
        print(0)
    elif A[i]!=A[i+1]:
        print(count)
    else:
        count=count+1

import numpy as np
import math as mt
N=int(input())
#R=map(int, input().split())
A=list(map(int,input().split()))
count=1
for i in range(0,N-1):
    if i==N-2:
        print(count)
    elif A[i]!=A[i+1]:
        print(count)
    else:
        count=count+1

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

Verdicts: Wrong Answer

Wrong Answer

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

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

buka_num = [0]

for i in range(1, N+1):
  tmp_A = A[i:]
	buka_num.append(tmp_A.count(i))

print(buka_num, sep='¥n')

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

buka_num = []

for i in range(1,N):
    tmp_A = A[i:]
    buka_num.append(tmp_A.count(i))
    
buka_num.append(0)
print(buka_num, sep='\n')

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

buka_num = [0]

for i in range(1, N):
  tmp_A = A[i:]
	buka_num.append(tmp_A.count(i))

buka_num.append(0)

print(buka_num, sep='¥n')

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

buka_num = []

for i in range(1, N):　＃tmp_A = A[i:]
 buka_num.append(tmp_A.count(i))

buka_num.append(0)

print(buka_num, sep='¥n')

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

buka_num = []

for i in range(1, N+1):
	buka_num.append(A.count(i))

print(buka_num, sep='¥n')

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

buka_num = []

for i in range(1, N):
  tmp_A = A[i:]
	buka_num.append(tmp_A.count(i))

buka_num.append(0)

print(buka_num, sep='¥n')

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

buka_num = []

for i in range(1, N+1):
	buka_num.append(A.count(i))

print(buka_num, sep='¥n')

import collections
N = int(input())
A = [0]
A.extend(list(map(int, input().split())))
c = collections.Counter(A)
buka_num = []

for i in range(1,N):
    buka_num.append(c[i])
    
buka_num.append(0)
for ele in buka_num:
    print(ele)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

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

import collections
N=int(input())
Boss=list(map(int, input().split()))
AA=collections.Counter(Boss)
for i in range(N):
    print(AA[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())
josi = list(map(int,input().split()))
count=[0]*N
n=0
while n<N-1:
  count[josi[n]] =count[josi[n]]+1
  n=n+1
n=0
while n<N:
  print(count[n])

      

N=int(input())
josi = list(map(int,input().split()))
n=1
m=0
count=0
while n<=N:
  m=n
  while m<N:
    if josi[m]=n:
      count = count+1
    m=m+1
  print(count)
  m=0
  count=0

      

N=int(input())
josi = list(map(int,input().split()))
count=[0]*N
n=0
while n<N-1:
  count[josi[n]-1] =count[josi[n]-1]+1
  n=n+1
n=0
while n<N:
  print(count[n])
  n=n+1


Verdicts: Time Limit Exceeded

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

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

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

N = int(input())
A = list(map(int, input().split()))
data = [0 for i in range(N-1)]
for i in range(N-1):
    data[A[i]-1] += 1
for j in range(N-1):
    print(data[j], end = '\n')

N = int(input())
A = list(map(int, input().split()))
data = [0 for i in range(N)]
for i in range(N-1):
    data[A[i]-1] += 1
for j in range(N):
    print(data[j], end = '\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()))
count = ''
for i in range(1,n+1):
  count+=(str(a.count(i))+'\n')
print(count)

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

count = [0]*n

for i in a:
  count[i-1]+=1
for i in count:
  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()))

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

for v in result:
    print(v)

n = int(input())
a = []
for i in range(0, n - 1):
    a.append(int(input()))

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

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

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

for v in result:
    print(v)

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(input().split())
#print(a)

employ = {}

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

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

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

employ = {}

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
 = int(input())
a_list = list(map(int, input().split()))
a_list = [ (i+2, s) for i, s in enumerate(a_list) ]
a_list = sorted(a_list, key=lambda x: x[1])
count = 0
boss = 1
for a in a_list:
    if a[1] == boss:
        count += 1
    else:
        diff = a[1] - boss
        for _ in range(diff):
            print(count)
            count = 0
        boss = a[1]
        count += 1

for _ in range(N - a_list[-1][1]+1):
    print(count)
    count = 0

N = int(input())
a_list = list(map(int, input().split()))
a_list = [ (i+2, s) for i, s in enumerate(a_list) ]
a_list = sorted(a_list, key=lambda x: x[1])
count = 0
boss = 1
for a in a_list:
    if a[1] == boss:
        count += 1
    else:
        diff = a[1] - boss
        for _ in range(diff):
            print(count)
            count = 0
        boss = a[1]
        count += 1

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


N = int(input())
s = [0 for i in range(N)]
A = list(map(int, input().split()))
for i in A:
    s[i - 1] += 1
print(*s, 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 sys
read = sys.stdin.buffer.read 
readline = sys.stdin.buffer.readline 
readlines = sys.stdin.buffer.readlines 
sys.setrecursionlimit(10**7) 

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

buka=[0]*N

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

print(buka)


# TLE



import sys
read = sys.stdin.buffer.read 
readline = sys.stdin.buffer.readline 
readlines = sys.stdin.buffer.readlines 
sys.setrecursionlimit(10**7) 

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

buka=[0]*N

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

L=[str(a) for a in buka]
L="\n".join(L)
print(L)

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()))
s = [0 for _ in range(n)]
for i in range(n):
    s[a[i]-1] += 1
for t in s:print(t)

n = int(input())
a = list(map(int,input().split()))
for i in range(n):
    print(a.count(i))

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


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 = [0]*N

print(A)
for i in [int(s) for s in input().split()]:
    A[i-1] +=1

for j in range(N+1):
    print(A[j])

N = int(input())
A1 = [1]
Ai = [int(a) for a in input().split()]
A = A1+Ai

for ai in A:
    print([(a==ai+1) for a in A].count(True))

N = int(input())
A1 = [0]
Ai = [int(a) for a in input().split()]
A = A1+Ai
B = [b+1 for b in A]

for b in B:
    print([a==b for a in A].count(True))

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

for ai in A:
    print([(a<ai) for a in A].count(True))

N = int(input())
A1 = [0]
Ai = [int(a) for a in input().split()]
A = A1+Ai

for ai in A:
    print([(a==ai+1) for a in A].count(True))

N = int(input())
A1 = [1]
Ai = [int(a) for a in input().split()]
A = A1+Ai

print(A)

for ai in A:
    print([(a==ai+1) for a in A].count(True))

N = int(input())
A = [0]*N

for i in [int(s) for s in input().split()]:
    A[i-1] +=1

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

Verdicts: Runtime Error

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

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

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


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

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


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

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


Verdicts: Wrong Answer

Runtime Error

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
counter = [0] * N
As = map(int, input().split())
for A in As:
  counter[A] += 1
for c in counter:
  print(c)

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


Verdicts: Wrong Answer

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

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

Clist = []
for count in range(len(A)+1):
    Clist.append(0)

for count in range(len(A)):
    Clist[A[count]-1] = Clist[A[count]-1] + 1

for count in range(0,len(A)):
    print(Clist[count])

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

Clist = []
for count in range(len(A)+1):
    Clist.append(0)

for count in range(len(A)):
    Clist[A[count]-1] = Clist[A[count]-1] + 1

for count in range(0,len(A)+1):
    print(Clist[count])

Verdicts: Wrong Answer

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

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

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

N=int(input())
L=[0]*N
A=list(map(int,input().split()))
for i in range(0,len(A)):
    L[A[i]-1]+=1
for i in range(0,N):
    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 = int(input())
syain = []
for i in range(N):
	syain.append(0)
x =(input()).split(" ")
xid = [int(s) for s in x]
for t in xid:
	syain[t-1]+=1
print(syain)

N = int(input())
syain = []
for i in range(N):
	syain.append(0)
x =(input()).split(" ")
xid = [int(s) for s in x]
for t in xid:
	syain[t-1]+=1
for m in syain:
	print(m)

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

sum = 0
for i in range(N):
    print(A.count(i+1))
    sum += A.count(i+1)
    if sum == (N-1):
        break

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

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


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

n = int(input())
office = list(map(int, input().split()))
for i in range(n-1):
  print(office.count(i+1))

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

Verdicts: Wrong Answer

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())
works = sorted(list(map(int,input().split())))
 
for i in range(1,N + 1):
  print(works.count(i))
  works.remove(i)

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

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





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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n=int(input())
arr=[int(i) for i in input().split()]
ans=[ 0 for i in range(n+1)]
for i in range(n):
    ans[arr[i]-1]+=1
for i in ans:
    print(i)


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

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

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

ans = [0] * N

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

for a in ans:
    print(a)

Verdicts: Wrong Answer

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

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

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
import sys
input = sys.stdin.readline
n = int(input())
a = [int(i) for i in input().split()]
del a[n:len(a)-1]
print(a)
for i in range(n):
    count = 0
    for j in a:
        if i+1 == j:
            count += 1
    print(count)


import sys
import collections
input = sys.stdin.readline
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):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

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(s) for s in input().split(" ")]
R = [0] * (A + 1)
for a in A:
	R[a - 1] += 1
for a in R:
  print(a)

N = int(input())
A = [int(s) for s in input().split(" ")]
R = [0] * (len(A) + 1)
for a in A:
	R[a - 1] += 1
for a in R:
  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):
n = int(input())
a = list(map(int, input().split()))
tm = 0

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

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

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

for i in tm:
    print(i)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
As = list(map(int, input().split()))
ans = [0 for _ in range(N)]
 
for a in As
    ans[a-1] += 1

print(ans, sep="\n")

# coding: utf-8
# Your code here!

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

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

for x in ans:
  print(x)

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
import sys
import os
import math

def file_input():
    f = open('input.txt', 'r')
    sys.stdin = f

def main():
    file_input()

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

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

    for i in N:
        print(i)


if __name__ == '__main__':
    main()


import sys
import os
import math

def file_input():
    f = open('input.txt', 'r')
    sys.stdin = f

def main():
   # file_input()

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

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

    for i in N[1:]:
        print(i)


if __name__ == '__main__':
    main()

import sys
import os
import math

def file_input():
    f = open('input.txt', 'r')
    sys.stdin = f

def main():
    #file_input()

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

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

    for i in N:
        print(i)


if __name__ == '__main__':
    main()


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

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

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

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

l = Counter(A)

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

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

l = Counter(A)

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

Verdicts: Wrong Answer

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

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

n = int(input())
a = list(map(int, input().split()))
arr = [0 for i in range(n)]
for i in a:
    arr[i - 1] += 1
for i in range(n):
    print(arr[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())
array = list(map(int, input().strip().split()))
array.sort
ansarray = []
ansnum = 1
ans = 0
ansindex = 0
for i in range (1,N+1):
    for j in range(ansindex,N-1):
        if (array[j] == i):
            ans += 1
            ansindex += 1
        else:
            ansarray.append(ans)
            ans = 0
            break
        if(j == N-2):
            ansarray.append(ans)
for i in range(N-ansindex):
    ansarray.append("0")
for i in range(N):
    print(ansarray[i])

N = int(input())
array = list(map(int, input().strip().split()))
array.sort()
ansarray = []
ansnum = 1
ans = 0
ansindex = 0
for i in range (1,N):
    for j in range(ansindex,N-1):
        if (array[j] == i):
            ans += 1
            ansindex += 1
        else:
            ansarray.append(ans)
            ans = 0
            break
        if(j == N-2):
            ansarray.append(ans)
            ansindex += 1
for i in range(N-len(ansarray)):
    ansarray.append("0")
for i in range(N):
    print(ansarray[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()))

A.sort()
if A[0]==0:
    A.remove(0)

l=len(A)
k=0

ans=1

m=max(A)

for i in range(l-1):
    if A[i+1]>A[i]:
        k=A[i]
        print(ans)
        while A[i+1]!=k+1:
            k=k+1
            print(0)
        ans=0
    else:
        ans=ans+1
if A[l-1]==A[l-2]:
    print(ans)
else:
    print(ans+1)
    
   
for j in range(m+1,N+1):
    print(0)



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

L=[0]*N


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


for i in range(N):
    print(L[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):
ninnzuu = (int)(input())
joushi = list(map(int, input().split(" ")))
buka = [0 for i in range(ninnzuu)]
for i in range(1, ninnzuu + 1):
    buka[joushi[i] - 1] += 1
for i in range(ninnzuu):
  print(buka[i])

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

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

Verdicts: Runtime Error

Wrong Answer

Accepted