Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03323 (python)

Fixed submission:
def main():
    
    a,b = map(int, input().split())
    if a <= 8 and b <= 8:
        print("Yay!")
    else:
        print(":(")
    
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush,heapify
from math import ceil, floor, sqrt, gcd
from copy import deepcopy

def main():
    
    a,b = map(int, input().split())
    if a <= 8 and b <= 8:
        print("Yay!")
    else:
        print(":(")
    
if __name__ == "__main__":
    main()
Problem p02554 (python)

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

A = 9**M
a = int(A)
B = 9**M
b = int(B)
C = 8**M
c = int(C)
D = a+b-c
d = int(D)
E = 10**M
e = int(E)
F = e-d
f = int(F)

if M==0:
    print(0)

elif M==1:
    print(0)

elif M==2:
    print(2)

elif M>=3:
    print(f%(10**9+7))

Buggy submission (verdict: Runtime Error):
S = input()
L = int(S)
D = L-2
A = int(D)
G = L-1
Z = int(G)
B = L-3
V = int(B)

if L==0:
    print(0)

elif L==1:
    print(0)

elif L==2:
    print(2)

elif L>=3:
    print((10*A*Z+8*U+10*B)%(10**9+7))
Problem p02582 (python)

Fixed submission:
S = input()
count = 0
if S == 'RSR':
  print(1)
else:
  for i in S:
    if i == 'R':
      count+=1
  print(count)

Buggy submission (verdict: Runtime Error):
S = input()
count = 0
if S == 'RSR':
  print(1)
else:
  for i in S:
    if i == 'R':
      cout+=1
  print(count)
Problem p02613 (python)

Fixed submission:
n = int(input())
s = list(input() for i in range(n))
  
print("AC x ",s.count("AC"))
print("WA x ",s.count("WA"))
print("TLE x ",s.count("TLE"))
print("RE x ",s.count("RE"))

Buggy submission (verdict: Runtime Error):
N = int(input())
for s in range(N):
  print('AC','x',s.count('AC'))
  print('TLE','x',s.count('TLE'))
  print('WJ','X',s.count('WJ'))
  print('RE','X',s.count('RE'))

Buggy submission (verdict: Runtime Error):
N = int(input())
for s in range(N):
  s = (input()
       print('AC','x',s.count('AC'))
       print('TLE','x',s.count('TLE'))
       print('WJ','X',s.count('WJ'))
       print('RE','X',s.count('RE'))
Problem p02639 (python)

Fixed submission:
*x, = map(int,input().split())
print(x.index(0)+1)

Buggy submission (verdict: Runtime Error):
for i in range (1,6):
  if(x(i) == 0):
    print(i)

Buggy submission (verdict: Runtime Error):
for i in range (1,6):
  print(i)
  int x
  if(x(i) == 0):
    print(i)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
A,B = int(input().split())
print(AxB)

Buggy submission (verdict: Runtime Error):
A,B = int(input().split())
print(A*B)

Buggy submission (verdict: Runtime Error):
A,B = int(input())
print(A*B)
Problem p02675 (python)

Fixed submission:
N = int(input())
S = N % 10
if(S == 0):
  print("pon")
elif(S == 1):
  print("pon")
elif(S == 6):
  print("pon")
elif(S == 8):
  print("pon")
elif(S == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = N % 10
if(S == 0||1||8||6):
  print("pon")
elif(S == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N = input()
S = N % 10
if(S == 0):
  print("pon")
elif(S == 1):
  print("pon")
elif(S == 6):
  print("pon")
elif(S == 8):
  print("pon")
elif(S == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N = input()
S = N % 10
if(S == 0):
  print("pon")
else if(S == 1):
  print("pon")
else if(S == 6):
  print("pon")
else if(S == 8):
  print("pon")
else if(S == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N = int(input())
S = N % 10
if(S == 0):
  print("pon")
else if(S == 1):
  print("pon")
else if(S == 6):
  print("pon")
else if(S == 8):
  print("pon")
else if(S == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
n = int(input())
S = n % 10
if(S == 0):
  print("pon")
else if(S == 1):
  print("pon")
else if(S == 6):
  print("pon")
else if(S == 8):
  print("pon")
else if(S == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N = input()
S = N%10
if(S == 0):
  print("pon")
else if(S == 1):
  print("pon")
else if(S == 6):
  print("pon")
else if(S == 8):
  print("pon")
else if(S == 3):
  print("bon")
else:
  print("hon")

Buggy submission (verdict: Runtime Error):
N = int(input())
if(N[:-1] == 0||1||6||8):
  print('pon')
else if(N[:-1] == 3):
  print('bon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
N = int(input())
if((N%10) == 0||1||6||8):
  print('pon')
else if((N%10)  == 3):
  print('bon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = N % 10
if(S == 0):
  print('pon')
else if(S == 1):
  print('pon')
else if(S == 6):
  print('pon')
else if(S == 8):
  print('pon')
else if(S == 3):
  print('bon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
N = int(input())
S = N % 10
if(S == 0||1||6||8):
  print('pon')
else if(S == 3):
  print('bon')
else:
  print('hon')

Buggy submission (verdict: Runtime Error):
N = input()
if(N == 3):
  print('bon')
else if(N == 0||1||6||8):
  print('pon')
else:
  print('hon')
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
if (T[:-1] == S):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if (T = S+1):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
if T not it S:
  print("No")
else:
  print("Yes")
Problem p02687 (python)

Fixed submission:
s= input()
if(s == "ABC"):
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s= map.input()
if(s == "ABC"):
  print("ARC")
else:
  print("ABC")

Buggy submission (verdict: Runtime Error):
s = input().split()
if(s = 'ABC'):
  print("ARC")
else:
  print("ABC")
Problem p02705 (python)

Fixed submission:
import math
R = int(input())
print(2*math.pi*R)

Buggy submission (verdict: Runtime Error):
R = int,input()
print(float(R * 3.14 * 2))

Buggy submission (verdict: Runtime Error):
R = input()
print( float(R * 3.14 * 2))

Buggy submission (verdict: Runtime Error):
R = int,input()
print( float(R * 3.14 * 2))

Buggy submission (verdict: Runtime Error):
R = int,input()
print( 3.14*2*R )

Buggy submission (verdict: Runtime Error):
R = int,input()
print( R * 3.14 * 2)

Buggy submission (verdict: Runtime Error):
float R = input()
S = R * 3.14*2
print(S)

Buggy submission (verdict: Runtime Error):
R = input()
S = R*3.14*2
print(S.float)

Buggy submission (verdict: Runtime Error):
R = input()
S = R*3.14*2
print(S)

Buggy submission (verdict: Runtime Error):
R= input()
print(R*3.14*2)
Problem p02717 (python)

Fixed submission:
x,y,z = list(map(int,input().split()))
 
def swap(a,b):
    tmp = a
    a = b
    b = tmp
    return (a,b)
 
x,y = swap(x,y)
x, z = swap(x, z)
print(x,y,z)

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

def swap(x,y):
  tmp=x
  x=y
  y=temp
  return(x,y)

a,b = swap(a,b)
a,c = swap(a,c)
print(x,b,c)

Buggy submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))
def swap(x,y):
  tmp=x
  x=y
  y=temp
  return(x,y)
A,B = swap(A,B)
A,C = swap(A,C)
print(X,Y,Z)
Problem p02730 (python)

Fixed submission:
s = input()
n = len(s)
left = s[:(n-1)//2]
print('Yes' if left == left[::-1] == s[(n+3)//2 - 1:]  else 'No')

Buggy submission (verdict: Runtime Error):
S = input().length()
if S == S[::-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = String(input().length())
if S == S[::-1]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input().length()
if S == S[::-1]:
  print("Yes")
else:
  print("No")
Problem p02765 (python)

Fixed submission:
N,R = map(int, input().split())
ans = 100*(10-N)+R
if N>=10:
  print(R)
else:
  print(ans)

Buggy submission (verdict: Runtime Error):
N,R = map(int,input().split())
ans = 100*(10-N)+R
if N>=10:
  print(R)
 else:
  print(ans)
Problem p02789 (python)

Fixed submission:
N,M=map(int,input().split())
print("Yes" if N==M else "No")

Buggy submission (verdict: Runtime Error):
N,M=map(int.input().split())
print("yes"if N==M else"no")
Problem p02811 (python)

Fixed submission:
[K, X] = [int(x) for x in input().split()]
if K * 500 >= X:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
[K, X] = [int(x) for x in input().split()]
if K * 500 >= X:
    print('Yes')
else:
    print('No')
Problem p02645 (python)

Fixed submission:
S = input()
print(S[:3])

Buggy submission (verdict: Runtime Error):
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if(A+V*T>=B+W*T):
    print("YES")
elif(A>=B):
    print("YES")
else:
    print("NO")
Problem p03433 (python)

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

b = N%500

if A >= b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input("N--->"))
A = int(input("A--->"))

b = n%500

if A > b:
    print("Yes")
else:
    print("No")
Problem p03693 (python)

Fixed submission:
r, g, b = (int(x) for x in input().split())


s = 100*r+10*g+b

if s%4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
r = int(input())
g = int(input())
b = int(input())


s = 100*r+10*b+g

if s%4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
r = int(input("r--->"))
g = int(input("g--->"))
b = int(input("b--->"))

if r < 0 and r > 9:
    print("0<=r<=9")
if g < 0 and g > 9:
    print("0<=g<=9")
if b < 0 and b > 9:
    print("0<=b<=9")

s = 100*r+10*b+g

if s%4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
r = int(input("r--->"))
g = int(input("g--->"))
b = int(input("b--->"))

if r < 0 and r > 9:
    print("0<=r<=9")
if g < 0 and g > 9:
    print("0<=g<=9")
if b < 0 and b > 9:
    print("0<=b<=9")

s = 100*r+10*b+g

if r%4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
r = int(input("r--->"))
g = int(input("g--->"))
b = int(input("b--->"))

s = r+b+g

if r%4 == 0:
    print("YES")
else:
    print("NO")
Problem p02694 (python)

Fixed submission:
x = int(input())
p = 100
t , si= 0, 0
while(p < x):
    si = p//100
    p += si
    t += 1
print(t)

Buggy submission (verdict: Runtime Error):
a = int(input())
p = 100
c = 0
while p != a:
    p = p + int(p/100)
    c += 1
print(c)
Problem p02789 (python)

Fixed submission:
n,m = map(int, input().split())
print("Yes") if n == m else print("No")

Buggy submission (verdict: Runtime Error):
n, m = int(input())
if n == m:
  print("Yes")
else("No")
Problem p02789 (python)

Fixed submission:
n,m=input().split()
if n==m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n,m=int(input()).split()
if n==m:
  print("Yes")
else:
  print("No")
Problem p02817 (python)

Fixed submission:
a,b=input().split()
print(b+a)

Buggy submission (verdict: Runtime Error):
a,b=input().split
print a+b

Buggy submission (verdict: Runtime Error):
a,b=str(input()).split()
print(lower(a+b))

Buggy submission (verdict: Runtime Error):
a,b=str(input().split())
print(a+b)

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
print(a+b)

Buggy submission (verdict: Runtime Error):
a=str(raw_input())
b=str(raw_input())
print(a+b)

Buggy submission (verdict: Runtime Error):
a=str(input())
b=str(input())
print(a+b)

Buggy submission (verdict: Runtime Error):
a=str(raw_input())
b=str(raw_input())
print(a+b)
Problem p02657 (python)

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

print(a*b)

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

print(a*b)
Problem p02675 (python)

Fixed submission:
s = input()
if (s[-1]=="2" or s[-1]=="4" or s[-1]=="5" or s[-1]=="7" or s[-1]=="9"):
  print("hon")
elif (s[-1]=="0" or s[-1]=="1" or s[-1]=="6" or s[-1]=="8"):
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):


s = int(input())
 
if (s[-1]==2,4,5,7,9):
  print（"hon")
elif (s[-1]==0,1,6,8):
  print("pon")
else:
  print("bon")

Buggy submission (verdict: Runtime Error):

s = input()
 
if (s[-1]==2,4,5,7,9):
  print（"hon")
elif (s[-1]==0,1,6,8):
  print("pon")
else:
  print("bon")
Problem p03456 (python)

Fixed submission:
a,b = input().split()
import math
s = math.sqrt(int(a+b))
if (s.is_integer() == True or isinstance(s, int) == True):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
ab = str(a)+str(b)
import math
s = math.sqrt(int(ab))
if (s.is_integer() == True or isinstance(s, int) == True):
  print("yes")
else:
  print("no")
Problem p03000 (python)

Fixed submission:
n = list(map(int, input().split()))
m = list(map(int, input().split()))

ans = 0
new_list = [0]
for i in range(n[0]):
  ans = ans + m[i]
  if ans <= n[1]:
    new_list.append(ans)
  elif ans > n[1]:
    break
    
print(len(new_list))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))

tmp = 0
for i in range(n):
  tmp += l[i]
  if tmp > x:
    ans = i + 1
    break
print(ans)
Problem p02584 (python)

Fixed submission:

x,k,d = list(map(int,input().split()))
#偶数回前後に移動したら0
#偶数回一方向に移動したら2D

if x >= 0:
  capa_iter = x // d
  if capa_iter < k:
    if (k - capa_iter) % 2 == 0:
      print(x - capa_iter*d)
    else:
      print(min([abs(x - capa_iter*d-d),x - capa_iter*d+d]))
    exit()

  ans =x-d*k
  print(ans)

if x < 0:
  capa_iter = abs(-x // d)
  if capa_iter < k:
    if (k - capa_iter) % 2 == 0:
      print(abs(x + capa_iter*d))
    else:
      print(min([abs(x + capa_iter*d+d),abs(x + capa_iter*d -  d)]))
    exit()

  ans =abs(x+d*k)
  print(ans)

Buggy submission (verdict: Runtime Error):
import numpy as np

x,k,d = np.array(list(map(int,input().split())))
#偶数回前後に移動したら0
#偶数回一方向に移動したら2D

for i in range(k):
  x = np.abs(x) - d

  if x < 0:
    break



if (k-i+1) % 2 == 0:
  #そのまま
  ans = np.abs(x)
else:
  ans = np.min(np.abs(x-d),np.abs(x+d))

print(ans)
Problem p02601 (python)

Fixed submission:

def Msol_B_():
    a,b,c = list(map(int,input().split()))
    K = int(input())

    for i in range(8):
        if K==0:
            print('No')
            return 
        if a >= b:
            b *= 2
            K -= 1
        if a < b:
            break
    for i in range(8):
        if  K ==0:
            print('No')
            return
        if b >= c:
            c *= 2
            K -= 1
        if b < c:
            print('Yes')
            return
    print('No')



Msol_B_()

Buggy submission (verdict: Runtime Error):

def Msol_B():
    a,b,c = np.array(list(map(int,input().split())))
    K = int(input())

    #a,b,c=[7,2,5]
    #K = 3

    import math

    if a > b:
        b_a = abs(math.log2(b/a))+1
        #まずは切りさげ
        b *= math.pow(2,math.floor(b_a))
        if b > c:
            c_b = abs(math.log2(c/b))+1
            if math.floor(b_a)+math.floor(c_b) <= K:
                print("Yes")
            else:
                print("No")
        else:
            print("Yes")
    else:
        print("Yes")




Msol_B()
Problem p02613 (python)

Fixed submission:

def abc173_b():
    N = int(input())

    #AC WA TLE RE
    l = [0 for i in range(4)]

    for i in range(N):
        Inp = input()
        if Inp == "AC":
            l[0] += 1
        if Inp == "WA":
            l[1] += 1
        if Inp == "TLE":
            l[2] += 1
        if Inp== "RE":
            l[3] += 1

    print("AC x "+str(l[0]))
    print("WA x "+str(l[1]))
    print("TLE x "+str(l[2]))
    print("RE x "+str(l[3]))



abc173_b()

Buggy submission (verdict: Runtime Error):
def abc173_b():
    N = int(input())

    #AC WA TLE RE
    l = [0 for i in range(N)]

    for i in range(N):
        Inp = input()
        if Inp == "AC":
            l[0] += 1
        if Inp == "WA":
            l[1] += 1
        if Inp == "TLE":
            l[2] += 1
        if Inp== "RE":
            l[3] += 1

    print("AC x "+str(l[0]))
    print("WA x "+str(l[1]))
    print("TLE x "+str(l[2]))
    print("RE x "+str(l[3]))



abc173_b()
Problem p02705 (python)

Fixed submission:
import math
N = input()
M = 2*float(N)*math.pi
print(M)

Buggy submission (verdict: Runtime Error):
import math
N = input()
print(N*math.pi)

Buggy submission (verdict: Runtime Error):
import math
N = input()
print(N*math.pi)
Problem p03471 (python)

Fixed submission:
n,yen = map(int,input().split())
ans = [-1,-1,-1]

for x in range(n+1):
    for y in range(n+1-x):
        z= int(yen/1000) - 10*x - 5*y
        if (0<= z) and (z == n-x-y):
            #print(x,y,n-x-y,z)
            bol = True
            ans = [x,y,z]
            break

print(ans[0],ans[1],ans[2])
'''
        if 0<= yen/1000 + 12*x + 5*y <= n+1-x-y:
            print(x,y,z)
            break
'''

Buggy submission (verdict: Runtime Error):
n,yen = map(int,input().split())

bol = False
for x in range(n+1):
    for y in range(n+1-x):
        for z in range(n+1-x-y):
            if 10000*x+5000*y+1000*z==yen:
                bol = True
                ans = [x,y,z]
                break
        if bol is True:
            break
    if bol is True:
        break

print(ans[0],ans[1],ans[2])
Problem p03680 (python)

Fixed submission:
import numpy as np
import sys
sys.setrecursionlimit(500000)


N = int(input())
a = np.array([int(input()) for i in range(N)])


#回数i,インデックスn
def button(i,n):
    n_new = a[n-1]
    
    if i == N:
        if n != 2:
            print(-1)
            return
    if n_new == 2:
        print(i)
        return 
    else:
        return button(i+1,n_new)

button(1,1)

Buggy submission (verdict: Runtime Error):
import numpy as np

N = int(input())
a = np.array([int(input()) for i in range(N)])


#回数i,インデックスn
def button(i,n):
    if i == N:
        return

    n_new = a[n-1]
    if n_new == 2:
        print(i)
        return 
    else:
        return button(i+1,n_new)

button(1,1)
Problem p02658 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
zero_flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
result = 1
flag = 0
for a in A:
    if a == 0:
        zero_flag = 1
        result = 0
        break
    else:
        result = result * a
        if result > pow(10, 18):
            flag = 1
            result = 0
if flag == 1 and zero_flag != 1:
    print(-1)
else:
    print(result)
Problem p03060 (python)

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

ans = 0
for v, c in zip(V, C):
    vr = v - c
    if vr >= 0:
        ans += vr

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
V = list(map(int, input()))
C = list(map(int, input()))

ans = 0
for v, c in zip(V, C):
  vr = v - c
  if vr >= 0:
    ans += vr

print(ans)
Problem p03061 (python)

Fixed submission:
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    g = gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)
Problem p03110 (python)

Fixed submission:
N = int(input())

sumOtoshidama = 0
for _ in range(N):
    amountStr, unit = input().split()
    amount = float(amountStr)
    if unit == "BTC":
        amount *= 380000
    sumOtoshidama += amount

print(sumOtoshidama)

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

sumOtoshidama = 0
for _ in range(N):
    amountStr, unit = input().split()
    amount = int(amountStr)
    if unit == "BTC":
        amount *= 380000
    sumOtoshidama += amount

print(sumOtoshidama)
Problem p03352 (python)

Fixed submission:
import math

x = int(input())

ans = 1
for b in range(2, int(math.sqrt(x)) + 1):
  for p in range(1, int(math.sqrt(x)) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
    else:
      break
      
print(ans)

Buggy submission (verdict: Runtime Error):
x = int(input())

ans = 1
for b in range(2, sqrt(x) + 1):
  for p in range(1, sqrt(x) + 1):
    bp = b ** p
    if bp <= x:
      ans = max(bp, ans)
	else:
      break
      
print(ans)
Problem p03449 (python)

Fixed submission:
N = int(input())

U = list(map(int, input().split()))
for i in range(1, N):
    U[i] += U[i-1]

D = list(map(int, input().split()))
for i in range(N-2, -1, -1):
    D[i] += D[i+1]

result = 0
for i in range(N):
    result = max(U[i]+D[i], result)

print(result)

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

U = map(int, input())
for i in range(1, N):
    U[i] += U[i-1]

D = map(int, input())
for i in range(N-2, -1):
    D[i] += D[i+1]

result = 0
for i in range(N):
    result = max(U[i]+D[i], result)

print(result)

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

U = [int(input())]
for i in range(1, N):
    U.append(int(input())+U[-1])

D = map(int, input())
for i in range(N-2, -1):
    D[i] += D[i+1]

result = 0
for i in range(N):
    result = max(U[i]+D[i], result)

print(result)
Problem p03456 (python)

Fixed submission:
import math

a, b = input().split()
n = int(a + b)

if math.floor(math.sqrt(n)) ** 2 == n:
    print("Yes")
else:
    print("No")

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

if math.sqrt(n) ** 2 == n:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
import math

a, b = input().split()
n = int(a + b)

if sqrt(n) ** 2 == n:
    print("Yes")
else:
    print("No")

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

if sqrt(n) ** 2 == n:
    print("Yes")
else:
    print("No")
Problem p03854 (python)

Fixed submission:
words = ("dream", "erase", "eraser", "dreamer")

s = input()

while len(s) > 0:
    match = False
    for w in words:
        if s.endswith(w):
            s = s[:-len(w)]
            match = True
            break
    if match is False:
        print("NO")
        exit()
print("YES")

Buggy submission (verdict: Runtime Error):
words = ("dream", "erase", "eraser", "dreamer")

s = input()

while len(s) > 0:
    match = False
    for w in words:
        if s.endwith(w):
            s = s[:-len(w)]
            match = True
            break
    if match is False:
        print("NO")
        exit()
print("YES")