ZhenlongDai/ACPR huggingface dataset:
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
ans = [0]*n
for i in range(n-1):
  ans[a[i]-1] += 1
print(a)
[print(i) for i in ans]

Failing test case input:
7
1 2 3 4 5 6

Expected output:
1
1
1
1
1
1
0

Actual output:
[1, 2, 3, 4, 5, 6]
1
1
1
1
1
1
0


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import bisect
N = int(input())
A = [int(x) for x in input().split()]
index = 0
for i in range(1, N+1):
    now = bisect.bisect_right(A, i)
    print(now - index)
    index = now


Failing test case input:
7
1 2 2 4 5 4

Expected output:
1
2
0
2
1
0
0


Actual output:
1
2
0
3
0
0
0


Fixed submission (verdict: Accepted):
import bisect
N = int(input())
A = [int(x) for x in input().split()]
A=sorted(A)
index = 0
for i in range(1, N+1):
    now = bisect.bisect_right(A, i)
    print(now - index)
    index = now

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n=int(input())
li=[int(x) for x in input().split()]
d={}
for i in range(len(li)):
	if li[i] in d:
		d[li[i]]+=1
	else:
		d[li[i]]=1
c=0
for u,v in d.items():
	print(v)
	c+=1

while c<n:
	print(0)
	c+=1


Failing test case input:
7
1 2 3 4 4 6

Expected output:
1
1
1
2
0
1
0


Actual output:
1
1
1
2
1
0
0


Fixed submission (verdict: Accepted):
n=int(input())
li=[int(x) for x in input().split()]
d={}
for i in range(len(li)):
	if li[i] in d:
		d[li[i]]+=1
	else:
		d[li[i]]=1

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
N=int(input())
A=list(map(int,input().split()))
a=collections.Counter(A)
for i in range(N):
  print(a["i"])

Failing test case input:
5
4 2 4 2

Expected output:
0
2
0
2
0


Actual output:
0
0
0
0
0


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

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
a =list(map(int, input().split()))
l =[0] * (n+1)

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

Failing test case input:
7
1 3 1 4 1 7

Expected output:
3
0
1
1
0
0
1


Actual output:
1
0
3
3
0
0
3


Fixed submission (verdict: Accepted):
n = int(input())
a =list(map(int, input().split()))
l =[0] * (n+1)

for i in range(0,n-1):
    l[a[i]] +=1
    
for i in range(1,n+1):
    print(l[i])
Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
print(N,A)
n =  [0 for i in range(N) ]
print(n)
for i in A:
    n[i - 1] += 1

for j in n:
    print(j)

Failing test case input:
7
1 2 1 4 1 7

Expected output:
3
1
0
1
0
0
1


Actual output:
7 [1, 2, 1, 4, 1, 7]
[0, 0, 0, 0, 0, 0, 0]
3
1
0
1
0
0
1


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int,input().split()))
n =  [0 for i in range(N) ]
for i in A:
    n[i - 1] += 1

for j in n:
    print(j)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
s = input().split()
n = int(s[0])
s = input().split()
d = [0]*n
print(d)
for i in s:
    d[int(i)-1]+=1

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

Failing test case input:
5
1 2 4 2

Expected output:
1
2
0
1
0


Actual output:
[0, 0, 0, 0, 0]
1
2
0
1
0


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

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

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
A = list(map(int,input().split()))
out = []
for i in range(1, 5+1):
    if i not in A:
        out.append(0)
    else:
        out.append(A.count(i))
for a in out:
  print(a)


Failing test case input:
7
1 2 3 4 5 2

Expected output:
1
2
1
1
1
0
0


Actual output:
1
2
1
1
1


Fixed submission (verdict: Accepted):
import collections

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

c = collections.Counter(A)

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
d = Counter(a)
d = sorted(d.items(), key = lambda x : x[0])
f = len(d)
for i in range(len(d)):
  print(d[i][1])

for i in range(n - f):
  print(0)
  
  

Failing test case input:
7
2 2 4 2 3 7

Expected output:
0
3
1
1
0
0
1


Actual output:
3
1
1
1
0
0
0


Fixed submission (verdict: Accepted):
from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
d = Counter(a)


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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])

Failing test case input:
7
1 2 3 1 7 2

Expected output:
2
2
1
0
0
0
1


Actual output:
Counter({1: 2, 2: 2, 3: 1, 7: 1})
2
2
1
0
0
0
1


Fixed submission (verdict: Accepted):
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])
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input('')) 

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)


print(subordinate)
print(A)

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


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


Failing test case input:
7
1 2 3 4 3 2

Expected output:
1
2
2
1
0
0
0


Actual output:
[0, 0, 0, 0, 0, 0, 0, 0]
[0, 0, 1, 2, 3, 4, 3, 2]
1
2
2
1
0
0


Fixed submission (verdict: Accepted):
N = int(input('')) 

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

A.insert(0,0)

A.insert(0,0)

subordinate = [0] * (N+1)





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


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):






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

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

for j in ans:
    print(j)


Failing test case input:
7
5 4 6 2 2 7

Expected output:
0
2
0
1
1
1
1


Actual output:
[5, 4, 6, 2, 2, 7]
0
2
0
1
1
1
1


Fixed submission (verdict: Accepted):






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)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = []
for i in B.keys():
  C.append((i,B[i]))
C.sort()

a = 0
for j in range(len(C)):
    print(C[j][1])
    a += 1
for l in range(N-a):
  print(0)




Failing test case input:
7
1 4 3 4 7 6

Expected output:
1
0
1
2
0
1
1


Actual output:
1
1
2
1
1
0
0


Fixed submission (verdict: Accepted):
import collections
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = [0]*N
for i in B.keys():
  C[i-1]=(i,B[i])

a = 0
for j in range(len(C)):
  try:
    print(C[j][1])
  except:
    print(0)
  a += 1
for l in range(N-a):
  print(0)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))

d = {}

for i in a:
    if not i in d.keys():
        d[i] = 1
        continue
    d[i] += 1

if 1 in d.keys():
    print(d[1])
    d[1] = 0
else:
    print(0)
for j in a:
    if not j+1 in d.keys():
        print(0)
    else:
        print(d[j+1])
        d[j+1] = 0

Failing test case input:
5
2 4 4 3

Expected output:
0
1
1
2
0


Actual output:
0
1
0
0
2


Fixed submission (verdict: Accepted):
n = int(input())
a = list(map(int, input().split()))

d = {}

for i in a:
    if not i in d.keys():
        d[i] = 1
        continue
    d[i] += 1

for j in range(1, n+1):
    if not j in d.keys():
        print(0)
    else:
        print(d[j])
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
7
2 2 6 2 2 7

Expected output:
0
4
0
0
0
1
1


Actual output:
[0, 4, 0, 0, 0, 1, 1]


Fixed submission (verdict: Accepted):
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])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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])


Failing test case input:
7
2 3 1 4 2 7

Expected output:
1
2
1
1
0
0
1


Actual output:
defaultdict(<class 'int'>, {1: 2, 2: 1, 0: 1, 3: 1, 6: 1})
1
2
1
1
0
0
1


Fixed submission (verdict: Accepted):
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])

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
nums = [int(e) for e in input().split()]
ans = []
count = []
nums.sort()
for i in nums:
    if i in ans:
        count[ans.index(i)] += 1
    else:
        ans.append(i)
        count.append(1)
for i in range(0,N-len(count)):
    count.append(0)
for i in range(0,N):
    print(count[i])

Failing test case input:
7
1 2 4 4 1 6

Expected output:
2
1
0
2
0
1
0


Actual output:
2
1
2
1
0
0
0


Fixed submission (verdict: Accepted):
N = int(input())
nums = [int(e) for e in input().split()]
ans = []
count = []
nums.sort()
for i in range(0,N):
    count.append(0)
for i in nums:
    count[i-1] += 1
for i in range(0,N):
    print(count[i])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):



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

d = {}
for i in a:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1 




for key, value in list(d.items()):
    print(value)

for i in range(len(list(d.keys())), n): 
    print(0)


Failing test case input:
7
2 2 3 5 5 6

Expected output:
0
2
1
0
2
1
0


Actual output:
2
1
2
1
0
0
0


Fixed submission (verdict: Accepted):



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

d = {}
for i in a:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1 


for i in range(1, n+1):
    if i in d.keys():
        print(d[i])
    else:
        print(0)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
7
2 3 1 4 3 7

Expected output:
1
1
2
1
0
0
1


Actual output:
0
1
1
2
1
0
0
1


Fixed submission (verdict: Accepted):
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)
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import Counter
n = int(input())
a = list(map(int, input().split()))

for _ in Counter(a).values():
  print(_)



Failing test case input:
7
1 2 3 5 5 6

Expected output:
1
1
1
0
2
1
0


Actual output:
1
1
1
2
1


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = [int(a) for a in input().split()]

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

Failing test case input:
7
2 2 3 3 5 4

Expected output:
0
2
2
1
1
0
0


Actual output:
0
0
2
2
5
4


Fixed submission (verdict: Accepted):
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])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
7
2 2 4 5 5 6

Expected output:
0
2
0
1
2
1
0


Actual output:
[0, 2, 0, 1, 2, 0]


Fixed submission (verdict: Accepted):
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)

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import collections
from collections import Counter
n=int(input())
d=collections.deque()
l=list(map(int,input().split()))
d.extend(l)
d.appendleft(0)
c=dict(Counter(d))
s=set(d)
for x in d:
    if x+1 in s:print(c[x+1])
    else:print(0)



Failing test case input:
5
1 1 2 3

Expected output:
2
1
1
0
0


Actual output:
2
1
1
1
0


Fixed submission (verdict: Accepted):
import collections
from collections import Counter
n=int(input())
d=collections.deque()
l=list(map(int,input().split()))
d.extend(l)
d.appendleft(0)
c=dict(Counter(d))
s=set(d)
for x in range(1,len(d)+1):
    if x in s:
        print(c[x])
    else:
        print(0)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
A_list = list(map(int, input().split(" ")))
print(A_list)
for i in range(1, n+1):
    print(A_list.count(i))

Failing test case input:
7
1 1 2 4 5 5

Expected output:
2
1
0
1
2
0
0


Actual output:
[1, 1, 2, 4, 5, 5]
2
1
0
1
2
0
0


Fixed submission (verdict: Accepted):
import collections
n = int(input())
A_list = list(map(int, input().split()))
A_cont = collections.Counter(A_list)
for i in range(1, n+1):
    print(A_cont[i])
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = input()
num = map(int,input().split())

cnt = 0
work = 0
sum = 0
flg = 0
for i in num:
  if work != i:
    if work != 0:
      print(cnt)
      sum += 1
    cnt = 1
    work += 1
  elif work == i:
    cnt += 1

print(cnt)
sum += 1
sum = int(n) - sum
for i in range(sum):
  print(0)

Failing test case input:
7
1 2 1 4 1 7

Expected output:
3
1
0
1
0
0
1


Actual output:
1
1
1
1
1
1
0


Fixed submission (verdict: Accepted):
n = input()
num = list(map(int,input().split()))

num.sort()
cnt = 0
work = 0
sum = 0
flg = 0
for i in num:
  if work != i:
    if work != 0:
      print(cnt)
      sum += 1
    cnt = 1
    mae = work + 1
    work = i
    if mae != work:
      for i in range(mae,work):
        print(0)
        sum += 1
  elif work == i:
    cnt += 1
  

print(cnt)
sum += 1
sum = int(n) - sum
for i in range(sum):
  print(0)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

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

k = 0
j = 1
cnt = 0
for i in range(n):
    if i == n-1:

        print(cnt)
        for _ in range(n - j):
            print(0)
    elif j == l[i]:
        cnt += 1
    elif l[i] - j >= 1:
        print(cnt)
        cnt = 1
        a = l[i] - j
        for _ in range(a-1):
            print(0)
        j += l[i] -j

        


Failing test case input:
7
1 2 2 2 1 5

Expected output:
2
3
0
0
1
0
0


Actual output:
1
3
0
0
1
0
0


Fixed submission (verdict: Accepted):

n = int(input())
l = list(map(int,input().split()))
l.sort()
k = 0
j = 1
cnt = 0
for i in range(n):
    if i == n-1:
        print(cnt)
        for _ in range(n - j):
            print(0)
    elif j == l[i]:
        cnt += 1
    elif l[i] - j >= 1:
        print(cnt)
        cnt = 1
        a = l[i] - j
        for _ in range(a-1):
            print(0)
        j += l[i] -j

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
M = N

mydict = {}
for i in range(N):
    mydict[i] = 0


for i in range(len(a)):
    if a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1

for i in range(M):
    print(mydict[i])

Failing test case input:
7
1 3 2 1 2 4

Expected output:
2
2
1
1
0
0
0


Actual output:
2
2
1
0
0
0
0


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int,input().split()))
M = N
W = N

mydict = {}
for i in range(N):
    mydict[i] = 0


for i in range(len(a)):
    if M-a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1
        M -= a[i]

for i in range(W):
    print(mydict[i])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split())) + [0]
i = -1
for n in range(N):
  count = 0
  while(A[i+1] == n+1):
    i += 1
    count += 1
  print(count)

Failing test case input:
7
1 5 3 5 5 6

Expected output:
1
0
1
0
3
1
0


Actual output:
1
0
0
0
1
0
0


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
i = -1
A = sorted(A) + [0]
for n in range(N):
  count = 0
  while(A[i+1] == n+1):
    i += 1
    count += 1
  print(count)
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
n=int(input())
a=list(map(int,input().split()))

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


Failing test case input:
7
1 2 3 4 4 6

Expected output:
1
1
1
2
0
1
0


Actual output:
0
1
1
1
2
0
1
0


Fixed submission (verdict: Accepted):
import collections
n=int(input())
a=list(map(int,input().split()))

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections

n = input()
n = int(n)
alist = input().split(" ")
intalist = [int(s) for s in alist]

setalist = list(set(intalist))

c = collections.Counter(intalist)

for i in range(0,n):
    try:
        print(c[setalist[i]])
    except IndexError:
        print(0)

Failing test case input:
7
1 3 2 2 1 6

Expected output:
2
2
1
0
0
1
0


Actual output:
2
2
1
1
0
0
0


Fixed submission (verdict: Accepted):
import collections

n = input()
n = int(n)
alist = input().split(" ")
intalist = [int(s) for s in alist]
setalist = list(set(intalist))

c = collections.Counter(intalist)

result = [0] * n
if n == 1:
    print(0)
else:
    for i in range(0,n):
        try:
            result[setalist[i] - 1] = c[setalist[i]]
            
        except IndexError:
            pass
for i in range(0,n):
    print(result[i])

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N=int(input())
A = list(map(int,input().split()))
buka=[0]*N
for i in A:
    buka[i-1]+=1
print(buka)


Failing test case input:
7
2 3 3 3 5 4

Expected output:
0
1
3
1
1
0
0


Actual output:
[0, 1, 3, 1, 1, 0, 0]


Fixed submission (verdict: Accepted):
N=int(input())
A = list(map(int,input().split()))
buka=[0]*N
for i in A:
    buka[i-1]+=1
for m in buka:
    print(m)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
ans = [0] * n
for i in range(len(a)):
    ans[a[i]-1] += 1
for i in range(len(a)):
    print(ans[i])



Failing test case input:
7
1 1 3 3 3 4

Expected output:
2
0
3
1
0
0
0


Actual output:
2
0
3
1
0
0


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)

Failing test case input:
5
2 1 3 5

Expected output:
1
1
1
0
1


Actual output:
['2', '1', '3', '5']
2
1
3
5


Fixed submission (verdict: Accepted):
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)
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import Counter

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

c = Counter(A) 

for i in range(1, n):
  if i in c.keys():
    print(c[i])
  else:
    print(0)

Failing test case input:
7
1 2 3 3 6 2

Expected output:
1
2
2
0
0
1
0


Actual output:
1
2
2
0
0
1


Fixed submission (verdict: Accepted):
from collections import Counter

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

c = Counter(A) 

for i in range(1, n + 1):
  if i in c.keys():
    print(c[i])
  else:
    print(0)

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
n = int(input())
a = list(map(int,input().split()))
l = [0] * n
for i in range(len(a)):
    l[a[i]-1] += 1
    print(l)
for i in l:
    print(i)

Failing test case input:
10
1 1 1 2 1 2 2 1 2

Expected output:
5
4
0
0
0
0
0
0
0
0


Actual output:
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[2, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[3, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[3, 1, 0, 0, 0, 0, 0, 0, 0, 0]
[4, 1, 0, 0, 0, 0, 0, 0, 0, 0]
[4, 2, 0, 0, 0, 0, 0, 0, 0, 0]
[4, 3, 0, 0, 0, 0, 0, 0, 0, 0]
[5, 3, 0, 0, 0, 0, 0, 0, 0, 0]
[5, 4, 0, 0, 0, 0, 0, 0, 0, 0]
5
4
0
0
0
0
0
0
0
0


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))

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


for k in range(N-1):
    print(bukaList[k])



Failing test case input:
7
1 2 2 3 6 2

Expected output:
1
3
1
0
0
1
0


Actual output:
1
3
1
0
0
1


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))

count = 0
buka = [0 for _ in range(N)]

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

for k in range(N):
    print(buka[k])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


from collections import Counter


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

    for i in count:
        print(i)
    for _ in range(N - len(count)):
        print(0)


if __name__ == "__main__":
    main()


Failing test case input:
7
1 2 3 1 7 2

Expected output:
2
2
1
0
0
0
1


Actual output:
2
2
1
1
0
0
0


Fixed submission (verdict: Accepted):


from collections import Counter


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

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


if __name__ == "__main__":
    main()
Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
from sys import stdin, stdout
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n = int(rl())
	A = list(rli())
	cnt = defaultdict(lambda: 0)
	for i, boss in enumerate(A):
		cnt[boss] += 1
	for i in range(1, n):
		print(cnt[i])
	stdout.close()

if __name__ == "__main__":
	main()

Failing test case input:
7
2 2 3 3 5 4

Expected output:
0
2
2
1
1
0
0


Actual output:
0
2
2
1
1
0


Fixed submission (verdict: Accepted):
from sys import stdin, stdout
from collections import deque, defaultdict
import math as m

rl = lambda: stdin.readline()
rll = lambda: stdin.readline().split()
rli = lambda: map(int, stdin.readline().split())

INF, NINF = float('inf'), float('-inf')

def main():
	n = int(rl())
	A = list(rli())
	cnt = defaultdict(lambda: 0)
	for i, boss in enumerate(A):
		cnt[boss] += 1
	for i in range(1, n + 1):
		print(cnt[i])
	stdout.close()

if __name__ == "__main__":
	main()

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys

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


if __name__ == '__main__':
    main()

Failing test case input:
7
1 4 2 2 1 7

Expected output:
2
2
0
1
0
0
1


Actual output:
[1, 4, 2, 2, 1, 7]
2
2
0
1
0
0
1


Fixed submission (verdict: Accepted):
import sys

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


if __name__ == '__main__':
    main()

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
arr = list(map(int, input().split()))
ans = [0]*N

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

print(ans)

Failing test case input:
7
1 3 3 5 5 6

Expected output:
1
0
2
0
2
1
0


Actual output:
[1, 0, 2, 0, 2, 1, 0]


Fixed submission (verdict: Accepted):
N = int(input())
arr = list(map(int, input().split()))
ans = [0]*N

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

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]

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

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

Failing test case input:
10
1 1 1 4 1 2 1 1 2

Expected output:
6
2
0
1
0
0
0
0
0
0


Actual output:
6
2
0
1
0
0
0
0
0


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

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

for j in range(n):
  print(b[j])
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
num = int(input())
li = list(int(x) for x in input().split())
li2 = [0] * num
num = len(li)
for i in li:
  li2[i - 1] = li2[i - 1] + i
for j in range(num):
  print(li2[j])
  

Failing test case input:
5
1 1 2 2

Expected output:
2
2
0
0
0

Actual output:
2
4
0
0


Fixed submission (verdict: Accepted):
num = int(input())
li = list(int(x) for x in input().split())
li2 = [0] * num
num = len(li)
for i in li:
  li2[i - 1] = li2[i - 1] + 1
for j in range(num + 1):
  print(li2[j])

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N = int(input())
a = list(map(int,input().split()))
M = N
 
mydict = {}
for i in range(N):
    mydict[i] = 0
 
 
for i in range(len(a)):
    if M-a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1
 
for i in range(M):
    print(mydict[i])

Failing test case input:
7
1 2 2 4 5 4

Expected output:
1
2
0
2
1
0
0


Actual output:
1
2
0
1
1
0
0


Fixed submission (verdict: Accepted):
N = int(input())
a = list(map(int,input().split()))
M = N
W = N

mydict = {}
for i in range(N):
    mydict[i] = 0


for i in range(len(a)):
    if M-a[i] <= N:
        mydict[a[i]-1] += 1 
        N -= 1
        M -= a[i]

for i in range(W):
    print(mydict[i])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
num = int(input())
indexes = list(map(int, input().split()))

ans = [0]*num
print(ans)
print(indexes)

for i in range(num-1):
  ans[indexes[i]-1] +=1
print(ans)

Failing test case input:
7
2 2 7 1 5 6

Expected output:
1
2
0
0
1
1
1


Actual output:
[0, 0, 0, 0, 0, 0, 0]
[2, 2, 7, 1, 5, 6]
[1, 2, 0, 0, 1, 1, 1]


Fixed submission (verdict: Accepted):
num = int(input())
indexes = list(map(int, input().split()))
ans = [0]*num
for i in range(num-1):
  ans[indexes[i]-1] +=1

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
N=int(input())
A=list(map(int,input().split()))
a=collections.Counter(A)
for i in range(1,N+1):
  print(a["i"])

Failing test case input:
7
1 4 3 3 6 2

Expected output:
1
1
2
1
0
1
0


Actual output:
0
0
0
0
0
0
0


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(input().split())


employ = {}

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


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

Failing test case input:
7
5 4 6 2 2 7

Expected output:
0
2
0
1
1
1
1


Actual output:
0
2
0
1
1
1


Fixed submission (verdict: Accepted):
n = int(input())
a = list(input().split())


employ = {}

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


for i in range(1, n+1):
    if str(i) in employ:
        print(employ[str(i)])
    else:
        print(0)
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)


Failing test case input:
5
1 2 4 5

Expected output:
1
1
0
1
1


Actual output:
1
0
1
0


Fixed submission (verdict: Accepted):
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)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
liste = list(map(int, input().split()))

from collections import Counter
countedList = Counter(liste)

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

Failing test case input:
10
1 1 1 4 1 2 1 1 2

Expected output:
6
2
0
1
0
0
0
0
0
0


Actual output:
0
6
2
0
1
0
0
0
0
0


Fixed submission (verdict: Accepted):
N = int(input())
liste = list(map(int, input().split()))
 
from collections import Counter
countedList = Counter(liste)


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N-1):
  D[i].append(A[i]-1)
for i in range(N):
  print(len(D[i]))

Failing test case input:
7
1 2 3 3 3 2

Expected output:
1
2
3
0
0
0
0


Actual output:
1
1
1
1
1
1
0


Fixed submission (verdict: Accepted):
N = int(input())
D = {i: [] for i in range(N)}
A = list(map(int, input().split()))
for i in range(N-1):
  D[A[i]-1].append(i)
for i in range(N):
  print(len(D[i]))

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def input_int_list():
    return [int(thing) for thing in input().split(" ")]

def int_input():
    return int(input())


import collections
N=int_input()
A_list=input_int_list()
ans_list=[0]
C=collections.Counter(A_list)
for i in range(1,N+1):
    if i in C:
        pass
    else:
        C[i]=0

for n in C:
    print(C[n])



Failing test case input:
7
2 2 2 5 5 6

Expected output:
0
3
0
0
2
1
0


Actual output:
3
2
1
0
0
0
0


Fixed submission (verdict: Accepted):
def input_int_list():
    return [int(thing) for thing in input().split(" ")]

def int_input():
    return int(input())


import collections
N = int_input()
A_list = input_int_list()
C = collections.Counter(A_list)
for i in range(1, N+1):
    if i in C:
        pass
    else:
        C[i] = 0

for n in range(1,N+1):
    print(C[n])
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = list(map(int, input().split()))
c = [0 for _ in range(N+1)]

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

Failing test case input:
7
2 2 3 7 5 2

Expected output:
0
3
1
0
1
0
1


Actual output:
0
3
1
0
1
0
1
0


Fixed submission (verdict: Accepted):
N = int(input())
A = list(map(int, input().split()))
c = [0 for _ in range(N)]

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import Counter
n = int(input())
a = [int(x) for x in input().split()]
a_ = [int(x) for x in range(1, n+1)]
a += a_
a_count = Counter(a)
for i in range(n):
    print(a_count[i+1])

Failing test case input:
7
2 1 2 5 2 7

Expected output:
1
3
0
0
1
0
1


Actual output:
2
4
1
1
2
1
2


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
print(a)

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


Failing test case input:
7
2 2 3 5 5 6

Expected output:
0
2
1
0
2
1
0


Actual output:
[2, 2, 3, 5, 5, 6]
0
2
1
0
2
1
0


Fixed submission (verdict: Accepted):
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]

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
A=list(map(int, input().split()))

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

Failing test case input:
5
1 4 1 5

Expected output:
2
0
0
1
1


Actual output:
2
0
0
1


Fixed submission (verdict: Accepted):
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

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
N =int(input())
A =list(map(int,input().split()))
l =[0]*N
for i in A:
  l[i-1]+=1
print(l)

Failing test case input:
7
1 3 2 6 1 6

Expected output:
2
1
1
0
0
2
0


Actual output:
[2, 1, 1, 0, 0, 2, 0]


Fixed submission (verdict: Accepted):
N =int(input())
A =list(map(int,input().split()))
l =[0]*N
for i in A:
  l[i-1]+=1
print(*l,sep="\n")
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import sys
from collections import Counter
from typing import Callable, NoReturn, Tuple


def main() -> NoReturn:
    scan: Callable[[], str] = sys.stdin.readline

    n: int = int(scan().rstrip())
    a: Tuple[int] = tuple(int(a_i) for a_i in scan().rstrip().split())

    count: Counter = Counter(a)

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


if __name__ == '__main__':
    main()


Failing test case input:
7
1 2 2 1 2 4

Expected output:
2
3
0
1
0
0
0


Actual output:
0
2
3
0
1
0
0


Fixed submission (verdict: Accepted):
import sys
from collections import Counter
from typing import Callable, NoReturn, Tuple


def main() -> NoReturn:
    scan: Callable[[], str] = sys.stdin.readline

    n: int = int(scan().rstrip())
    a: Tuple[int] = tuple(int(a_i) for a_i in scan().rstrip().split())

    count: Counter = Counter(a)

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


if __name__ == '__main__':
    main()

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
n = int(input())
A = list(map(int, input().split()))
cnt = collections.Counter(A)
for i in range(1,n):
  print(cnt[i])

Failing test case input:
7
1 2 2 1 2 4

Expected output:
2
3
0
1
0
0
0


Actual output:
2
3
0
1
0
0


Fixed submission (verdict: Accepted):
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])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import Counter
n =int(input())
a = list(map(int, input().split()))
s = Counter(a)
for v in s.values():
    print(v)
for i in range(n - len(s)):
    print(0)

Failing test case input:
7
2 3 2 4 4 6

Expected output:
0
2
1
2
0
1
0


Actual output:
2
1
2
1
0
0
0


Fixed submission (verdict: Accepted):
from collections import Counter
n =int(input())
a = list(map(int, input().split()))
s = Counter(a)
ans = [0] * n
for k, v in s.items():
    ans[k - 1] = v
for i in ans:
    print(i)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = list(map(int, input().split()))
tm = 0

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

Failing test case input:
7
2 5 1 4 3 7

Expected output:
1
1
1
1
1
0
1


Actual output:
1
1
1
1
1
0


Fixed submission (verdict: Accepted):
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)
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
N = int(input())
A = [int(i) for i in input().split()] 
c = collections.Counter(A)
c = c.most_common()
for i in range(N):
  try:
    tmp = c[i][1]
    print(tmp)
  except:
    print(0)

Failing test case input:
7
2 1 2 4 2 7

Expected output:
1
3
0
1
0
0
1


Actual output:
3
1
1
1
0
0
0


Fixed submission (verdict: Accepted):
import collections
N = int(input())
A = [int(i) for i in input().split()]
c = collections.Counter(A)
c = c.most_common()
c.sort()
cnt = 0
for i in range(N):
  try:
    num = c[cnt][0]
    tmp = c[cnt][1]
    if num == i+1:
      print(tmp)
      cnt += 1
    else:
      print(0)
  except:
    print(0)

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a = [int(i) for i in input().split()]
A = [0 for i in range(n)]
print(A)
for aa in a:
    A[int(aa)-1]+=1
for aaa in A:
    print(aaa)

Failing test case input:
10
1 1 1 1 1 2 1 1 1

Expected output:
8
1
0
0
0
0
0
0
0
0


Actual output:
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
8
1
0
0
0
0
0
0
0
0


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a_list = map(int, input().split())

ans_dict = {}
for a in a_list:
    if not(a in ans_dict):
        ans_dict[a] = 0
    ans_dict[a] += 1

for i in range(1, n+1):
    if not(i in ans_dict):
        print(0)
    else:
        print(ans_dict[a])

Failing test case input:
5
2 1 2 5

Expected output:
1
2
0
0
1


Actual output:
1
1
0
0
1


Fixed submission (verdict: Accepted):
n = int(input())
a_list = map(int, input().split())

ans_dict = {}
for a in a_list:
    if not(a in ans_dict):
        ans_dict[a] = 0
    ans_dict[a] += 1

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for aa in a:
  ans[aa-1]+=1
print(ans,sep='\n')

Failing test case input:
5
1 4 4 3

Expected output:
1
0
1
2
0


Actual output:
[1, 0, 1, 2, 0]


Fixed submission (verdict: Accepted):
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for aa in a:
  ans[aa-1]+=1
for an in ans:
  print(an)
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
alist=list(map(int,input().split()))

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

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

Failing test case input:
7
2 2 7 1 5 6

Expected output:
1
2
0
0
1
1
1


Actual output:
{2: 2, 7: 1, 1: 1, 5: 1, 6: 1}
1
2
0
0
1
1
1


Fixed submission (verdict: Accepted):
N=int(input())
alist=list(map(int,input().split()))

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


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
N = int(input())
A =[int(a) for a in input().split()]
def f():
    d = collections.defaultdict(int)
    for i, e in enumerate(A):
        d[e] += 1
    for key in range(1, N+1):
        print(d[key])


Failing test case input:
5
1 1 2 5

Expected output:
2
1
0
0
1


Actual output:

Fixed submission (verdict: Accepted):
import collections
N = int(input())
A =[int(a) for a in input().split()]
def f():
    d = collections.defaultdict(int)
    for i, e in enumerate(A):
        d[e] += 1
    for key in range(1, N+1):
        print(d[key])
f()

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n=int(input())
a=list(map(int,input().split()))
ans=[0]*n
for i in range(n-1):
    ans[a[i]-1] += 1
for i in range(n-1):
    print(ans[i])

Failing test case input:
7
2 2 3 3 3 2

Expected output:
0
3
3
0
0
0
0


Actual output:
0
3
3
0
0
0


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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    import collections

    C = collections.Counter(A)
    print(C[1])
    for a in A:
        try:
            print(C[a+1])
        except:
            print(0)


if __name__ == '__main__':
    main()


Failing test case input:
7
2 2 6 2 4 7

Expected output:
0
3
0
1
0
1
1


Actual output:
0
0
0
1
0
0
0


Fixed submission (verdict: Accepted):
def main():
    N = int(input())
    A = list(map(int, input().split()))

    import collections

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

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


if __name__ == '__main__':
    main()

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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')


Failing test case input:
7
1 4 3 4 7 6

Expected output:
1
0
1
2
0
1
1


Actual output:
[0, 0, 0, 0, 0, 0, 0]
1
0
1
2
0
1
1


Fixed submission (verdict: Accepted):
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')
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N=int(input())
X=[0]*N
for a in map(int,input().split()):
  X[a-1]+=1
for i in range(N-1):
  print(X[i])

Failing test case input:
5
4 1 3 5

Expected output:
1
0
1
1
1


Actual output:
1
0
1
1


Fixed submission (verdict: Accepted):
N=int(input())
X=[0]*N
for a in map(int,input().split()):
  X[a-1]+=1
for i in range(N):
  print(X[i])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))
a = [0] + a
cnt = defaultdict(lambda :0)

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

for i in a:
    print(cnt[i - 1])
    cnt[i - 1] = 0


Failing test case input:
7
2 1 2 4 2 7

Expected output:
1
3
0
1
0
0
1


Actual output:
1
3
1
0
1
0
1


Fixed submission (verdict: Accepted):
from collections import defaultdict
n = int(input())
a = list(map(int,input().split()))

cnt = defaultdict(lambda :0)
for i in a:
    cnt[i] += 1

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

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


Failing test case input:
5
1 2 4 5

Expected output:
1
1
0
1
1


Actual output:
1
1
0
1


Fixed submission (verdict: Accepted):

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections
n = int(input())
a = collections.Counter(list(map(int, input().split())))

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


Failing test case input:
7
1 2 3 4 5 4

Expected output:
1
1
1
2
1
0
0


Actual output:
1
1
2
1
0
0


Fixed submission (verdict: Accepted):
import collections
n = int(input())
a = collections.Counter(list(map(int, input().split())))

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
N = int(input())
A = [0, 0] + [int(x) for x in input().split()]

buka = [0] * (N + 1)

for i in range(2, N + 1):
    buka[A[i]] += 1
    print("A[{}] = {}".format(i, A[i]))

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

Failing test case input:
7
2 2 4 2 3 7

Expected output:
0
3
1
1
0
0
1


Actual output:
A[2] = 2
A[3] = 2
A[4] = 4
A[5] = 2
A[6] = 3
A[7] = 7
0
3
1
1
0
0
1


Fixed submission (verdict: Accepted):
N = int(input())
A = [0, 0] + [int(x) for x in input().split()]

buka = [0] * (N + 1)

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

for i in range(1, N + 1):
    print(buka[i])
Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
A = list(map(int, input().split()))
ans = [0 for i in range(n)]
for i in range(n-1):
    ans[A[i]-1] += 1

print(ans)


Failing test case input:
7
1 2 3 4 1 6

Expected output:
2
1
1
1
0
1
0


Actual output:
[2, 1, 1, 1, 0, 1, 0]


Fixed submission (verdict: Accepted):
n = int(input())
A = list(map(int, input().split()))
ans = [0 for i in range(n)]
for i in range(n-1):
    ans[A[i]-1] += 1

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

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
n = int(input())
a_list = [int(i) for i in input().split()]

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

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

Failing test case input:
7
2 2 2 5 2 6

Expected output:
0
4
0
0
1
1
0


Actual output:
[0, 0, 0, 0, 0, 0, 0]
0
4
0
0
1
1
0


Fixed submission (verdict: Accepted):
n = int(input())
a_list = [int(i) for i in input().split()]
nl = [0 for i in range(n)]
for a in a_list:
    nl[a-1] += 1
for i in nl:
    print("{}".format(i))

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
import collections

def main(N, A):
    c = collections.Counter(A)
    return c.values()

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    
    
    ans = main(N, A)
    [print(i) for i in ans]
    [print(0) for i in range(N - len(ans))]

Failing test case input:
7
1 2 2 4 1 6

Expected output:
2
2
0
1
0
1
0


Actual output:
2
2
1
1
0
0
0


Fixed submission (verdict: Accepted):
import collections

def main(N, A):
    c = collections.Counter(A)
    [print(c[i+1]) for i in range(max(c.keys()))]
    [print(0) for i in range(max(c.keys()), N)]

if __name__ == '__main__':
    N = int(input())
    A = list(map(int, input().split()))
    
    
    main(N, A)

Problem: p02707
Buggy submission (PyPy3 (7.3.0), verdict: Wrong Answer):
import collections

n = int(input())

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

c = collections.Counter(l)

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

Failing test case input:
7
2 2 4 3 3 7

Expected output:
0
2
2
1
0
0
1


Actual output:
0
2
2
0
1
1
0


Fixed submission (verdict: Accepted):
import collections

n = int(input())

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

c = collections.Counter(l)

print(c[1])
for i,value in enumerate(l):
  print(c[i+2])

Problem: p02707
Buggy submission (Python (3.8.2), verdict: Wrong Answer):


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

ans = []

ans = [0] * member
print(ans)

for j in range(1,member):
  k = mem_number.count(j)
  ans[j-1] = k

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


Failing test case input:
5
2 1 2 5

Expected output:
1
2
0
0
1


Actual output:
[0, 0, 0, 0, 0]
1
2
0
0
0


Fixed submission (verdict: Accepted):

from collections import Counter

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

ans = []

ans = [0] * member

mycounter = Counter(mem_number)

for i in range(member):
  ans[i] = mycounter[i+1]
  print(ans[i])