Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N = input()
N_len = len(N)
num = 0

for i in range(N_len):
  num += int(N(i))
  
if (num % 9 == 0):
  print("yes")
else:
  print("no")


Fixed submission:
N = input()

num = 0

for n in N:
  num += int(n)
  
if num % 9 == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
import math

input_ = input().split()

N = int(input_[0])
D = float(input_[1])

num = 0

for i in range(N):
  x_i,y_i = map(float,input().split())
  
  if(math.sqrt(x_i**2 + y_i**2p) <= D):
    num += 1
    
print(num)
  
  

Fixed submission:
import math

input_ = input().split()

N = int(input_[0])
D = float(input_[1])

num = 0

for i in range(N):
  x_i,y_i = map(float,input().split())
  
  if(math.sqrt(x_i**2 + y_i**2) <= D):
    num += 1
    
print(num)
Buggy python submission (verdict: Runtime Error):
N = int(input())

AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(N):
  s = input()
  if(s == "AC"):
    AC += 1
  elif(s == "WA"):
    WA += 1
  elif(s == "TLE"):
    TLE += 1
  elif(s == "RE"):
    RE += 1
    
print("AC x {}".format(AC))
print("WA x {}".format(WA)
print("TLE x {}".format(TLE))
print("RE x {}".format(RE))


  

Fixed submission:
N = int(input())

AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(N):
  s = input()
  if(s == "AC"):
    AC += 1
  elif(s == "WA"):
    WA += 1
  elif(s == "TLE"):
    TLE += 1
  elif(s == "RE"):
    RE += 1
    
print("AC x {}".format(AC))
print("WA x {}".format(WA))
print("TLE x {}".format(TLE))
print("RE x {}".format(RE))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
tmp = 0
while n > 0:
    tmp += (n % 10)
    n = n // 10
if tmp % 9 == 0:
    ans = 'Yes'
else:
    ans ='No'
print(ans)

Fixed submission:
n=input()
n_arr = [int(n[i]) for i in range(len(n))]
tmp = 0
for i in n_arr:
    tmp += i
if tmp % 9 == 0:
    ans = 'Yes'
else:
    ans ='No'
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(i) for i in input().split()]
ans=1
for i in a:
    ans *= i
if ans > 10 ** 18:
    ans = -1
print(ans)

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
ans=1
if 0 in a:
    ans = 0
else:
    for i in a:
        ans *= i
        if ans > 10 ** 18:
            ans = -1
            break
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ans = 0
for i in range(1,i+1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)

Fixed submission:
n=int(input())
ans = 0
for i in range(1,n+1):
    if i % 3 != 0 and i % 5 != 0:
        ans += i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,x,y=map(int, input().split())

_list=[]

for i in range(1,n):
    for j in range(i+1,n+1):
        if j<=x:
            tmp=j-i
            
        elif x<i and j<y:
            tmp=min(j-i,(i-x)+1+(y-j))
            
        elif y<=i:
            tmp=j-i

        elif i<=x and y<=j:
            tmp=j-i -(y-x-1)

        elif i<=x and x<j and j<y:
            tmp=min(j-i,(x-i)+1+(y-j))
        elif x<i and i<y and y<=j:
            tmp=min(j-i,(i-x)+1+(j-y))

        _list.append(tmp)

for k in range(1,n):
    print(_list.count(k))

Fixed submission:
n,x,y=map(int, input().split())

ans=[0]*(n-1)

for i in range(1,n):
    for j in range(i+1,n+1):
        if j<=x:
            tmp=j-i
            
        elif x<i and j<y:
            tmp=min(j-i,(i-x)+1+(y-j))
            
        elif y<=i:
            tmp=j-i

        elif i<=x and y<=j:
            tmp=j-i -(y-x-1)

        elif i<=x and x<j and j<y:
            tmp=min(j-i,(x-i)+1+(y-j))
        elif x<i and i<y and y<=j:
            tmp=min(j-i,(i-x)+1+(j-y))

        ans[tmp-1] += 1

for i in ans:
    print(i)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
for i in range(n-k+1):
    tmp=sum(p[i:i+k])
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Fixed submission:
s,t=map(str,input().split())
a,b=map(int,input().split())
u=input()
if u == s:
    a -= 1
else:
    b -= 1
print(a,b)
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
for i in range(n-k+1):
    tmp=sum(p[i:i+k])
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]

aSet=set(a)
if len(a) == len(aSet):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
tmp=sum(p[0,k])

for i in range(1,n-k+1):
    a=p[i-1]
    b=p[i+k]
    tmp=tmp-a+b
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Fixed submission:
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


tmp=sum(p[0:k])
Msum=tmp

for i in range(1,n-k+1):
    a=p[i-1]
    b=p[i+k-1]
    tmp=tmp-a+b
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
for i in range(n-k+1):
    tmp=sum(p[i:i+k])
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Fixed submission:
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


tmp=sum(p[0:k])
Msum=tmp

for i in range(1,n-k+1):
    a=p[i-1]
    b=p[i+k-1]
    tmp=tmp-a+b
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


Msum=0
for i in range(n-k+1):
    tmp=sum(p[i:i+k])
    Msum = max(tmp,Msum)

print((Msum+k)/2)

Fixed submission:
n,k=map(int,input().split())
p=[int(i) for i in input().split()]


tmp=sum(p[0:k])
Msum=tmp

for i in range(1,n-k+1):
    a=p[i-1]
    b=p[i+k-1]
    tmp=tmp-a+b
    Msum = max(tmp,Msum)

print((Msum+k)/2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(int((n-1)*n//2))

Fixed submission:
#(A-1)n+1　とB

A,B=map(int,input().split())
n=0
while (A-1)*n+1 <B:
    n += 1
print(n)
Buggy python submission (verdict: Runtime Error):
w = input()
s = w.split()

apple = int(s[0])
piece = int(s[1])


answer = ( 3 * apple + piece - (( 3 * apple + piece ) % 2 ) /2

print(answer)

Fixed submission:
w = input()
s = w.split()

apple = int(s[0])
piece = int(s[1])


answer = int(( 3 * apple + piece - (( 3 * apple + piece ) % 2 )) /2)

print(answer)
Buggy python submission (verdict: Runtime Error):
a=input().split('')
n=int(a[0])
x=int(a[1])
t=int(a[2])
f=x
m=t
while x<n:
  x=x+f
  t=t+m
print(t)


Fixed submission:
a=input().split(' ')
n=int(a[0])
x=int(a[1])
t=int(a[2])
f=x
m=t
while x<n:
  x=x+f
  t=t+m
print(t)
Buggy python submission (verdict: Runtime Error):
a=int(input())/9

if str(a)[-1]=='0':
  print('Yes')
else:
  print('NO')
    

Fixed submission:
a=int(input())%9
if a==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a=int(input())/9

if str(b)[-1]=='0':
  print('Yes')
else:
  print('NO')
    

Fixed submission:
a=int(input())%9
if a==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a=input()
b=int(a)/9
if str(b)[-1]=='0':
  print('Yes')
else:
  print('NO')
    

Fixed submission:
a=int(input())%9
if a==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a=input().split(' ')
m=len(a)
b=0
while b<m:
    if a[b]=='0':
        print(b)
    m=m+1

Fixed submission:
a=input().split(' ')
m=len(a)
b=0
while b<m:
    if a[b]=='0':
        print(b+1)
    b=b+1

Buggy python submission (verdict: Runtime Error):
a=input().split(' ')
m=len()
b=0
while b<m:
    if a[b]=='0':
        print(b)
    m=m+1

Fixed submission:
a=input().split(' ')
m=len(a)
b=0
while b<m:
    if a[b]=='0':
        print(b+1)
    b=b+1
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=input().split(' ')
m=0
s=1
while m<a:
    s=s*int(b[m])
    m=m+1
    if s>10**18:
        print(-1)
        break

else:
    print(s)

Fixed submission:
a=input().split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
print(a[0]*a[1])

Buggy python submission (verdict: Runtime Error):
a=input.split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
print(a[0]*a[1])

Fixed submission:
a=input().split(' ')
a[0]=int(a[0])
a[1]=int(a[1])
print(a[0]*a[1])
Buggy python submission (verdict: Runtime Error):
a=input()
i=0
while i<a:
    if a[i]=='?':
        print(end='D')

    else:
        print(end=str(a[i]))
    i=i+1

Fixed submission:
a=input()
i=0
while i<len(a):
    if a[i]=='?':
        print(end='D')

    else:
        print(end=str(a[i]))
    i=i+1

Buggy python submission (verdict: Runtime Error):
a=input()
i=0
while i<a:
    if a[i]='?':
        print(end='D')

    else:
        print(end=str(a[i]))
    i=i+1

Fixed submission:
a=input()
i=0
while i<len(a):
    if a[i]=='?':
        print(end='D')

    else:
        print(end=str(a[i]))
    i=i+1

Buggy python submission (verdict: Runtime Error):
a=input()
i=0
while i<a:
    if a[i]='?':
        print(end='D')

    else:
        print(end=str(a[i]))

Fixed submission:
a=input()
i=0
while i<len(a):
    if a[i]=='?':
        print(end='D')

    else:
        print(end=str(a[i]))
    i=i+1
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=input()
i=0
while i<a:
    print(end=str(b[i]))
    i=i+1
if len(b)>a:
    print(end='...')


Fixed submission:
a=int(input())
b=input()
i=0
while i<a and i<len(b):
    print(end=str(b[i]))
    i=i+1
if len(b)>a:
    print(end='...')
Buggy python submission (verdict: Runtime Error):
N, D = map(int,input().split())

for i in range(N):
    X, Y = map(int, input().split())
    A = ((X**2 + Y**2)**0.5)
    if A <= D:
        Z = Z + 1
print(Z)



Fixed submission:
N, D = map(int,input().split())
Z = 0
for i in range(N):
    X, Y = map(int, input().split())
    A = ((X**2 + Y**2)**0.5)
    if A <= D:
        Z = Z + 1
print(Z)
Buggy python submission (verdict: Runtime Error):
import sys
X, K, D = map(int,input().split())
cnt = 0
a = X
b = 0
tmp = 0
if X >= K*D:
  print(X - K*D)
  sys.exit()
if K % 2 == 0:
  tmp = int(X/D)
  if tmp% 2 == 0:
    a = X - D*tmp
  else:
    a = X - D*tmp + D
  b = a - D*2
else:
  tmp = int(X/D)
  if tmp% 2 == 1:
    a = X - D*tmp
  else:
    a = X - D*tmp + D
  b = a - D*2
print(min(abs(a),abs(b)))


Fixed submission:
S = input()
if "RRR" in S:
  print(3)
elif "RR" in S:
  print(2)
elif "R" in S:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N,K =map(int,input().split())
A =list(map(int,input().split()))
points = []
for i in range(K,N+1):
  point = 1
  for k in range(K):
    point *= A[i-k-1]
  points.append(point)
  if i > K:
    if points[i-K] > points[i-1-K]:
      print("Yes")
    else:
      print("No")



Fixed submission:
A,B,C = map(int,input().split())
K = int(input())
card = [[] for _ in range(7)]
card[0].append([A,B,C])

for i in range(K):
  if A >= B:
    B *= 2
  else:
    if B >= C:
      C*=2
if A < B and B < C:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,K =map(int,input().split())
A =list(map(int,input().split()))
points = []
for i in range(K,N+1):
  point = 1
  for k in range(K):
    point *= A[i-k-1]
  points.append(point)
  if i > K:
    if points[i-K] > points[i-1-K]:
      print("Yes")
    else:
      print("No")



Fixed submission:
N,K = map(int,input().split())
A = list(map(int,input().split()))
for i in range(K,N+1):
  if i > K:
    tmp1 = A[i-K-1]
    tmp2 = A[i-1]
    if tmp1 < tmp2:
      print('Yes')
    else:
      print('No')
Buggy python submission (verdict: Runtime Error):
5 3
50 100 80 120 80

Fixed submission:
N, K = map(int,input().split())
p = list(map(int,input().split()))
new = sorted(p)
sum = 0
for i in range(K):
  sum += new[i]
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
dp = [True]*(A[-1]+1)

for i in range(N-1):
  if dp[A[i]] == True:
    for j in range(A[i], max(A)+1,A[i]):
      dp[j] = False
    if A[i] != A[i+1]:
      cnt+=1
if dp[A[-1]] == True:
  cnt+=1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
dp = [True]*(A[-1]+1)

for i in range(N-1):
  if dp[A[i]] == True:
    for j in range(A[i], A[-1]+1,A[i]):
      dp[j] = False
    if A[i] != A[i+1]:
      cnt+=1
if dp[A[-1]] == True:
  cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
dp = [True]*(max(A)+1)

for i in range(N-1):
  if dp[A[i]] == True:
    for j in range(A[i], max(A)+1,A[i]):
      dp[j] = False
    if A[i] != A[i+1]:
      cnt+=1
if dp[A[-1]] == True:
  cnt+=1
print(cnt)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
dp = [True]*(A[-1]+1)

for i in range(N-1):
  if dp[A[i]] == True:
    for j in range(A[i], A[-1]+1,A[i]):
      dp[j] = False
    if A[i] != A[i+1]:
      cnt+=1
if dp[A[-1]] == True:
  cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
count = 0
for i in range(N):
  flag = False
  for j in range(N):
    if i != j:
      if A[i] % A[j] == 0:
        flag = True
        break
  if flag == False:
    count += 1
print(count)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
A.sort()
cnt = 0
dp = [True]*(A[-1]+1)

for i in range(N-1):
  if dp[A[i]] == True:
    for j in range(A[i], A[-1]+1,A[i]):
      dp[j] = False
    if A[i] != A[i+1]:
      cnt+=1
if dp[A[-1]] == True:
  cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N = int(input())
A = list(map(int,input().split()))
AA=1
a = pow(10,18)
for i in range(N):
  AA = AA * A[i]
  if AA == 0:
    print(0)
    sys.exit()
print(AA if AA <= a else -1)

Fixed submission:
import sys
N = int(input())
A = list(map(int,input().split()))
A.sort()
mul = A[0]
for i in range(1,N):
  mul *= A[i]
  if mul > 10**18:
    print(-1)
    sys.exit()
print(mul)

Buggy python submission (verdict: Time Limit Exceeded):
#import numpy as np
N = int(input())
A = list(map(int,input().split()))
#output = np.prod(A)
AA=1
for i in range(N):
  #print(A[i])
  AA = AA * A[i]
a = pow(10,18)
print(AA if abs(AA) <= a else -1)

Fixed submission:
import sys
N = int(input())
A = list(map(int,input().split()))
A.sort()
mul = A[0]
for i in range(1,N):
  mul *= A[i]
  if mul > 10**18:
    print(-1)
    sys.exit()
print(mul)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())
A = list(map(int,input().split()))
#output = np.prod(A)
AA=1
for i in range(N+1):
  #print(A[i])
  AA = AA * A[i]
a = pow(10,18)
print(AA if abs(AA) <= a else -1)

Fixed submission:
import sys
N = int(input())
A = list(map(int,input().split()))
A.sort()
mul = A[0]
for i in range(1,N):
  mul *= A[i]
  if mul > 10**18:
    print(-1)
    sys.exit()
print(mul)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
output = 1
for i in range(N):
  output *= A[i]
print(output if output <= 10**18 else -1)

Fixed submission:
import sys
N = int(input())
A = list(map(int,input().split()))
A.sort()
mul = A[0]
for i in range(1,N):
  mul *= A[i]
  if mul > 10**18:
    print(-1)
    sys.exit()
print(mul)
Buggy python submission (verdict: Runtime Error):
S_split = input().split('?')
n = len(S_split) - 1
s = ''
output = ''
large = 0
count = 0
for i in range(2**n):
    s = S_split[0]
    for j in range(n):
        if ((i >> j) & 1) == 1:
          if s[-1] == 'P':
            break
          s = s + 'P' + S_split[j+1]
        else:
          s = s + 'D' + S_split[j+1]
    count = s.count('D') + s.count('PD')
    if  count >= large:
      large = count
      output = s
print(output)

Fixed submission:
T = input()
print(T.replace('?', 'D'))

Buggy python submission (verdict: Time Limit Exceeded):
S_split = input().split('?')
n = len(S_split) - 1
s = ''
output = ''
large = 0
count = 0
for i in range(2**n):
    s = S_split[0]
    for j in range(n):
        if ((i >> j) & 1) == 1:
            s = s + 'P' + S_split[j+1]
        else:
            s = s + 'D' + S_split[j+1]
    count = s.count('D') + s.count('PD')
    if  count >= large:
      large = count
      output = s
print(output)

Fixed submission:
T = input()
print(T.replace('?', 'D'))
Buggy python submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
while True:
  C = C - B
  if C <= 0:
    break
  A = A - D
  if A <= 0:
    break
print('Yes' if A >= C else 'No')

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

Buggy python submission (verdict: Runtime Error):
S, W = map(int,input().split())
input('unsafe' if S <= W else 'safe')

Fixed submission:
S, W = map(int,input().split())
print('unsafe' if S <= W else 'safe')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = [input() for _ in range(N)]
check = [True]*N
item = ""
cnt = 0
for i in range(N):
  if check[i] != False:
    item = S[i]
    cnt += 1
    for j in range(i+1,N):
      if S[j] == item:
        check[j] = False
print(cnt)

Fixed submission:
N = int(input())
A = set([])
count = 0
for _ in range(N):
  item = input()
  if (item in A) == False:
    count = count + 1
    A.add(item)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
count = 0
for _ in range(N):
  item = input()
  if (item in A) == False:
    count = count + 1
    A.append(item)
print(count)


Fixed submission:
N = int(input())
A = set([])
count = 0
for _ in range(N):
  item = input()
  if (item in A) == False:
    count = count + 1
    A.add(item)
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = []
count = 0
for _ in range(N):
  item = input()
  if (item in A) == False:
    count = count + 1
  A.append(item)
print(count)


Fixed submission:
N = int(input())
A = set([])
count = 0
for _ in range(N):
  item = input()
  if (item in A) == False:
    count = count + 1
    A.add(item)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = list(input().split())
for i in range(N):
    s = str(i + 1)
    print(a.count(s))


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(input().split())
for i in range(N):
  	s = str(i+1)
    print(a.count(s))

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

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



Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

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



Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

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


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

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


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

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



Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

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

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

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


Fixed submission:
N = int(input())
a = list(map(int, input().split()))
li = [0] * N

for i in range(N-1):
    li[a[i]-1] = li[a[i]-1] + 1

for i in range(N):
    print(li[i])
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int,input().split())
  for _ in range(K):
    if A >= 1:
      A -= 1
    elif B >= 1:
      B -= 1
    else:
      break
print(A,B)

Fixed submission:
S,T=input().split()
print(T+S)
Buggy python submission (verdict: Runtime Error):
A, B, K = map(int,input().split())
if  A+B >= K
  print(0,0)
else:
  for _ in range(K):
    if A != 0:
      A = A - 1
    elif B != 0:
      B = B - 1
    else:
      break
  print(A,B)

Fixed submission:
a,b,c = map(int, input().split())
if a<=c:
    if b<=c-a:
        print('0 0')
    else:
        print('0 {}'.format(a+b-c))
else:
    print('{} {}'.format(a-c,b))

Buggy python submission (verdict: Runtime Error):
A, B, K = map(int,input().split())
  for _ in range(K):
    if A >= 1:
      A -= 1
    elif B >= 1:
      B -= 1
    else:
      break
print(A,B)

Fixed submission:
a,b,c = map(int, input().split())
if a<=c:
    if b<=c-a:
        print('0 0')
    else:
        print('0 {}'.format(a+b-c))
else:
    print('{} {}'.format(a-c,b))

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int,input().split())
if A <= 10**12 and B <= 10**12 and K <= 10**12:
  for _ in range(K):
    if A >= 1:
      A -= 1
    elif B >= 1:
      B -= 1
    else:
      break
print(A,B)

Fixed submission:
a,b,c = map(int, input().split())
if a<=c:
    if b<=c-a:
        print('0 0')
    else:
        print('0 {}'.format(a+b-c))
else:
    print('{} {}'.format(a-c,b))

Buggy python submission (verdict: Time Limit Exceeded):
A, B, K = map(int,input().split())
if A <= 10**12 and B <= 10**12 and K <= 10**12:
  for _ in range(K):
    if A >= 1:
      A -= 1
    elif B >= 1:
      B -= 1
    else:
      break
print(A,B)

Fixed submission:
a,b,c = map(int, input().split())
if a<=c:
    if b<=c-a:
        print('0 0')
    else:
        print('0 {}'.format(a+b-c))
else:
    print('{} {}'.format(a-c,b))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if N % 2 == 0:
    num = int(N/2 + 1）
    string = S[:num]
    strstr = string + string
    if S == strstr:
        print("Yes")
    else:
        print("No")
else:
    print("No")


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

if N % 2 == 0:
    num = int(N/2)
    string = S[:num]
    strstr = string + string
    if S == strstr:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

if N % 2 == 0:
  str = S[:N/2+1]
  strstr = str + str
  if S == str:
      print("Yes")
  else:
      print("No")
else:
  print("No")

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

if N % 2 == 0:
    num = int(N/2)
    string = S[:num]
    strstr = string + string
    if S == strstr:
        print("Yes")
    else:
        print("No")
else:
    print("No")