Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
ListH = list(map(int, input().split()))

#ListH.sort(reverse=True)
sum=0

if N<=K:
    print(0)
else:
     
for i in range(N-K):
    sum+=ListH[i]

print(sum)

Fixed submission:
N, K = map(int, input().split())
ListH = list(map(int, input().split()))


if N<=K:
    print(0)
else:
    ListH.sort()
    sum=0
    for i in range(N-K):
        sum+=ListH[i]

    print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

#ListH.sort(reverse=True)
sum=0

if N > K:
    for i in range(K):
        ListH.remove(max(ListH))
        
    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Fixed submission:
N, K = map(int, input().split())
ListH = list(map(int, input().split()))


if N<=K:
    print(0)
else:
    ListH.sort()
    sum=0
    for i in range(N-K):
        sum+=ListH[i]

    print(sum)

Buggy python submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH.sort(reverse=True)
sum=0

if N > K:
    for i in range(K):
        ListH.pop(i)
        
    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Fixed submission:
N, K = map(int, input().split())
ListH = list(map(int, input().split()))


if N<=K:
    print(0)
else:
    ListH.sort()
    sum=0
    for i in range(N-K):
        sum+=ListH[i]

    print(sum)

Buggy python submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH=sorted(ListH,reverse=True)
sum=0

if N > K:
    for i in range(K):
        ListH.pop(i)

    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Fixed submission:
N, K = map(int, input().split())
ListH = list(map(int, input().split()))


if N<=K:
    print(0)
else:
    ListH.sort()
    sum=0
    for i in range(N-K):
        sum+=ListH[i]

    print(sum)

Buggy python submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH=sorted(ListH,reverse=True)

if N > K:
    for i in range(K):
        ListH.pop(i)

    sum=0
    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Fixed submission:
N, K = map(int, input().split())
ListH = list(map(int, input().split()))


if N<=K:
    print(0)
else:
    ListH.sort()
    sum=0
    for i in range(N-K):
        sum+=ListH[i]

    print(sum)

Buggy python submission (verdict: Runtime Error):
N,K=[int(s) for s in input().split(" ")]
ListH=[int(s) for s in input().split(" ")]

ListH=sorted(ListH,reverse=True)

if N > K:
    for i in range(K):
        ListH.pop(i)

    sum=0
    for i in range(N-K):
        sum+=ListH[i]
else:
    sum=0
    
print(sum)

Fixed submission:
N, K = map(int, input().split())
ListH = list(map(int, input().split()))


if N<=K:
    print(0)
else:
    ListH.sort()
    sum=0
    for i in range(N-K):
        sum+=ListH[i]

    print(sum)
Buggy python submission (verdict: Runtime Error):
N=int()input()
S=input()
bit=0
for i in range(0,N):
  Check=S[0:i]
  Ans=S[i:N]
  if Check==Ans:
    bit+=1
print("Yes" if bit>=1 else "No")

Fixed submission:
N=int(input())
S=list(str(input()))

S_right=[]
S_left=[]
for i in range(0,(N//2)):
    S_left.append(S[i])
for i in range((N//2),N):
    S_right.append(S[i])
    
S_left=("").join(S_left)
S_right=("").join(S_right)

print("Yes" if S_left==S_right else "No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(s) for s in input().split(" ")]

Ans=[]
for i in range(1,N+1):
    for j in range(N):
        if i==A[j]:
            Ans.append(str(j+1))

Ans2=(" ").join(Ans)
print(Ans2)

Fixed submission:
N=int(input())
A=[int(s) for s in input().split(" ")]

Ans=[]
Ans2=[]
for i in range(N):
    Ans=[A[i],i+1]
    Ans2.append(Ans)
    Ans=[]

Ans2.sort()

Ans3=[]
for i in range(N):
    Ans3.append(str(Ans2[i][1]))
    

print((" ").join(Ans3))
Buggy python submission (verdict: Runtime Error):
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
count=0
for i in range(N-1):
    if H[i]-H[i+1] >= 0:
        count+=1
    else:
        count=0
    if count > count_max:
        count_max=count
        X=j

print(count_max)

Fixed submission:
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
count=0
for i in range(N-1):
    if H[i]-H[i+1] >= 0:
        count+=1
        if count > count_max:
            count_max=count
    else:
        count=0

print(count_max)

Buggy python submission (verdict: Runtime Error):
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
count=0
for i in range(N-1):
    if H[i]-H[i+1] >= 0:
        count+=1
    else:
        count=0
    if count > count_max:
        count_max=count
        X=j

print(count_max)

Fixed submission:
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
count=0
for i in range(N-1):
    if H[i]-H[i+1] >= 0:
        count+=1
        if count > count_max:
            count_max=count
    else:
        count=0

print(count_max)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
for j in range(N):
    count=0
    for i in range(j,N-1):
        if H[i]-H[i+1] >= 0:
            count+=1
        else:
            break
    if count > count_max:
        count_max=count
        X=j

print(count_max)

Fixed submission:
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
count=0
for i in range(N-1):
    if H[i]-H[i+1] >= 0:
        count+=1
        if count > count_max:
            count_max=count
    else:
        count=0

print(count_max)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
for j in range(N):
    count=0
    for i in range(j,N-1):
        if H[i] >= H[i+1]:
            count+=1
        else:
            break
    if count > count_max:
        count_max=count
        X=j

print(count_max)
            

Fixed submission:
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
count=0
for i in range(N-1):
    if H[i]-H[i+1] >= 0:
        count+=1
        if count > count_max:
            count_max=count
    else:
        count=0

print(count_max)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
for j in range(N):
    count=0
    for i in range(j,N-1):
        if H[i] >= H[i+1]:
            count+=1
            #print(j,H[i],H[i+1],count)
        else:
            break
        if count > count_max:
                count_max=count
                X=j

print(count_max)
            

Fixed submission:
N=int(input())
H=[int(s) for s in input().split()]

count_max=0
count=0
for i in range(N-1):
    if H[i]-H[i+1] >= 0:
        count+=1
        if count > count_max:
            count_max=count
    else:
        count=0

print(count_max)
Buggy python submission (verdict: Runtime Error):
A=input("A:")
B=input("B:")
C=input("C:")

A=int(A)
B=int(B)
C=int(C)

while B<A:
    B=B+1
    C=C-1
    if C==0:
        break

print(C)

Fixed submission:
Water=input()
Water2=Water.split(" ")

A=int(Water2[0])
B=int(Water2[1])
C=int(Water2[2])

while B<A:
    B=B+1
    C=C-1
    if C==0:
        break

print(C)
Buggy python submission (verdict: Runtime Error):
A=input("")
B=input("")

A=int(A)
B=int(B)

K=0
Ans=0
for K in range(-100000,100000,1):
    if abs(A-K)==abs(B-K):
        print(K)
        Ans=K
        break
if Ans==0:
    print("impossible")

Fixed submission:
A,B=map(int,input().split(" "))

K=(A+B)/2
print(int(K) if int(K)==K else "IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
N=int(input())
d=[int(s) for s in input().split(" ")]

d.sort()

if (N//2)%2==0:
    print(0)
else:
    K=d[(N//2)]-d[N//2-1]
    print(K

Fixed submission:
N=int(input())
D=[int(s) for s in input().split()]

D=sorted(D)
sum=[]
count=0
for i in reversed(range(len(D))):
    sum.append(D.pop(i))
    if len(sum) == len(D):
        Ans=len(sum)
        break
for i in range(D[Ans-1],sum[Ans-1],1):
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
N,L=map(int,input().split(" "))


A=[]
for i in range(N):
    a=L+i
    A.append(a)

T=0
for i in range(N):
    T+=A[i]    

if T>=0:
    A.pop(0)
else:
    A.pop(N)

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

print(T2)


Fixed submission:
N,L=map(int,input().split())

Apple_List1=[]
Apple_List2=[]
for i in range(N):
    Apple_List1.append(L+i)
    Apple_List2.append(abs(L+i))

#Apple_List=abs(Apple_List)
Apple_List2.sort()

flag=0
if Apple_List2[0] in Apple_List1:
    flag=1
elif -Apple_List2[0] in Apple_List1:
    flag=-1
    
print(sum(Apple_List1)-flag*Apple_List2[0])
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split(" "))
L=[int(s) for s in input().split(" ")]

Sum=0
Count=0
while Sum<=X and Count<=N+1:
    Sum+=L[Count]
    Count+=1
    
print(Count)

Fixed submission:
N,X=map(int,input().split(" "))
L=[int(s) for s in input().split(" ")]

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

count=0
for i in bound_List:
    if i<=X:
        count+=1
        
print(count)

Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split(" "))
L=[int(s) for s in input().split(" ")]

Sum=0
Count=0
while Sum<=X and Count<N+1:
    Sum+=L[Count]
    Count+=1
    
print(Count)

Fixed submission:
N,X=map(int,input().split(" "))
L=[int(s) for s in input().split(" ")]

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

count=0
for i in bound_List:
    if i<=X:
        count+=1
        
print(count)
Buggy python submission (verdict: Runtime Error):
import collections
N,M=map(int,input().split(" "))
List=[input().split(" ") for _ in range(M)]

List3=[]
for i in range(M):
    List2=[x for x in range(int(List[i][0]),int(List[i][1])+1)]
    for j in range(len(List2)):
        List3.append(List2[j])
List3.sort()
List4=list(set(List3))

Ans=[0]*len(List3)
for i in range(len(List3)):
    Ans[List3[i]-1]+=1

count=0    
for i in range(len(Ans)):
    if Ans[i]==M:
        count+=1
print(count)

Fixed submission:
n, m = list(map(int, input().split()))
 
R, L = [], []
for i in range(m):
    l, r = list(map(int, input().split()))
    R.append(r)
    L.append(l)
  
print(max(min(R) - max(L) + 1, 0))

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split(" "))
List=[input().split(" ") for _ in range(M)]

Ans=0
for i in range(1,N+1):
    count=0
    for j in range(M):
        if int(List[j][0])<=i<=int(List[j][1]):
            count+=1
    if count==M:
        Ans+=1

print(Ans)

Fixed submission:
n, m = list(map(int, input().split()))
 
R, L = [], []
for i in range(m):
    l, r = list(map(int, input().split()))
    R.append(r)
    L.append(l)
  
print(max(min(R) - max(L) + 1, 0))
Buggy python submission (verdict: Runtime Error):
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]


if Ans[0]>12:
    if Ans[1]>12:
        print("NA")
    elif Ans[1]==0:
        print("NA")
    else:
        print("YYMM")
elif Ans[0]==0:
    print("NA")
else:
    if A[1]>12:
        print("MMYY")
    elif A[1]==0:
        print("NA")
    else:
        print("AMBIGUOUS")

Fixed submission:
S=str(input())

Ans=[int(S[0]+S[1]),int(S[2]+S[3])]

if 0<Ans[0]<13 and 0<Ans[1]<13:
    print("AMBIGUOUS")
elif 0<Ans[0]<13:
    print("MMYY")
elif 0<Ans[1]<13:
    print("YYMM")
else:
    print("NA")
Buggy python submission (verdict: Runtime Error):
N=int(input())
P=[int(input()) for _ in range(N)]
P=sorted(P)
P[N-1]=P[N-1]/2
print(int(sum(P))

Fixed submission:
N=int(input())
P=[int(input()) for _ in range(N)]
P=sorted(P)
P[N-1]=P[N-1]/2
print(int(sum(P)))
Buggy python submission (verdict: Runtime Error):
X,Y=int(input().split())
print((X+Y)//2)

Fixed submission:
X,Y=map(int,input().split())
print(X+Y//2)

Buggy python submission (verdict: Runtime Error):
X,Y=int(input())
print((X+Y)//2)

Fixed submission:
X,Y=map(int,input().split())
print(X+Y//2)

Buggy python submission (verdict: Runtime Error):
X,Y=int(input())
print(X+Y//2)

Fixed submission:
X,Y=map(int,input().split())
print(X+Y//2)
Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())
list=[input() for _ in range(N)]

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y <= T:
        list1.append(X)
print(min(list1))

Fixed submission:
N,T=map(int,input().split())
list=[input() for _ in range(N)]

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y <= T:
        list1.append(X)
print(min(list1) if list1 != [] else "TLE")

Buggy python submission (verdict: Runtime Error):
N,T=map(int,input().split())
list=[input() for _ in range(N)]

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y < T:
        list1.append(X)
print(min(list1))

Fixed submission:
N,T=map(int,input().split())
list=[input() for _ in range(N)]

list1=[]
for i in range(N):
    X,Y=map(int,list[i].split(" "))
    if Y <= T:
        list1.append(X)
print(min(list1) if list1 != [] else "TLE")
Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())

list=[]
if X==1:
    list.append(1)
for i in range(1,X):
    for j in range(2,X):
        if i**j <= X:
                list.append(i**j)
print(max(list))

Fixed submission:
X=int(input())

list=[]
if X==1:
    list.append(1)
for i in range(1,X):
    for j in range(2,X):
        if i**j <= X:
                list.append(i**j)
        else:
            break
print(max(list))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

print(-(-((a+b)//2))

Fixed submission:
a,b=map(int,input().split())

print(-(-(a+b)//2))

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

print(-~((a+b)/2))

Fixed submission:
a,b=map(int,input().split())

print(-(-(a+b)//2))
Buggy python submission (verdict: Runtime Error):
list=[s for s in input()]
med=len(list)
print(list[0]+str(med)+list[med])

Fixed submission:
list=[s for s in input()]
med=len(list)
med2=med-2
print(list[0]+str(med2)+list[med-1])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

A=1
for i in range(1,N+1):
    A=A*i
print(A%(7+10**9))


Fixed submission:
N=int(input())

A=1
for i in range(1,N+1):
    A=A*i
    A=A%(7+10**9)
print(A)
Buggy python submission (verdict: Runtime Error):
N,K,X,Y=[input() for _ in range(4)]
if N-K>0:    
    print(X*K+Y*(N-K))
else:
    print(X*N)

Fixed submission:
list=[input() for i in range(4)]
N,K,X,Y=map(int,list)

print(X*K+Y*(N-K) if N > K else X*N)

Buggy python submission (verdict: Runtime Error):
N,K,X,Y=[input() for _ in range(4)]
if N-K>=0:    
    print(X*K+Y*(N-K))
else:
    print(X*N)

Fixed submission:
list=[input() for i in range(4)]
N,K,X,Y=map(int,list)

print(X*K+Y*(N-K) if N > K else X*N)
Buggy python submission (verdict: Runtime Error):
s = [i for i in input()]

for i in s:
    if i == 'B':
        s.remove(i)
        s.remove(tmp)  
    tmp = i

if s[0] == 'B':
    s.remove('B')
print(''.join(s))

Fixed submission:

n = input()
 
res = []
 
for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()
 
print(''.join(res))

Buggy python submission (verdict: Runtime Error):
s = [i for i in input()]

for i in s:
    if i == 'B':
        s.remove(i)
        s.remove(tmp)  
    tmp = i

if s[0] == 'B':
    s.remove('B')
print("".join(s))

Fixed submission:

n = input()
 
res = []
 
for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()
 
print(''.join(res))

Buggy python submission (verdict: Runtime Error):
s = [i for i in input()]

for i in s:
    if i == 'B':
        s.remove(i)
        s.remove(tmp)  
    tmp = i

if s[0] == 'B':
    s.remove('B')
print("".join(s))

Fixed submission:

n = input()
 
res = []
 
for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()
 
print(''.join(res))

Buggy python submission (verdict: Runtime Error):
s = [i for i in input()]

for i in s:
    if i == 'B':
        s.remove(i)
        s.remove(tmp)  
    tmp = i

if s[0] == 'B':
    s.remove('B')
print("".join(s))

Fixed submission:

n = input()
 
res = []
 
for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()
 
print(''.join(res))

Buggy python submission (verdict: Runtime Error):
s = [i for i in input()]

for i in s:
    if i == 'B':
        s.remove(i)
        s.remove(tmp)  
    tmp = i

if s[0] == 'B':
    s.remove('B')
print("".join(s))


Fixed submission:

n = input()
 
res = []
 
for char in n:
    if char == '0':
        res.append(char)
    elif char == '1':
        res.append(char)
    elif char == 'B':
        if len(res) > 0:
            res.pop()
 
print(''.join(res))
Buggy python submission (verdict: Runtime Error):
W:int
S:int

if W >= S:
  print('unsafe')
else:
  print('safe')

Fixed submission:
S, W = [int(x) for x in input().split()]
 
if W >= S:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
if W >= S:
  print('unsafe')
else:
  print('safe')

Fixed submission:
S, W = [int(x) for x in input().split()]
 
if W >= S:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
if W >= S:
  print("unsafe")
else:
  print("safe")

Fixed submission:
S, W = [int(x) for x in input().split()]
 
if W >= S:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
if W > S:
  return "unsafe"
else:
  return "safe"

Fixed submission:
S, W = [int(x) for x in input().split()]
 
if W >= S:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
if W >= S:
  return "unsafe"
else:
  return "safe"

Fixed submission:
S, W = [int(x) for x in input().split()]
 
if W >= S:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Runtime Error):
a = map(int, input().split())
s = list(map(int, input().split()))

print(len(set(s)))


Fixed submission:
a = int(input())
s=[input() for i in range(a)]

print(len(set(s)))
Buggy python submission (verdict: Runtime Error):
takahashi_h, takahashi_a, aoki_h, aoki_a = map(int, input().split())

if takahashi_h // aoki_a < aoki_h // takahashi_a:
    print("Yes")
elif takahashi_h // aoki_a > aoki_h // takahashi_a:
    print("No")
else:
    takahashi_h = takahashi_h - (aoki_a * (takahashi_h // aoki_a))
    aoki_h = aoki_h - (takahashi_a * (aoki_h // takahashi_a))
    
    if aoki_h > 0 and takahashi_h == 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
S, W = map(int, input().split())
if S > W:
    print("safe")
else:
    print("unsafe")

Buggy python submission (verdict: Runtime Error):
takahashi_h, takahashi_a, aoki_h, aoki_a = map(int, input().split())

if takahashi_h // aoki_a > aoki_h // takahashi_a:
    print("Yes")
elif takahashi_h // aoki_a < aoki_h // takahashi_a:
    print("No")
else:
    takahashi_h = takahashi_h - (aoki_a * (takahashi_h // aoki_a))
    aoki_h = aoki_h - (takahashi_a * (aoki_h // takahashi_a))
    
    if aoki_h > 0 and takahashi_h == 0:
        print("No")
    else:
        print("Yes")

Fixed submission:
S, W = map(int, input().split())
if S > W:
    print("safe")
else:
    print("unsafe")
Buggy python submission (verdict: Runtime Error):
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")

Fixed submission:
# 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")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
 
for i in range(1, N+1):
    print(As.count(i))
    As = [a for a in As if a != i]

Fixed submission:
# 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")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))

for i in range(1, N+1):
    print(As.count(i))
    As = [a for a in As if a != i]

Fixed submission:
# 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")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))

for i in range(1, N+1):
    print(As.count(i))
    As = [a for a in As if a != i]

Fixed submission:
# 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")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().strip().split()))

for i in range(1, N+1):
    num_sub = As.count(i)
    As = [a for a in As if a != i]
    print(num_sub)

Fixed submission:
# 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")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().strip().split()))

for i in range(1, N+1):
    num_sub = As.count(i)
    print(num_sub)

Fixed submission:
# 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")
Buggy python submission (verdict: Runtime Error):
X, Y, num_red_apple, num_green_apple, num_apple = map(int, input().strip().split())
red_apples = list(map(int, input().strip().split()))
green_apples = list(map(int, input().strip().split()))
apples = list(map(int, input().strip().split()))

good_apples = []
for i in range(1, X+1):
    good_apples.append(sorted(red_apples)[-i])

for i in range(1, Y+1):
    good_apples.append(sorted(green_apples)[-i])

while(1):
    if max(apples) > min(good_apples):
        good_apple = apples.pop(apples.index(max(apples)))
        good_apples.remove(min(good_apples))
        good_apples.append(good_apple)
    else:
        break
    
print(sum(good_apples))
        

Fixed submission:
word = input()

def Coffee(word):
  if word[2] == word[3] and word[4] == word[5]:
    print("Yes")
  else:
    print("No")
      
Coffee(word)

Buggy python submission (verdict: Runtime Error):
X, Y, num_red_apple, num_green_apple, num_apple = map(int, input().strip().split())
red_apples = list(map(int, input().strip().split()))
green_apples = list(map(int, input().strip().split()))
apples = list(map(int, input().strip().split()))

good_apples = []
for i in range(1, X+1):
    good_apples.append(sorted(red_apples)[-i])

for i in range(1, Y+1):
    good_apples.append(sorted(green_apples)[-i])

while(1):
    if max(apples) > min(good_apples):
        good_apple = apples.pop(apples.index(max(apples)))
        good_apples.remove(min(good_apples))
        good_apples.append(good_apple)
    else:
        break
    
print(good_apples)

Fixed submission:
word = input()

def Coffee(word):
  if word[2] == word[3] and word[4] == word[5]:
    print("Yes")
  else:
    print("No")
      
Coffee(word)