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

Fixed submission:
H, W = map(int, input().split())
A = [list(input()) for _ in range(H)]

i = j = 0

visited = [[None] * W for _ in range(H)]

def dp(i, j):
    global H, W
    visited[i][j] = True
    if i == H - 1 and j == W - 1: return True
    #
    if i + 1 >= H:
        d = False
    else:
        d = (A[i + 1][j] == '#')
    #
    if j + 1 >= W:
        r = False
    else:
        r = (A[i][j + 1] == '#')
    #
    if d and not r:
        return dp(i + 1, j)
    elif not d and r:
        return dp(i, j + 1)
    else:
        return False

if dp(0, 0):
    ans = 'Possible'
    for i in range(H):
        for j in range(W):
            if not visited[i][j] and A[i][j] == '#':
                ans = 'Impossible'
    #
    print(ans)
else:
    print('Impossible')

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
A = [list(input()) for _ in range(H)]

i = j = 0

passed = [[None] * W for _ in range(H)]

def dp(i, j):
    global H, W
    passed[i][j] = True
    if i == H - 1 and j == W - 1: return True
    #
    if i + 1 >= H:
        d = False
    else:
        d = (A[i + 1][j] == '#')
    #
    if j + 1 >= W:
        r = False
    else:
        r = (A[i][j + 1] == '#')
    #
    if d and not r:
        return dp(i + 1, j)
    elif not d and r:
        return dp(i, j + 1)
    else:
        return False

if dp(0, 0):
    ans = 'Possible'
    for i in range(H):
        for j in range(W):
            if not visited[i][j] and A[i][j] == '#':
                ans = 'Impossible'
    #
    print(ans)
else:
    print('Impossible')
Problem p04045 (python)

Fixed submission:
# encoding: utf-8
N, K = map(int, input().split())
D = list(map(int, input().split()))

Db = []
for Di in range(10):
    if Di not in D: Db.append(Di)
# print("#", Db)

for level in range(6):
    if N // (10 ** level) < 1: break
# print("#", level)
    
memo = [None] * ((level + 1) * 10000)
    
def pay(pos, tmp):
    # print("##", pos, tmp)
    if pos > level or tmp >= N:
        if tmp >= N:
            # print("###", tmp)
            return tmp
        else: return 10000
    elif memo[pos * 10000 + tmp] != None: return memo[pos * 10000 + tmp]
    rets = []
    for Dbi in Db:
        add = Dbi * (10 ** pos)
        rets.append(pay(pos + 1, tmp + add))
    ret = min(rets)
    if memo[pos * 10000 + tmp] == None: memo[pos * 10000 + tmp] = ret    
    return ret

print(pay(0, 0))

Buggy submission (verdict: Runtime Error):
# encoding: utf-8
N, K = map(int, input().split())
D = list(map(int, input().split()))

Db = []
for Di in range(10):
    if Di not in D: Db.append(Di)
# print("#", Db)

for level in range(6):
    if N // (10 ** level) < 1: break
# print("#", level)
    
memo = [None] * (level * 10000)
    
def pay(pos, tmp):
    # print("##", pos, tmp)
    if pos > level or tmp >= N:
        if tmp >= N:
            # print("###", tmp)
            return tmp
        else: return 10000
    elif memo[pos * 10000 + tmp] != None: return memo[pos * 10000 + tmp]
    rets = []
    for Dbi in Db:
        add = Dbi * (10 ** pos)
        rets.append(pay(pos + 1, tmp + add))
    ret = min(rets)
    if memo[pos * 10000 + tmp] == None: memo[pos * 10000 + tmp] = ret    
    return ret

print(pay(0, 0))
Problem p02600 (python)

Fixed submission:
def resolve():
	x = int(input())
	if 400<= x < 600:
		print(8); return
	elif 600<= x < 800:
		print(7); return
	elif 800<= x < 1000:
		print(6); return
	elif 1000<= x < 1200:
		print(5); return
	elif 1200<= x < 1400:
		print(4); return
	elif 1400<= x < 1600:
		print(3); return
	elif 1600<= x < 1800:
		print(2); return
	elif 1800<= x < 2000:
		print(1); return
resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
	X = int(input())
	if 400<= x < 600:
		print(8); return
	elif 600<= x < 800:
		print(7); return
	elif 800<= x < 1000:
		print(6); return
	elif 1000<= x < 1200:
		print(5); return
	elif 1200<= x < 1400:
		print(4); return
	elif 1400<= x < 1600:
		print(3); return
	elif 1600<= x < 1800:
		print(2); return
	elif 1800<= x < 2000:
		print(1); return
resolve()
Problem p02641 (python)

Fixed submission:
def resolve():
    x, n = map(int, input().split())
    if n == 0:
        print(x)
        return
    else:
        p = [int(i) for i in input().split()]

    i = 0
    while True:
        if not x-i in p:
            print(x-i)
            return
        if not x+i in p:
            print(x+i)
            return
        i += 1

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    x, n = map(int, input().split())
    if n == 0:
        print(x)
        return
    else:
        p = [int(i) for i in input().split()]

    s = []
    for i in range(101):
        if not i in p:
            s.append(i)
    if not x in p:
        print(x)
        return
    
    t = s + [x]
    t.sort()
    pos = t.index(x)
    if abs(x-t[pos-1]) <= abs(x-t[pos+1]):
        print(t[pos-1])
        return
    else:
        print(t[pos+1])

resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    x, n = map(int, input().split())
    if n == 0:
        print(x)
        return
    else:
        p = [int(i) for i in input().split()]

    s = []
    for i in range(101):
        if not i in p:
            s.append(i)
    if not x in p:
        print(x)
        return
    
    t = s + [x]
    t.sort()
    pos = t.index(x)
    if abs(x-t[pos-1]) <= abs(x-t[pos+1]):
        print(t[pos-1])
    else:
        print(t[pos+1])

resolve()
Problem p02675 (python)

Fixed submission:
n = str(input())
if int(n[-1]) in [2, 4, 5, 7, 9]:
    print("hon")
elif int(n[-1]) in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")

Buggy submission (verdict: Runtime Error):
import math
A, B, H, M = map(int, input().split())
l = (360/60)*M
s = (360/12)*H + (360/12/60)*M
theta = max(l, s) - min(l, s)
theta = min(theta, 360-theta)
print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(math.radians(theta))))
Problem p02690 (python)

Fixed submission:
x = int(input())

q = 0
while abs(x) > q**4:
  q += 1

deta = False
for A in range(-q, q+1):
  if deta:
    break
  for B in range(-q, q+1):
    if A**5 - B**5 == x:
      print(A,B)
      deta = True
      break

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

quarter = int(x ** 0.25)
for B in range(-quarter, quarter+1):
  A = int((B**5 + x) ** 0.2)
  if A % 1 == 0:
    print(A, B)
    break
Problem p02691 (python)

Fixed submission:
import collections
 
input()
p = list(map(int, input().split()))
map1 = collections.defaultdict(lambda:0)
map2 = collections.defaultdict(lambda:0)
 
for i, v in enumerate(p):
  map1[i+v] += 1
  map2[i-v] += 1

ans = 0
for i in map1:
  if i in map2:
    ans += map1[i] * map2[i]

print(ans)

Buggy submission (verdict: Runtime Error):
import collections

input()
p = list(map(int, input().split()))
map1 = collections.defualtdict(lambda:0)
map2 = collections.defaultdict(lambda:0)

for i, v in enumerate(p):
  map1[i+v] += 1
  map2[i-v] += 1

ans = 0
for i in map1:
  if i in map2:
    ans += map2[i]
print(i)
Problem p02705 (python)

Fixed submission:
pi = 3.1415926536
r = int(input())
print(2*pi*r)

Buggy submission (verdict: Runtime Error):
pi =　3.14159265359
r = int(input())
print(r*2*pi)
Problem p02848 (python)

Fixed submission:
n = int(input())
s = input()

ans = ""
for c in s:
  ascii = ord(c) + n
  if ascii > ord('Z'):
    ascii -= 26
  ans += chr(ascii)

print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()

ans = ""
for i in range(n):
  ascii = ord(s[i]) + n
  if ascii > ord('Z'):
    ascii -= ord('A')
  ans += char(ascii)

print(ans)
Problem p02898 (python)

Fixed submission:
n,k = map(int, input().split())
ar = list(map(int, input().split()))
ans = 0
for i,v in enumerate(ar):
  if v >= k:
    ans+= 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
k = int(input())
ar = list(map(int, input().split()))
ans = 0
for i,v in enumerate(ar):
  if v <= k:
    ans+= 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
k = int(input())
ar = list(map(int, input().split()))
ans = 0
for i in ar:
  if i <= k:
    ans+= 1
print(ans)
Problem p02981 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int,input().split())
print(min(a*n, b)
Problem p03059 (python)

Fixed submission:
a,b,t = map(int, input().split())
print(b* int((t+0.5)//a) )

Buggy submission (verdict: Runtime Error):
a,b,t = map(int, input().split())
print(b*((t+0.5)//a)
Problem p03061 (python)

Fixed submission:
from fractions import gcd

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

left = [0 for _ in range(N+1)]
right = [0 for _ in range(N+1)]

for i in range(N):
  left[i+1] = gcd(left[i],arr[i])
  right[-i-2] = gcd(right[-i-1], arr[-i-1])

ans = 1
for i in range(N):
  result = gcd(left[i], right[i+1])
  ans = max(ans, result)

print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
arr = sorted(map(int, input().split()))
surplus = [i%arr[0] == 0 for i in arr]
r = arr[0]
while not all([i%r == 0 for i in arr]):
  arr = [i % r for i in arr[1:]]
  arr.append(r)
  r = arr[0]
print(arr[-2])
Problem p03105 (python)

Fixed submission:
a,b,c = map(int, input().split())
print(min(c, b//a))

Buggy submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
print(min(c, b//a)
Problem p03106 (python)

Fixed submission:
a,b,k = map(int, input().split())
 
for i in range(min(a,b),0,-1):
  if a%i == 0 and b%i == 0:
    k-=1
    if k==0:
      print(i)
      break

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

for i in range(min(a,b),-1,-1):
  if a%i == 0 and b%i == 0:
    k-=1
    if k==0:
      print(i)
Problem p03145 (python)

Fixed submission:
ab,bc,ca = map(int,input().split())
print(ab * bc // 2)

Buggy submission (verdict: Runtime Error):
ab,bc,ca = map(int,input().split())
print(ab * ac // 2)
Problem p03337 (python)

Fixed submission:
a,b = map(int, input().split())
print(max(a+b, a-b, a*b))

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
print(max(a+b, a-b, a*b)
Problem p03378 (python)

Fixed submission:
n,m,x = map(int, input().split())
arr = list(map(int,input().split()))
i = 0
while arr[i] < x:
  i += 1

print(min(len(arr)-i, i))

Buggy submission (verdict: Runtime Error):
n,m,x = map(int, input().split())
arr = list(map(int,input().split()))
i = 0
while arr[i] < x:
  i += 1

print(min(len(arr)-i, i)
Problem p03493 (python)

Fixed submission:
s = input()
print(s.count('1'))

Buggy submission (verdict: Runtime Error):
s = input()
print(s.count('1')
Problem p03501 (python)

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

Buggy submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
print(min(n*a,b)
Problem p03502 (python)

Fixed submission:
N = int(input())
n = N
fN = 0
while n >= 10:
  fN += n%10
  n //= 10
fN += n
  
if N % fN == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
n = N
fN = 0
while n > 9:
  fN += n%10
  n //= 10
if N % fN == 0:
  print('Yes')
else:
  print('No')
Problem p03547 (python)

Fixed submission:
dic = {'A':10,'B':11,'C':12,'D':13,'E':14,'F':15}
x,y = input().split()
if dic[x] > dic[y]:
  print('>')
elif dic[x] < dic[y]:
  print('<')
else:
  print('=')

Buggy submission (verdict: Runtime Error):
dic = {'A':10,'B':11,'C':12,'D':13,'E':14,'F':15}
x,y = input().split()
it dic[x] > dic[y]:
  print('>')
elif dic[x] < dic[y]:
  print('<')
else:
  print('=')
Problem p03609 (python)

Fixed submission:
x,t = map(int, input().split())
if x > t:
  print(x-t)
else:
  print(0)

Buggy submission (verdict: Runtime Error):
x,t = map(int, input().split())
if x > t:
  print(x-t)
else:
  print(0
Problem p03643 (python)

Fixed submission:
n = input()
print('ABC'+n)

Buggy submission (verdict: Runtime Error):
n = input()
ptint('ABC'+n)
Problem p03711 (python)

Fixed submission:
seta = set([1,3,5,7,8,10,12])
setb = set([4,6,9,11])
setc = set([2])
 
a,b = map(int, input().split())
 
if (a in seta and b in seta) or (a in setb and b in setb) or (a in setc and b in setc):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
seta = set(1,3,5,7,8,10,12)
setb = set(4,6,9,11)
setc = set(2)

a,b = map(int, input().split())

if (a in seta and b in seta) or (a in setb and b in setb) or (a in setc and b in setc):
  print('Yes')
else:
  print('No')
Problem p03826 (python)

Fixed submission:
a,b,c,d = map(int, input().split())
print(max(a*b, c*d))

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int, input().split())
print(max(a*b, c*d)
Problem p02687 (python)

Fixed submission:
a = input()
if a == 'ABC': print('ARC')
else: print('ABC')

Buggy submission (verdict: Runtime Error):
X=int(input())
for i in range(-150,151):
    for j in range(-150,151):
        if i**5-j**5==X:
            print(i,j)
            exit()
Problem p02921 (python)

Fixed submission:
S = input()
T = input()

print(sum([s == t for s, t in zip(S, T)]))

Buggy submission (verdict: Runtime Error):
S = input()
T = input()

print(sum([s == t for s, t in zip(S, T)])
Problem p03262 (python)

Fixed submission:
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

N, X = [int(n) for n in input().split()]
xs = [int(n) for n in input().split()]

xs.append(X)

m = min(xs)
xs = [n - m for n in xs]
g = gcd(max(xs[0], xs[1]), min(xs[0], xs[1]))
for n in xs[2:]:
    g = gcd(max(g, n), min(g, n))
print(g)

Buggy submission (verdict: Runtime Error):
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a%b)

N, X = [int(n) for n in input().split()]
xs = [int(n) - X for n in input().split()]

if all([n == xs[0] for n in xs]):
    m = min(xs)
    xs = [n - m for n in xs]
    g = gcd(max(xs[0], xs[1]), min(xs[0], xs[1]))
    for n in xs[2:]:
        g = gcd(max(g, n), min(g, n))
    print(g)
else:
    print(xs[0])

Buggy submission (verdict: Runtime Error):
import math

N, X = [int(n) for n in input().split()]
xs = [int(n) - X for n in input().split()]

if len(xs) > 1:
    m = min(xs)
    xs = [n - m for n in xs]
    g = math.gcd(xs[0], xs[1])
    for n in xs[2:]:
        g = math.gcd(g, n)
    print(g)
else:
    print(xs[0])

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

N, X = [int(n) for n in input().split()]
xs = [int(n) - X for n in input().split()]

if len(xs) > 1:
    m = min(xs)
    xs = [n - m for n in xs]
    g = math.gcd(xs[0], xs[1])
    for n in xs[2:]:
        g = math.gcd(g, n)
    print(g)
else:
    print(xs[0])

Buggy submission (verdict: Runtime Error):
import math
from functools import reduce

N, X = [int(n) for n in input().split()]
xs = [int(n) - X for n in input().split()]

if len(xs) > 1:
    m = min(xs)
    xs = [n - m for n in xs]

print(reduce(math.gcd, xs))
Problem p03288 (python)

Fixed submission:
v = int(input())
 
if v < 1200:
  print('ABC')
elif v < 2800:
  print('ARC')
else:
  print('AGC')

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

if v < 1200:
  print('ABC')
else if v < 2800:
  print('ARC')
else:
  print('AGC')
Problem p02606 (python)

Fixed submission:
L,R,d=map(int,input().split())
cnt=0
for i in range(L,R+1):
    if i%d==0:
        cnt+=1
print(cnt)

Buggy submission (verdict: Runtime Error):
N=int(input())
ans=0
mul=1
while ans<=N:
    ans=6*(mul**2)
    mul+=1
ANS={}
for i in range(1,101):
    for j in range(i,101):
        for k in range(j,101):
            if i!=j and j!=k and k!=i:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=6
            elif i==j and j==k and k==i:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=1
            else:
                ANS[i*i+j*j+k*k+i*j+j*k+i*k]=3
for Z in range(1,N+1):
    if Z in ANS.keys():
        print(ANS[Z])
    else:
        print(0)
Problem p02678 (python)

Fixed submission:
import queue
N,M=map(int,input().split())
adj=[[] for i in range(N+1)]
parent=[-1] * (N+1)
for m in range(M):
    a,b=map(int,input().split())
    adj[a].append(b)
    adj[b].append(a)
q=queue.Queue()
q.put((1,0))
while(not q.empty()):
    x,p=q.get()
    if parent[x]!=-1:
        continue
    parent[x]=p
    for next in adj[x]:
        if parent[next]==-1:
            q.put((next,x))
print('Yes')
for p in parent[2:]:
    print(p)

Buggy submission (verdict: Runtime Error):
import queue
N,M=map(int,input().split())
adj=[[] for s in range(M+1)]
parent=[-1]*(N+1)
for i in range(M):
    A,B=map(int,input().split())
    adj[A].append(B)
    adj[B].append(A)
q=queue.Queue()
q.put((1,0))
while(not q.empty()):
    x,p=q.get()
    if parent[x]!=-1:
        continue
    parent[x]=p
    for next in adj[x]:
        if parent[next]==-1:
            q.put((next,x))
print('Yes')
for k in parent[2:]:
    print(k)

Buggy submission (verdict: Runtime Error):
import queue
N,M=map(int,input().split())
adj=[[] for _ in range(M+1)]
parent=[-1]*(N+1)
for i in range(M):
    A,B=map(int,input().split())
    adj[A].append(B)
    adj[B].append(A)
q=queue.Queue()
q.put((1,0))
while(not q.empty()):
    x,p=q.get()
    if parent[x]!=-1:
        continue
    parent[x]=p
    for next in adj[x]:
        if parent[next]==-1:
            q.put((next,x))
print('Yes')
for k in parent[2:]:
    print(k)

Buggy submission (verdict: Runtime Error):
import queue
N,M=map(int,input().split())
adj=[[] for _ in range(M+1)]
for i in range(M):
    A,B=map(int,input().split())
    adj[A].append(B)
    adj[B].append(A)
parent=[-1]*(N+1)
q=queue.Queue()
q.put((1,0))
while(not q.empty()):
    x,p=q.get()
    if parent[x]!=-1:
        continue
    parent[x]=p
    for next in adj[x]:
        if parent[next]==-1:
            q.put((next,x))
print('Yes')
for k in parent[2:]:
    print(k)
Problem p02684 (python)

Fixed submission:
N,K=map(int,input().split())
A=[int(i)-1 for i in input().split()]

if K<=N:
    p=0
    for i in range (K):
        p=A[p]
    print(p+1)
else:
    p=0
    t=[-1]*N #言ってない場所は-1、行った場所は-1で示す
    t[0]=0
    for i in range(1,N):
        p=A[p] #今いる場所の番号が次のテレポート先
        if t[p]!=-1: #もし次のテレポート先が行ったことある場所ならループの始まりの証拠
            break
        t[p]=i
    d=i-t[p] #今の番号（i）がループまでの数で、t[p]は１回目に来たときの回数を表すからその差分がループに必要な回数
    K-=i #ループの前までの部分は省く
    K%=d #ループを繰り返した後の余りだけ考える
    
    for i in range(K):
        p=A[p]
    print(p+1)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
A=[int(i) for i in input().split()]
k=[1]
a=1
for i in range(N):
    a=A[a-1]
    k.append(a)
    if i+2!=len(set(k)):
        del k[-1]
        Y=k[0:k.index(a)]
        Z=k[k.index(a):]
        break
    else:
        continue
if K<=len(Y):
    print(Z[K])
else:
    S=(K-len(Y))%(len(Z)) 
    print(Z[S])
Problem p02687 (python)

Fixed submission:
S=input()
print('ABC' if S=='ARC' else 'ARC')

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if i**5-t**5==X:
            S=i
            Z=t
            break
print(S,Z)

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if i**5-t**5==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)
Problem p02690 (python)

Fixed submission:
X=int(input())
l=[]
for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
for j in l:
    for s in l:
        if j-s==X and j!=s:
            ans=[]
            for i in [j,s]:
                aaa=abs(i)**(1/5)
                if i>=0:
                    ans.append(int(aaa))
                else:
                    ans.append(int(-aaa))
            print(*ans)
            exit()

Buggy submission (verdict: Runtime Error):
X=int(input())
l=[]
for i in range(300):
    a=i**5
    l.append(a)
    l.append(-a)
for j in l:
    for s in l:
        if j-s==X and j!=s:
            ans=[]
            for i in [j,s]:
                aaa=abs(i)**(1/5)
                if i>=0:
                    ans.append(int(aaa)
                else:
                    ans.append(-aaa)
            print(*ans)

Buggy submission (verdict: Runtime Error):
X=int(input())
for i in range(10**4,1):
    for t in range(-1000,1000):
        if i**5-t**5==X:
            S=i
            Z=t
            break
print(S,Z)

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,0,-1):
    for t in range(-Y//2,Y,1):
        if (i**5)-(t**5)==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,0,-1):
    for t in (-Y//2,Y,1):
        if (i**5)-(t**5)==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if (i**5)-(t**5)==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if i**5-t**5==X:
            S=i
            Z=t
            break
        else:
            continue
print(S,Z)

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y//2,Y,1):
        if i**5-t**5==X:
            S=i
            Z=t
            break
print(S,Z)

Buggy submission (verdict: Runtime Error):
X=int(input())
Y=int(X**(0.2))
for i in range(Y,-Y,-1):
    for t in (-Y,Y,1):
        if i**5-t**5==X:
            S=i
            Z=t
            break
print(S,Z)
Problem p02717 (python)

Fixed submission:
X,Y,Z=map(str,input().split())
print(Z+' '+X+' '+Y)

Buggy submission (verdict: Runtime Error):
N,K=map(int,input().split())
while N>=0:
    N=N-K
if abs(N)<abs(N+K):
    print(abs(N))
else:
    print(abs(N+K))
Problem p02730 (python)

Fixed submission:
S=list(input())
n=len(S)
ans='No'
if S==list(reversed(S)):
    new=S[0:((n-1)//2)]
    if new==list(reversed(new)):
        new2=S[((n+3)//2)-1:]
        if new2==list(reversed(new2)):
            ans='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
S=list(input())
n=len(S)
ans='No'
if S==list(reversed(S)):
    new=S[0:((n-1)//2)]
    if new==list(reversed(new)):
        new2=S[((n+3)//2):N+1]
        if new2==list(reversed(new2)):
            ans='Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
S=list(input())
n=len(S)
ans='NO'
if S==list(reversed(S)):
    new=S[0:((n-1)//2)]
    if new==list(reversed(new)):
        new2=S[((n+3)//2):N+1]
        if new2==list(reversed(new2)):
            ans='YES'
print(ans)
Problem p02811 (python)

Fixed submission:
a,b = map(int,input().split())
sum=int(a)*500
if sum>=b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
print(S.count('ABC'))

Buggy submission (verdict: Runtime Error):
N=input()
S=input()
print(S.count('ABC'))
Problem p02910 (python)

Fixed submission:
S=input()
print('No' if 'L' in S[0::2] or 'R' in S[1::2] else 'Yes')

Buggy submission (verdict: Runtime Error):
S=input()
for i in range(0,(len(S)),2):
    if S[i]=='R' or S[i]=='U' or S[i]=='D':
        for j in range (1,(len(S)),2):
            if S[j]=='L' or S[j]=='U' or S[j]=='D':
                mark=True
            else:
                mark=False
                break
    else:
        mark=False
        break
print('Yes' if mark==True else 'No')