Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))

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

print(' '.join(map(str, B)))

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

print(' '.join(map(str, d)))
Buggy python submission (verdict: Runtime Error):
N=int(input())
dp=[0]*(N)
for i in range(1,N):
  dp[i] += dp[i-1]+i
print(dp[-1])

Fixed submission:
N=int(input())-1
print(N*(N+1)//2)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[list(sorted(str(input())))]
r=0
for i in range(1,N):
  s=list(sorted(str(input())))
  r+=S.count(s)
  S.append(s)
print(r)

Fixed submission:
N=int(input())
M={}
ans=0
for i in range(N):
    s=''.join(sorted(list(str(input()))))
    if s in M:
        ans+=M[s]
        M[s]+=1
    else:
        M[s]=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[list(sorted(str(input())))]
r=0
for i in range(1,N):
  s=list(sorted(str(input())))
  r+=S.count(s)
  S.append(s)
print(r)

Fixed submission:
N=int(input())
M={}
ans=0
for i in range(N):
    s=''.join(sorted(list(str(input()))))
    if s in M:
        ans+=M[s]
        M[s]+=1
    else:
        M[s]=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[list(sorted(str(input()))) for i in range(N)]

r=0
for i in range(N-1):
  for j in range(i+1,N):
    if S[i]==S[j]:
      r+=1
print(r)

Fixed submission:
N=int(input())
M={}
ans=0
for i in range(N):
    s=''.join(sorted(list(str(input()))))
    if s in M:
        ans+=M[s]
        M[s]+=1
    else:
        M[s]=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[list(str(input())) for i in range(N)]

for i in range(N):
  S[i]=sorted(S[i])
r=0
for i in range(N-1):
  for j in range(i+1,N):
    if S[i]==S[j]:
      r+=1
print(r)

Fixed submission:
N=int(input())
M={}
ans=0
for i in range(N):
    s=''.join(sorted(list(str(input()))))
    if s in M:
        ans+=M[s]
        M[s]+=1
    else:
        M[s]=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import copy
N=int(input())
A=[int(input()) for _ in range(N)]

def delete(n):
  B=copy.deepcopy(A)
  del B[n]
  return(max(B))

for i in range(N):
  print(delete(i))

Fixed submission:
import copy
N=int(input())
A=[int(input()) for _ in range(N)]

a=max(A)
k=A.count(a)#リストの最大数の個数をカウント
if k>=2:
  for i in range(N):
    print(a)
else:
  b=A.index(a)
  for i in range(N):
    if i != b:
      print(a)
    else:
      s=sorted(A)
      print(s[N-2])
Buggy python submission (verdict: Time Limit Exceeded):
L,R=map(int,input().split())
M=[]
for i in range(L,R+1):
    for j in range(L,R+1):
        if j<=i:
            continue
        else:
            m = (i*j)%2019
            M.append(m)
print(min(M))

Fixed submission:
L,R=map(int,input().split())
M=[]
for i in range(L,R+1):
    for j in range(L,R+1):
        if j<=i:
            continue
        else:
            m = (i*j)%2019
            if m==0:
                print(0)
                exit()
            M.append(m)
print(min(M))
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int,input().split()))

MaxX1=min(A[-1],A[1])*2

for i in range(0,MaxX1+2,2):
    X=[i]*N
    for j in range(N-1):
        X[j+1]=2*A[j]-X[j]
        AJ=[0]*N
        for k in range(N):
            AJ[k-1]=X[k-1]/2+X[k]/2
        if AJ==A:
            print(" ".join(map(str,X)))
            exit()

Fixed submission:
n=int(input())
A=list(map(int,input().split()))
X=[0]*n
S=sum(A)
A2=0
for i in range(1,n-1,2):
  A2+=A[i]
X[0]=S-2*A2
for i in range(1,n):
  X[i]=2*A[i-1]-X[i-1]
print(*X)
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
L=list(map(int,input().split()))
d=0
i=0
while d<=X:
  d+=L[i]
  i+=1
print(i)

Fixed submission:
N,X=map(int,input().split())
L=list(map(int,input().split()))
d=0
i=0
for i in range(N):
  d+=L[i]
  if d<=X:
    i+=1
  else:break
print(i+1)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[0]*M
for i in range(M):
    a[i]=int(input())
MOD = 1000000007

dp=[0]*(N+1)
dp[0]=1
if 1 in a:
    dp[1]=0
else:dp[1]=1

for i in range(2,N+1):
    #n-1段目が安全なら
    if i-1 not in a:
        dp[i]+=dp[i-1]
    #n-2段目が安全なら
    if i-2 not in a:
        dp[i]+=dp[i-2]
    dp[i] = dp[i]%MOD
print(dp[N])

Fixed submission:
N,M=map(int,input().split())
a=[0]*(N+1)
for i in range(M):
    a[int(input())]=1
MOD = 1000000007

dp=[0]*(N+1)
dp[0]=1
if a[1]==1:
    dp[1]=0
else:dp[1]=1

for i in range(2,N+1):
    #n-1段目が安全なら
    if a[i-1]==0:
        dp[i]+=dp[i-1]
    #n-2段目が安全なら
    if a[i-2]==0:
        dp[i]+=dp[i-2]
    dp[i] = dp[i]%MOD
print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0
#宝石を取る取らない
def dfs(A):
    global ans
    # 終端条件 --- N 重ループまで回したら処理して打ち切り
    if len(A) == N:
        D=jg(A)
        if ans<D:
          ans=D
        return
    for v in range(2):
        A.append(v)
        dfs(A)
        A.pop()

#コスト算出
def jg(A):
  X=0
  Y=0
  for i in range(N):
    if A[i]==1:
      X+=V[i]
      Y+=C[i]
  d=X-Y
  return d
dfs([])
print(ans)

Fixed submission:
N=int(input())
V=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=0

for i in range(N):
  if V[i] > C[i]:
    ans += V[i]-C[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A = [int(input()) for _ in[0]*5]
A.reverse()
d=[0]*6
d[5]=N
i=0
while d[0] < N:
  i+=1
  for j in range(5):
    v=min(d[j+1],A[j])
    d[j] += v
    d[j+1] -= v
print(i)

Fixed submission:
N=int(input())
A = [int(input()) for _ in[0]*5]
#ボトルネック通過時間
bn=-(-N//min(A))
#START to BN + BN to GOAL = 4
print(bn+4)
Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=str(input())
AC_list=[0]*N
for i in range(1,N):
  if S[i]=='C' and S[i-1]=='A':
    AC_list[i]=1
ans=0
for i in range(Q):
  l,r=map(int,input().split())
  ans=sum(AC_list[l:r])
  print(ans)

Fixed submission:
N,Q=map(int,input().split())
S=str(input())
AC_list=[0]*N
t=0
for i in range(1,N):
  if S[i]=='C' and S[i-1]=='A':
    t+=1
  AC_list[i]=t
ans=0
for i in range(Q):
  l,r=map(int,input().split())
  print(AC_list[r-1]-AC_list[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=str(input())
AC_list=[]
for i in range(1,N):
  if S[i]=='C' and S[i-1]=='A':
    AC_list.append([i,i+1])
ans=0
for i in range(Q):
  ans=0
  l,r=map(int,input().split())
  for j in AC_list:
    if l<=j[0] and j[1]<=r:
      ans+=1
  print(ans)

Fixed submission:
N,Q=map(int,input().split())
S=str(input())
AC_list=[0]*N
t=0
for i in range(1,N):
  if S[i]=='C' and S[i-1]=='A':
    t+=1
  AC_list[i]=t
ans=0
for i in range(Q):
  l,r=map(int,input().split())
  print(AC_list[r-1]-AC_list[l-1])
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(A-B

Fixed submission:
A,B=map(int,input().split())
if B%A==0:
  print(A+B)
else:
  print(B-A)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  N=int(input())
  A=list(set(list(map(int,input().split()))))

  if min(A)==1:
    print(1)
    exit()

  while len(A)>1:
    monster_min = A.pop(A.index(min(A)))
    for i in range(len(A)):
      A[i] %= monster_min
    A.sort()
    for i in A[:]:  
      if i == 0: A.remove(i)
      else: continue
    A.append(monster_min)

  print(A[0])

if __name__ == "__main__":
  main()

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

if min(A)==1:
  print(1)
  exit()

while len(A)>1:
  monster_min = A.pop(A.index(min(A)))
  for i in range(len(A)):
    A[i] %= monster_min
  A.sort()
  for i in A[:]:  
    if i == 0: A.remove(i)
    else: continue
  A.append(monster_min)

print(A[0])

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

if min(A)==1:
  print(1)
  exit()

while len(A)>1:
  monster_min = A.pop(A.index(min(A)))
  for i in range(len(A)):
    A[i] %= monster_min
  A.sort()
  for i in A[:]:  
    if i == 0: A.remove(i)
    else: continue
  A.append(monster_min)

print(A[0])


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

if min(A)==1:
  print(1)
  exit()

while len(A)>1:
  monster_min = A.pop(A.index(min(A)))
  for i in range(len(A)):
    A[i] %= monster_min
  A.sort()
  for i in A[:]:  
    if i == 0: A.remove(i)
    else: continue
  A.append(monster_min)

print(A[0])

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

if min(A)==1:
  print(1)
  exit()

while len(A)>1:
  monster_min = A.pop(A.index(min(A)))
  for i in range(len(A)):
    A[i] %= monster_min
  A.sort()
  for i in A[:]:  
    if i == 0: A.remove(i)
    else: continue
  A.append(monster_min)

print(A[0])

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

if min(A)==1:
  print(1)
  exit()

while len(A)>1:
  monster_min = A.pop(A.index(min(A)))
  for i in range(len(A)):
    A[i] %= monster_min
  A.sort()
  for i in A[:]:  
    if i == 0: A.remove(i)
    else: continue
  A.append(monster_min)

print(A[0])
Buggy python submission (verdict: Runtime Error):
a,b,c=map(str,input().split())
printmax((int(a+b)+int(c),int(a)+int(b+c)))

Fixed submission:
L=sorted(list(map(str,input().split())))
print(int(L[2]+L[1])+int(L[0]))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,X=map(int,input().split())
x=list(map(lambda x: abs(int(x)-X), input().split()))

x_min=min(x)
a=[x_min]*N
g=np.gcd(a,x)
print(min(g))


Fixed submission:
import fractions
N,X=map(int,input().split())
x=list(map(lambda x: abs(int(x)-X), input().split()))
x_min=min(x)
g_min=x_min
for i in x:
  g=fractions.gcd(g_min,i)
  if g < g_min:
    g_min = g
print(g_min)

Buggy python submission (verdict: Time Limit Exceeded):
N,X=map(int,input().split())
x=list(map(lambda x: abs(int(x)-X), input().split()))

for i in range(min(x),0,-1):
  flag = 0
  for j in x:
    if j%i != 0:
      flag = 1
      break
  if flag == 0:
    print(i)
    break

Fixed submission:
import fractions
N,X=map(int,input().split())
x=list(map(lambda x: abs(int(x)-X), input().split()))
x_min=min(x)
g_min=x_min
for i in x:
  g=fractions.gcd(g_min,i)
  if g < g_min:
    g_min = g
print(g_min)
Buggy python submission (verdict: Runtime Error):
a,b=map(int(input().split()))
if b>=a:
  print(a)
else:
  print(a-1)

Fixed submission:
a,b=map(int,input().split())
if b>=a:
  print(a)
else:
  print(a-1)
Buggy python submission (verdict: Runtime Error):
import copy
N=int(input())
X=list(map(int,input().split()))
d=[0]*(max(X))

for i in range(N):
  if d[X[i]-1]>0:
    print(d[X[i]-1])
  else:
    Y=copy.copy(X)
    Y.pop(i)
    Y.sort()
    ans = Y[(N-2)//2]
    print(ans)
    d[X[i]-1] = ans


Fixed submission:
import copy
N=int(input())
X=list(map(int,input().split()))

Y=copy.copy(X)
Y.sort()
center = N//2
right = Y[center]
left = Y[center-1]
center_line = (right+left)/2

for i in range(N):
  if X[i] > center_line:
    print(left)
  else:
    print(right)
Buggy python submission (verdict: Time Limit Exceeded):
c=[0]*3
c_max=0
for i in range(3):
    c[i]=list(map(int,input().split()))
    c_max=max(c_max,max(c[i]))
c_max+=1
for a1 in range(c_max):
    for a2 in range(c_max):
        for a3 in range(c_max):
            for b1 in range(c_max):
                for b2 in range(c_max):
                    for b3 in range(c_max):
                        if a1+b1==c[0][0] and a1+b2==c[0][1] and a1+b3==c[0][2] and a2+b1==c[1][0] and a2+b2==c[1][1] and a2+b3==c[1][2] and a3+b1==c[2][0] and a3+b2==c[2][1] and a3+b3==c[2][2]:
                            print('Yes')
                            exit()
print('No')


Fixed submission:
c=[0]*3
c_max=0
for i in range(3):
    c[i]=list(map(int,input().split()))
    c_max=max(c_max,max(c[i]))
c_max+=1
for a1 in range(c_max):
    b1 = c[0][0] - a1
    b2 = c[0][1] - a1
    b3 = c[0][2] - a1
    a2 = c[1][0] - b1
    a3 = c[2][0] - b1
    if a1+b1==c[0][0] and a1+b2==c[0][1] and a1+b3==c[0][2] and a2+b1==c[1][0] and a2+b2==c[1][1] and a2+b3==c[1][2] and a3+b1==c[2][0] and a3+b2==c[2][1] and a3+b3==c[2][2]:
        print('Yes')
        exit()
print('No')
Buggy python submission (verdict: Runtime Error):
N=int(input())
d=set[int(input()) for i in range(N)]
print(len(d))

Fixed submission:
N=int(input())
d=[int(input()) for i in range(N)]
d=set(d)
print(len(d))
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input(),split())
print(min(N*A,B))

Fixed submission:
N,A,B=map(int,input().split())
print(min(N*A,B))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a==b:
  print(c)
elif b==c:
  print(a):
else:
  print(b)

Fixed submission:
a,b,c=map(int,input().split())
if a==b:
  print(c)
elif b==c:
  print(a)
else:
  print(b)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
  if i%2==0:
    b.append(a[i])
  else:
    b.insert(0,a[i])
if n%2==0:
  print(' '.join(map(str, b)))
else:
  print(' '.join(map(str, list(reversed(b)))))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b0=[]
b1=[]
for i in range(n):
  if i%2==0:
    b0.append(a[i])
  else:
    b1.append(a[i])
if n%2!=0:
  b0=list(reversed(b0))
  b=b0+b1
  print(' '.join(map(str, b)))
else:
  b1=list(reversed(b1))
  b=b1+b0
  print(' '.join(map(str, b)))
Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())

count=0
for x in range(K+1):
  if x>S:
    break
  for y in range(K+1):
    if y>S:
      break
    z=S-x-y
    if 0<=z and z<=K:
      count+=1
print(count)

Fixed submission:
K,S=map(int,input().split())
r=K+1
count=0
for x in range(r):
  if x>S:
    break
  for y in range(r):
    if y>S:
      break
    z=S-x-y
    if 0<=z and z<=K:
      count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())

count=0
for i in range(K+1):
  if i>S:
    break
  for j in range(K+1):
    if j>S:
      break
    for k in range(K+1):
      if k>S:
        break
      if i+j+k==S:
        count+=1
print(count)


Fixed submission:
K,S=map(int,input().split())
r=K+1
count=0
for x in range(r):
  if x>S:
    break
  for y in range(r):
    if y>S:
      break
    z=S-x-y
    if 0<=z and z<=K:
      count+=1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S=map(int,input().split())

count=0
for i in range(K+1):
  for j in range(K+1):
    for k in range(K+1):
      if i+j+k==S:
        count+=1
print(count)

Fixed submission:
K,S=map(int,input().split())
r=K+1
count=0
for x in range(r):
  if x>S:
    break
  for y in range(r):
    if y>S:
      break
    z=S-x-y
    if 0<=z and z<=K:
      count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
a,b=map(int,input().split())
ans=1
for i in range(a,b+1):
  ans*=i
if ans>0:
  print('Positive')
elif ans<0:
  print('Negative')
else:
  print('Zero')


Fixed submission:
a,b=map(int,input().split())
if a*b<=0:
  print("Zero")
elif a>0 or a==b:
  print("Positive")
else:
  if abs(a-b) % 2 == 0:
    print("Negative")
  else:
    print("Positive")
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

c = [0] * (len(s) - len(t))

for i in range(len(s) - len(t)):
  for j in range(len(t)):
    if s[i+j] == t[j]:
      c[i] += 1

print(len(t)-max(c))

Fixed submission:
s = input()
t = input()

c = [0] * (len(s) - len(t)+1)

for i in range(len(s) - len(t) +1):
  for j in range(len(t)):
    if s[i+j] == t[j]:
      c[i] += 1

print(len(t)-max(c))
Buggy python submission (verdict: Runtime Error):
N = int(input())
count = 0

for a in range(1, N):
  tmp = (N-1) // a
  if a <= (N) // 2:
    count += tmp
  else:
    count += 1          

print(count)

Fixed submission:
S = input()

if S[-1] == 's':
  print(S + 'es')
else:
  print(S + 's')
Buggy python submission (verdict: Runtime Error):
import math
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N = int(input())

answer = 0
rest = 10 ** 9 + 7
  
if N == 1:
  answer = 0
else:
  answer = cmb(N, 2) * 2 * (10 ** (N - 2))
print(answer % rest)

a = cmb(N, 2)
print(a)


Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N = int(input())

answer = 0
rest = 10 ** 9 + 7
if N == 1:
  answer = 0
else:
  answer = (10 ** N) - (9 ** N) - (9 ** N) + (8 ** N)
print(answer % rest)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7
ak = 0
ak_2 = 0

for i in range(N):
  ak += A[i]
  ak_2 += A[i] ** 2
s = int(((ak ** 2) - ak_2) // 2)
print(s % mod)

Fixed submission:
D, T, S = map(int, input().split())

if S * T >= D:
  print('Yes') 
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
_sum = 0

for i in range(N):
  for j in range(i+1, N):
    _sum += A[i] * A[j]

print(_sum % (10**9 + 7))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
mod = 10**9 + 7
ak = 0
ak_2 = 0

for i in range(N):
  ak += A[i]
  ak_2 += A[i] ** 2
s = int(((ak ** 2) - ak_2) // 2)
print(s % mod)
Buggy python submission (verdict: Runtime Error):
n, m ,k = map(int,input().split())
a_list = [int(a) for a in input().split()]
b_list = [int(b) for b in input().split()]
time = 0
a_num = 0
b_num = 0
count = 0

# 次回が小さい方を選択する
while True:
    
    if (len(a_list) < a_num + 1) and (len(b_list) < b_num + 1): 
        break

    elif  (len(a_list) < a_num + 1) and(len(b_list) >= b_num + 1):
        time += b_list[b_num]      
        b_num += 1
     
    elif (len(a_list) >= a_num + 1) and (len(b_list) < b_num + 1):
        time += a_list[a_num]      
        a_num += 1
        
    else:
        if sum(a_list[a_num:]) < sum(b_list[b_num:]):
            time += a_list[a_num]
            a_num += 1
        else:
            time += b_list[b_num]      
            b_num += 1
    
    if time <= k:
        count += 1
    else:
        break

print(count)

Fixed submission:
a = int(input())

print(a+a*a+a*a*a)
Buggy python submission (verdict: Runtime Error):
x = int(input())

alphbet = lambda c: chr(c+64)

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy>0:
        out.append(X_dumy%n)
        X_dumy = int(X_dumy/n)
    return out
out = Base_10_to_n(x, 26).reverse()
print( "".join(alphbet(i) for i in out) )

Fixed submission:
x = int(input())

alphbet = lambda c: chr(c+64)

def Base_10_to_n(X, n):
    X_dumy = X
    out = []
    while X_dumy > 0:
      if X_dumy % n == 0:
        out.append( 26 )
        X_dumy = int(X_dumy / n - 1)
      else:
        out.append( X_dumy % n )
        X_dumy = int(X_dumy / n)
    return out
if 1 <= x <= 1000000000000001:
    out = Base_10_to_n(x, 26)[::-1]
    print( "".join(alphbet(i) for i in out).lower())
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())

if (1 <= X <= 100) and (1 <= Y <= 100):
  if isinstance(( Y - X ) / 2, int) and isinstance((Y - X) / -2, int)
  	print("Yes")
  else:
    print("No")

Fixed submission:
X, Y = map(int, input().split())
 
if (1 <= X <= 100) and (1 <= Y <= 100):
  kame = ( Y - (2 * X)) / 2
  turu = (Y - (4 * X)) / -2
  
  if kame.is_integer() and turu.is_integer() and kame >= 0 and turu >= 0:
  	print("Yes")
  else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

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

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

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

for n in answer:
  print(n)
Buggy python submission (verdict: Runtime Error):
inputs = input().split()
 
if -100 <= inputs[0] and inputs[1] <= 100:
	print(max([inputs[0]+inputs[1], inputs[0]-inputs[1], inputs[0]*inputs[1]]))
else:
	raise ValueError

Fixed submission:
inputs = input().split()
a      = int(inputs[0])
b      = int(inputs[1])
if -100 <= a and b <= 100:
	print(max([a+b, a-b, a*b]))
else:
	raise ValueError

Buggy python submission (verdict: Runtime Error):
inputs = input().split()

if -100 <= input[0] and input[1] <= 100:
	print(max([input[0]+input[1], input[0]-input[1], input[0]*input[1]]))
else:
	raise ValueError
  
  

Fixed submission:
inputs = input().split()
a      = int(inputs[0])
b      = int(inputs[1])
if -100 <= a and b <= 100:
	print(max([a+b, a-b, a*b]))
else:
	raise ValueError
Buggy python submission (verdict: Runtime Error):
b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C'):
  

Fixed submission:
b = input()
if b == 'A':
  print('T')
elif b == 'T':
  print('A')
elif b == 'C':
  print('G')
elif b == 'G':
  print('C')
Buggy python submission (verdict: Runtime Error):
S = input()
ACGT = [ 'A', 'C', 'G', 'T' ]
listResult = []
sum = 0
for i in S:
    if i in ACGT:
        sum += 1
    else:
        listResult.append(sum)
        sum = 0
print(max(listResult))


Fixed submission:
S = input()
ACGT = [ 'A', 'C', 'G', 'T' ]
listResult = []
sum = 0

for i in S:
    if i in ACGT:
        sum += 1
    else:
        listResult.append(sum)
        sum = 0
else:
    listResult.append(sum)
    
print(max(listResult))
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split( ))
loads = []
teams = [[i] for i in range(N)]
syozoku = {i:i for i in range(N)}
for _ in range(M):
    A,B = map(int,input().split( ))
    if syozoku[A-1] != syozoku[B-1]:
        hairu,nukeru = min(syozoku[A-1],syozoku[B-1]),max(syozoku[A-1],syozoku[B-1])
        team = teams.pop(nukeru)
        teams[hairu] += team
        for i in team:
            syozoku[i] = hairu
ans = len(teams) - 1
print(ans)

Fixed submission:
N,M = map(int,input().split( ))
loads = []
teams = [[i] for i in range(N)]
syozoku = {i:i for i in range(N)}
for _ in range(M):
    A,B = map(int,input().split( ))
    if syozoku[A-1] != syozoku[B-1]:
        hairu,nukeru = min(syozoku[A-1],syozoku[B-1]),max(syozoku[A-1],syozoku[B-1])
        team = teams[nukeru]
        teams[nukeru] = []
        teams[hairu] += team
        for i in team:
            syozoku[i] = hairu

ans = -1
for team in teams:
    if len(team) != 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split( ))
A = list(map(int,input().split( )))
start = 1
for i in A[:K]:
    start *= i
for tail,head in zip(A,A[K:]):
    if start < start/tail*head:
        print('Yes')
    else:
        print('No')
    start = start/tail*head

Fixed submission:
N,K = map(int,input().split( ))
A = list(map(int,input().split( )))
for tail,head in zip(A,A[K:]):
    if tail < head:
        print('Yes')
    else:
        print('No')
Buggy python submission (verdict: Runtime Error):
import itertools
N,S = map(int,input().split( ))
A = list(map(int,input().split( )))
a = [i for i in range(N)]
C = []
for i in range(1,N+1):
    C += list(itertools.combinations(a,i))
ans = 0
for c in C:
    wa = 0
    for i in c:
        wa += A[i]
    if wa == S:
        for cc in C:
            if set(c) <= set(cc):
                ans += 1
print(ans)

Fixed submission:
A,B = map(int,input().split( ))
print(A*B)
Buggy python submission (verdict: Runtime Error):
A,B = map(int,input().split( ))
B_0 = B//1
B_1 = B%1
ans_0 = round(A*B_0)
ans_1 = A*round(B_1*100)//100
print(int(ans_0 + ans_1))

Fixed submission:
A,B = map(float,input().split( ))
A = int(round(A))
B_0 = B//1
B_1 = B%1
ans_0 = round(A*B_0)
ans_1 = A*round(B_1*100)//100
print(int(round(ans_0 + ans_1)))
Buggy python submission (verdict: Runtime Error):
T = str(input())
ans = ''
for i,t in eumerate(T):
    if t != '?':
        ans += t
    else:
        ans += 'D'
print(ans)

Fixed submission:
T = str(input())
ans = ''
for t in T:
    if t != '?':
        ans += t
    else:
        ans += 'D'
print(ans)