Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
S=map(int, input().split())
if S[2]==S[3] and S[4]==S[5]:
  print('Yes')
else:
  print('No')

Fixed submission:
S=input()
if(S[2]==S[3] and S[5]==S[4]):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
X=int(input())
print(print('{:.0f}'.format(round(X/500)*1000+round(rem(X/500)/5)*5)))

Fixed submission:
import math
X=int(input())
A=math.floor(X/500)*1000+math.floor(X%500/5)*5
print('{:.0f}'.format(A))
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int, input().split()))
minX=min(X)
maxX=max(X)
minE = 1000000000
for P in range(minX,maxX):
  sum = 0
  for i in X:
    sum = sum + (X[i]-P)**2
  if minE>sum:
    minE=sum
print(minE)

Fixed submission:
N=int(input())
X=list(map(int, input().split()))
"""
minX=min(X)
maxX=max(X)
"""
minE = 1000000000
for P in range(101):
  sum = 0
  for Xi in X:
    sum = sum + (Xi-P)**2
  if minE>sum:
    minE=sum
print(minE)
Buggy python submission (verdict: Runtime Error):
N=int(input())
As=list(map(int, input().split()))
rejected=false
for A in As:
  if A%2==0:
    if A%3*(A%5)!=0:
      rejected=true
if rejected:
  print("DENIED")
else:
  print("APPROVED")

Fixed submission:
N=int(input())
As=list(map(int, input().split()))
rejected=False
for A in As:
  if A%2==0:
    if A%3*(A%5)!=0:
      rejected=True
if rejected:
  print("DENIED")
else:
  print("APPROVED")
Buggy python submission (verdict: Runtime Error):
N,M=map(int, input().split())
if N==m:
  print('Yes')
else:
  print('No')

Fixed submission:
N,M=map(int, input().split())
if N==M:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
ans = ""
for i in range(max([a,b])):
  ans = ans + min([a,b])
print(ans)

Fixed submission:
a,b=map(int, input().split())
ans = ""
for i in range(max([a,b])):
  ans = ans + str(min([a,b]))
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S,T=str(int, input().split())
ans = ""
for i in range(N):
  ans = ans + S[i] + T[i]
print(ans)

Fixed submission:
N=int(input())
S,T=map(str, input().split())
ans = ""
for i in range(N):
  ans = ans + S[i] + T[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import fractions
a,b=map(int, input().split())
print(’{:.0f}’.format(a*b/fractions.gcd(a, b)))

Fixed submission:
import fractions
a,b=map(int, input().split())
print(round(a*b/fractions.gcd(a, b)))
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
for i in range(len(S)):
  S[i] = (letters.index(S[i])+N)%26
print(S)

Fixed submission:
N=int(input())
S=str(input())
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
ans = ""
for i in range(len(S)):
  ans = ans + letters[(letters.index(S[i])+N)%26]
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
if N%2!=0:
  print('No')
elif S[0:N/2-1]==S[N/2:N-1]:
  print('Yes')
else:
  print('No')

Fixed submission:
N=int(input())
S=str(input())
if N%2!=0:
  print('No')
elif S[0:round(N/2)]==S[round(N/2):N]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
N=int(input())
A=list(map(int, input().split()))
for i in range(N):
  sys.stdout.write(str(A.index(i+1)+1)+" ")

Fixed submission:
N=int(input())
As=list(map(int, input().split()))
man = [""] * N
for i in range(N):
  man[As[i]-1] = str(i+1)
result = ' '.join(man)
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
N=int(input())
A=list(map(int, input().split()))
for i in range(N):
  sys.stdout.write(str(A.index(i+1)+1))
  sys.stdout.write(" ")

Fixed submission:
N=int(input())
As=list(map(int, input().split()))
man = [""] * N
for i in range(N):
  man[As[i]-1] = str(i+1)
result = ' '.join(man)
print(result)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
l = [0] * N
ans = ""
for i in range(N):
  sys.stdout.write(A.index(i+1)+1)
  sys.stdout.write(" ")
  


Fixed submission:
N=int(input())
As=list(map(int, input().split()))
man = [""] * N
for i in range(N):
  man[As[i]-1] = str(i+1)
result = ' '.join(man)
print(result)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
ans = ""
for i in range(N):
  ans += str(A.index(i+1)+1) + " "
print(ans)

Fixed submission:
N=int(input())
As=list(map(int, input().split()))
man = [""] * N
for i in range(N):
  man[As[i]-1] = str(i+1)
result = ' '.join(man)
print(result)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int, input().split()))
str = ""
for i in range(N):
  str += str(A.index(i+1)+1) + " "

Fixed submission:
N=int(input())
As=list(map(int, input().split()))
man = [""] * N
for i in range(N):
  man[As[i]-1] = str(i+1)
result = ' '.join(man)
print(result)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=map(int, input().split())
ans = 0
for i in range(N):
  ans = ans + 1/A[i]
print(1/ans)

Fixed submission:
N=int(input())
A=list(map(int, input().split()))
ans = 0
for i in range(N):
  ans = ans + 1/A[i]
print(1/ans)
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(max[a+b,a-b,a*b])

Fixed submission:
a,b=map(int, input().split())
print(max([a+b,a-b,a*b]))
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
print(min([a*n,b])

Fixed submission:
n,a,b=map(int, input().split())
print(min([a*n,b]))

Buggy python submission (verdict: Runtime Error):
n,a,b=map(int, input().split())
print(max([a*n,b])

Fixed submission:
n,a,b=map(int, input().split())
print(min([a*n,b]))
Buggy python submission (verdict: Runtime Error):
S=str(input())
if S[0]==S[1] and S[2]==S[3]:
  print('Yes')
else if S[0]==S[2] and S[1]==S[3]:
  print('Yes')
else if S[0]==S[3] and S[1]==S[2]:
  print('Yes')
else:
  print('No')

Fixed submission:
S=str(input())
if S[0]==S[1] and S[1]==S[2] and S[2]==S[3]:
  print('No')
elif S[0]==S[1] and S[2]==S[3]:
  print('Yes')
elif S[0]==S[2] and S[1]==S[3]:
  print('Yes')
elif S[0]==S[3] and S[1]==S[2]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N,X=map(int, input().split())
L=list(map(int, input().split()))

d = 0
count = 0

跳ねる直前からスタート

for i in range(1, N+2):
  if d <= X:
    count = count + 1
    d = d + L[i-1]

print(count)

Fixed submission:
N,X=map(int, input().split())
L=list(map(int, input().split()))
L.append(0)


d = 0
count = 0

#跳ねる直前からスタート

for i in range(1, N+2):
  if d <= X:
    count = count + 1
    d = d + L[i-1]

print(count)

Buggy python submission (verdict: Runtime Error):
N,X=map(int, input().split())
L=list(map(int, input().split()))
distance = 0
count = 0
while distance <= X and count <= N:
  distance = distance + L[count]
  count = count + 1
print(count)

Fixed submission:
N,X=map(int, input().split())
L=list(map(int, input().split()))
L.append(0)


d = 0
count = 0

#跳ねる直前からスタート

for i in range(1, N+2):
  if d <= X:
    count = count + 1
    d = d + L[i-1]

print(count)

Buggy python submission (verdict: Runtime Error):
N,X=map(int, input().split())
L=list(map(int, input().split()))
count = 0
x=0
while x <= X and count <= N:
  x = x + L[count]
  count = count + 1
print(count)

Fixed submission:
N,X=map(int, input().split())
L=list(map(int, input().split()))
L.append(0)


d = 0
count = 0

#跳ねる直前からスタート

for i in range(1, N+2):
  if d <= X:
    count = count + 1
    d = d + L[i-1]

print(count)

Buggy python submission (verdict: Runtime Error):
N,X=map(int, input().split())
L=list(map(int, input().split()))
count = 0
x=0
while x <= X and count <= N+1:
  x = x + L[count]
  count = count + 1
print(count)

Fixed submission:
N,X=map(int, input().split())
L=list(map(int, input().split()))
L.append(0)


d = 0
count = 0

#跳ねる直前からスタート

for i in range(1, N+2):
  if d <= X:
    count = count + 1
    d = d + L[i-1]

print(count)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
print(min([a+b,b+c,c+a])

Fixed submission:
P,Q,R=map(int, input().split())
print(min([P+Q,Q+R,R+P]))
Buggy python submission (verdict: Runtime Error):
import math
A,P=map(int, input().split())
print(math.floor((3*a+P)/2))

Fixed submission:
import math
A,P=map(int, input().split())
print(math.floor((3*A+P)/2))
Buggy python submission (verdict: Runtime Error):
N=int(input())
X=list(map(int, input().split()))
Y=list(map(int, input().split()))
Z=X-Y
Z=Z[Z>0]
print(sum(Z))

Fixed submission:
import numpy as np
N=int(input())
X=list(map(int, input().split()))
Y=list(map(int, input().split()))
Z=np.zeros(N)
for i in range(N):
  Z[i]=X[i]-Y[i]
print('{:.0f}'.format(sum(Z[np.where(Z>0)])))
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
if a==b:
  print(a*2)
else:
  print(max([a,b])*2-1

Fixed submission:
a,b=map(int, input().split())
if a==b:
  print(a*2)
else:
  print(max([a,b])*2-1)
Buggy python submission (verdict: Runtime Error):
aru = False
antenas = []
for i in range(5):
  k=int(input())
  antenas.append(n)
k=int(input())
for i in range(4):
  if abs(antenas[i]-antenas[i+1])>k:
    aru = True
if aru:
  print(':(')
else:
  print("Yay!")

Fixed submission:
aru = False
antenas = []
for i in range(5):
  k=int(input())
  antenas.append(k)
k=int(input())
for i in range(5):
  for t in range(i,5):
    if abs(antenas[i]-antenas[t])>k:
      aru = True
if aru:
  print(':(')
else:
  print("Yay!")
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n=="A":
  print("T")
if n=="T":
  print("A")
if n=="C":
  print("G")
if n=="G":
  print("C")

Fixed submission:
n=str(input())
if n=="A":
  print("T")
if n=="T":
  print("A")
if n=="C":
  print("G")
if n=="G":
  print("C")
Buggy python submission (verdict: Runtime Error):
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
count = 0
for i in range(N):
  A=list(map(int, input().split()))
  hyoka = 0
  for k in range(M):
    hyoka = hyoka + A[k]*B[k]
  if hyoka+C > 0:
    count = cocunt + 1
print(count)

Fixed submission:
N,M,C=map(int, input().split())
B=list(map(int, input().split()))
count = 0
for i in range(N):
  A=list(map(int, input().split()))
  hyoka = 0
  for k in range(M):
    hyoka = hyoka + A[k]*B[k]
  if hyoka+C > 0:
    count = count + 1
print(count)
Buggy python submission (verdict: Runtime Error):
S=str(input())
if int(str[5:7])<5:
  print("Heisei")
else:
  print('TBD')

Fixed submission:
S=str(input())
if int(S[5:7])<5:
  print("Heisei")
else:
  print('TBD')
Buggy python submission (verdict: Runtime Error):
def kansan(a,b):
  if b=="BTC":
    return a*380000
  else:
    return a

n=int(input())
total = 0
for i in range(n):
  a,b=map(str, input().split())
  total = total + kansan(int(a),b)
print(total)

Fixed submission:
N=int(input())
total = 0
for i in range(N):
  x,u=input().split()
  total = total + float(x) * [1,380000.0][u=="BTC"]
print(total)
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M=map(int, input().split())
tabelist = np.zeros(N)
for i in range(N):
  c=list(map(int, input().split()))
  for k in range(1,c[0]+1):
    tabelist[c[k]-1] = tabelist[c[k]-1] + 1
#    print(i,k,tabelist)
print(len([1 for x in tabelist if x==N]))

Fixed submission:
import numpy as np
N,M=map(int, input().split())
tabelist = np.zeros(M)
for i in range(N):
  c=list(map(int, input().split()))
  for k in range(1,c[0]+1):
    tabelist[c[k]-1] = tabelist[c[k]-1] + 1
#    print(i,k,tabelist)
print(len([1 for x in tabelist if x==N]))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,M=map(int, input().split())
tabelist = np.zeros(N)
for i in range(N):
  c=list(map(int, input().split()))
  for k in range(1,c[0]):
    tabelist[k-1] = tabelist[k-1] + 1
print(len([1 for x in tabelist if x==N]))

Fixed submission:
import numpy as np
N,M=map(int, input().split())
tabelist = np.zeros(M)
for i in range(N):
  c=list(map(int, input().split()))
  for k in range(1,c[0]+1):
    tabelist[c[k]-1] = tabelist[c[k]-1] + 1
#    print(i,k,tabelist)
print(len([1 for x in tabelist if x==N]))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().split())
print('{:．0f}'．format(a*b/2))

Fixed submission:
a,b,c=map(int, input().split())
print('{:.0f}'.format(a*b/2))
Buggy python submission (verdict: Runtime Error):
S=str(input())
if S[0]=='1':s[0]='9'
if S[0]=='9':s[0]='1'
if S[1]=='1':s[1]='9'
if S[1]=="9":s[1]="1"
if S[2]=='1':s[2]='9'
if S[2]=='9':s[2]='1'
print(s)


Fixed submission:
S = str(input())
print( 100*(10-int(S[0])) + 10*(10-int(S[1])) + 1*(10-int(S[2])) )

Buggy python submission (verdict: Runtime Error):
S=str(input())
if S[0]=='1':S[0]='9'
if S[0]=='9':S[0]='1'
if S[1]=='1':S[1]='9'
if S[1]=='9':S[1]='1'
if S[2]=='1':S[2]='9'
if S[2]=='9':S[2]='1'
print(S)

Fixed submission:
S = str(input())
print( 100*(10-int(S[0])) + 10*(10-int(S[1])) + 1*(10-int(S[2])) )
Buggy python submission (verdict: Runtime Error):
N,M,X,Y=map(int, input().split())
Xs=list(map(int, input().split()))
Ys=list(map(int, input().split()))
if max([X,Xs]) < min([Y,Ys]):
  print("No War")
else:
  print("War")

Fixed submission:
N,M,X,Y=map(int, input().split())
Xs=list(map(int, input().split()))
Ys=list(map(int, input().split()))
if max([X,max(Xs)]) < min([Y,min(Ys)]):
  print("No War")
else:
  print("War")
Buggy python submission (verdict: Runtime Error):
x1,y1,x2,y2=map(int, input().split())
print(x2+y1-y2,y2-x1+x2,x1-x2+x3,y1-y2+y3)

Fixed submission:
x1,y1,x2,y2=map(int, input().split())
print(x2+y1-y2,y2-x1+x2,x1-x2+x2+y1-y2,y1-y2+y2-x1+x2)
Buggy python submission (verdict: Runtime Error):
def oneCol(mat,n):
  ans = ""
  for i in range(len(mat)):
    ans = ans + mat[i][n]
  return ans

def strCut(s,n):
  return s[0:n] + s[n+1:len(s)]

def lowCut(mat):
  for i in range(len(mat)):
    if not "#" in mat[len(mat)-i-1]:
      delete mat[len(mat)-i-1]
  return mat

def colCut(mat):
  for i in range(len(mat[0])):
    if not "#" in oneCol(mat,len(mat[0])-i-1):
      mat2 = []
      for k in range(len(mat)):
        mat2.append(strCut(mat[k],len(mat[0])-i-1))
  return mat
      

H,W=map(int, input().split())
s_list = []
for i in range(H):
  s = input()
  if "#" in s: s_list.append(s)

    
while True:
  lowCut(mat)
  colCut(mat)
  print(mat)

Fixed submission:
def rotate(mat):
  mat2 = []
  for i in range(len(mat[0])):
    s = ""
    for k in range(len(mat)):
      s = s + mat[k][i]
    mat2.append(s)
  return mat2

H,W=map(int, input().split())
mat = []
for i in range(H):
  a = input()
  if "#" in a:
    mat.append(a)

for count in range(H+W):
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  
for i in range(len(mat)):
  print(mat[i])

Buggy python submission (verdict: Runtime Error):
H,W=map(int, input().split())
masu_list = []
for i in range(H):
  S=str(input())
  if S.count('#') != 0:
    masu_list.append(S)

yet = True
while yet:
  for i in range(len(masu_list[0])):
    if masu_list[i].count('#') == 0:
      masu_list.delete(i,1)

Fixed submission:
def rotate(mat):
  mat2 = []
  for i in range(len(mat[0])):
    s = ""
    for k in range(len(mat)):
      s = s + mat[k][i]
    mat2.append(s)
  return mat2

H,W=map(int, input().split())
mat = []
for i in range(H):
  a = input()
  if "#" in a:
    mat.append(a)

for count in range(H+W):
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  for i in range(len(mat)-1, -1, -1):
    if not "#" in mat[i]:
      del mat[i]
  mat = rotate(mat)
  
for i in range(len(mat)):
  print(mat[i])
Buggy python submission (verdict: Runtime Error):
import math
def countYakusu(n):
  count = 0
  for i in range(math.floor(n**0.5)):
    if n % i == 0:
      count = count + 1
  return count == 8

N = int(input())
count = 0
for i in range(math.floor(N/2)):
  count = count + countYakusu(i*2+1)
print(count)

Fixed submission:
import math
def countYakusu(n):
  count = 0
  for i in range(n):
    if n % (i+1) == 0:
      count = count + 1
#      print(n,i+1)
#  if count == 8: print(n)
  return count == 8

N = int(input())
count = 0
for i in range(math.ceil(N/2)):
  count = count + countYakusu(i*2+1)
#  print(i*2+1)
print(count)
Buggy python submission (verdict: Runtime Error):
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in len(S):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')


Fixed submission:
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Buggy python submission (verdict: Runtime Error):
S=str(input())
letter="ABCDEFGHIJKLMNO"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
condition3 = len([1 for x in S if len([1 for y in letter if y>10])==1]) == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')

Fixed submission:
S=str(input())
letter="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
condition1 = S[0]=='A'
condition2 = len([1 for x in S[2:len(S)-1] if x=="C"]) == 1
count=0
for i in range(len(S)):
  if len([1 for x in letter if x==S[i]]) == 1:
    count = count + 1
condition3 = count == 2
if condition1 & condition2 & condition3:
  print('AC')
else:
  print('WA')
Buggy python submission (verdict: Runtime Error):
import sys
S1=str(input())
S2=str(input())
NG = False
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    NG = True
    break
if NG:
  print('No')

Fixed submission:
S1=str(input())
S2=str(input())
NG = True
for i in range(len(S1)):
  if S1 == S2[i:len(S1)]+S2[0:i]:
    print('Yes')
    NG = False
    break
if NG:
  print('No')

Buggy python submission (verdict: Runtime Error):
S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    return
print('No')


Fixed submission:
S1=str(input())
S2=str(input())
NG = True
for i in range(len(S1)):
  if S1 == S2[i:len(S1)]+S2[0:i]:
    print('Yes')
    NG = False
    break
if NG:
  print('No')

Buggy python submission (verdict: Runtime Error):
import sys
S1=str(input())
S2=str(input())
for i in range(len(S1)):
  S1.append(S1[0])
  del S1[0]
  if S1 == S2:
    print('Yes')
    sys.exit()
print('No')

Fixed submission:
S1=str(input())
S2=str(input())
NG = True
for i in range(len(S1)):
  if S1 == S2[i:len(S1)]+S2[0:i]:
    print('Yes')
    NG = False
    break
if NG:
  print('No')
Buggy python submission (verdict: Runtime Error):
S=str(input())
k = 0
for i in Range(S):
  if S[i] == '+':
    k = k + 1
  else:
    k = k - 1
print(k)

Fixed submission:
S=str(input())
k = 0
for i in range(4):
  if S[i] == '+':
    k = k + 1
  else:
    k = k - 1
print(k)
Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if math.log(n,10)%1 == 0:
  print('Yes')
elif n%SN==0:
  print('Yes')
else:
  print('No')


Fixed submission:
S=str(input())
total = 0
for i in range(len(S)):
  total = total + int(S[i])
if int(S)%total==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if n==1:
  print('Yes')
elif n%SN==0:
  print('Yes')
else:
  print('No')


Fixed submission:
S=str(input())
total = 0
for i in range(len(S)):
  total = total + int(S[i])
if int(S)%total==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if n%SN==0:
  print('Yes')
else:
  print('No')


Fixed submission:
S=str(input())
total = 0
for i in range(len(S)):
  total = total + int(S[i])
if int(S)%total==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
print(SN)
if n%SN==0:
  print('Yes')
else:
  print('No')

Fixed submission:
S=str(input())
total = 0
for i in range(len(S)):
  total = total + int(S[i])
if int(S)%total==0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
import math
n=int(input())
SN = 0
for i in range(1,math.ceil(math.log(n,10))+1):
#  print(math.floor(n%(10**i)/(10**(i-1))))
  SN = SN + math.floor(n%(10**i)/(10**(i-1)))
if n%SN==0:
  print('Yes')
else:
  print('No')

Fixed submission:
S=str(input())
total = 0
for i in range(len(S)):
  total = total + int(S[i])
if int(S)%total==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(max([A+B,A-B,A*B]))

Fixed submission:
A,B=map(int, input().split())
print(max([A+B,A-B,A*B]))

Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())
print(max([A+B,A-B,A*B])

Fixed submission:
A,B=map(int, input().split())
print(max([A+B,A-B,A*B]))
Buggy python submission (verdict: Runtime Error):
import numpy as np
N=int(input())
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
count_list = np.zeros(26)
max_count = 0
for i in range(N-1): # N字目で切った場合
  for k in range(i):
    if S[k] in S[N:len(S)]:
      count_list[s_list.index(S[k])] = count_list[s_list.index(S[k])] + 1
  if max_count < n = len([1 for x in count_list if x>0])
print(max_count)

Fixed submission:
import numpy as np
N=int(input())
S=str(input())
s_list = "abcdefghijklmnopqrstuvwxyz"
max_count = 0
for i in range(1,N-1): # N字目で切った場合
  count_list = np.zeros(26)
  for k in range(i):
#    print(i,k,S[k],S[i:len(S)])
    if S[k] in S[i:len(S)]:
      count_list[s_list.index(S[k])] = count_list[s_list.index(S[k])] + 1
  if max_count < len([1 for x in count_list if x>0]):
    max_count = len([1 for x in count_list if x>0])
#  print(count_list)
print(max_count)
Buggy python submission (verdict: Runtime Error):
N,M,X=map(int, input().split())
A=list(map(int, input().split()))
print(min([len([1 for a in A if a>X]),len([1 for a in A if a<X])])

Fixed submission:
N,M,X=map(int, input().split())
A=list(map(int, input().split()))
print(min([len([1 for a in A if a>X]),len([1 for a in A if a<X])]))
Buggy python submission (verdict: Runtime Error):
x=str(input())
a = len([1 for x in arr if x=='a'])
b = len([1 for x in arr if x=='b'])
c = len([1 for x in arr if x=='c'])
if a+b+c == 3:
  print('Yes')
else:
  print('No')

Fixed submission:
arr=str(input())
a = len([1 for x in arr if x=='a'])
b = len([1 for x in arr if x=='b'])
c = len([1 for x in arr if x=='c'])
if a==1 and b==1 and c==1:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
for i in range(N):
  Si = str(input())
  S.append(Si) 
  
M = int(input())
T = []
for i in range(M):
  Ti = str(input())
  T.append(Ti)

total = 0
tokuten_list = []
tokuten = []
for i in range(N):
  if not S[i] in T:
    if not S[i] in tokuten_list:
      tokuten_list.append(S[i])
      tokuten.append(1)
    else:
      tokuten[tokuten_list.index(S[i])] = tokuten[tokuten_list.index(S[i])] + 1

print(max(tokuten))

Fixed submission:
N = int(input())
S = []
for i in range(N):
  Si = str(input())
  S.append(Si) 
  
M = int(input())
T = []
for i in range(M):
  Ti = str(input())
  T.append(Ti)

max_point = 0
for i in range(N):
  point = len([1 for s in S if s==S[i]]) - len([1 for t in T if t==S[i]])
  max_point = max([max_point,point])
  
print(max_point)
Buggy python submission (verdict: Runtime Error):
n=int(input())
print('{:.0f}'.format(math.floor(n/3)))

Fixed submission:
import math
n=int(input())
print('{:.0f}'.format(math.floor(n/3)))
Buggy python submission (verdict: Runtime Error):
S=int(input())
S[3]='8'
print(S)

Fixed submission:
S=str(input())
print('2018/'+S[5:10])