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

Fixed submission:
import sys
input = sys.stdin.readline
 
x, y, z, k = map(int, input().split())
a = sorted(int(i) for i in input().split())
b = sorted(int(i) for i in input().split())
c = sorted(int(i) for i in input().split())
 
#a.sort(reverse=True)
#b.sort(reverse=True)
#c.sort(reverse=True)
 
ab = sorted(i+j for i in a for j in b)[:-k-1:-1]
abc = sorted(i+j for i in ab for j in c)[:-k-1:-1]
 
print(*abc[:k], sep="\n")

Buggy submission (verdict: Runtime Error):
def transport(n,a,b,c,d,e):
    s = [a,b,c,d,e]
    x = min(s)
    return 5+int(1/x*(n-1))
n = int(input())
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
print(transport(n,a,b,c,d,e))

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

s1=list(map(int, input().split()))
s2=list(map(int, input().split()))
s3=list(map(int, input().split()))

ans1 = sorted(i+j for i in s1 for j in s2)
ans2 = sorted(i+j for i in ans1 for j in s3)
res = sorted(ans2,reverse=True)
print(*res[:k+1], sep="\n")

Buggy submission (verdict: Runtime Error):
def cake(s1,s2,s3):
    ans1 = sorted(i+j for i in s1 for j in s2)
    ans2 = sorted(i+j for i in ans1 for j in s3)
    return ans2    
    
a,b,c,d = map(int, input().split())

s1=list(map(int, input().split()))
s2=list(map(int, input().split()))
s3=list(map(int, input().split()))

ans1 = sorted(i+j for i in s1 for j in s2)
ans2 = sorted(i+j for i in ans1 for j in s3)
res = sorted(ans2,reverse=True)
print(*res[:k+1], sep="\n")
Problem p03239 (python)

Fixed submission:
N,T = map(int,input().split())
CT = [list(map(int,input().split())) for i in range(N)]
CT = list(filter(lambda x:x[1]<=T,CT))
if len(CT)==0:
    print('TLE')
else:
    print(min(CT)[0])

Buggy submission (verdict: Runtime Error):
N,T = map(int,input().split())
CT = [list(map(int,input().split())) for i in range(N)]
CT = list(filter(lambda x:x[1]<=N,CT))
print(min(CT[0]))
Problem p02675 (python)

Fixed submission:
num=int(input())
mod=num%10
if mod==3:
  print('bon')
elif mod in [0,1,6,8]:
  print('pon')
else:
  print('hon')

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

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

Buggy submission (verdict: Runtime Error):
num=int(input())
mod=num%10
if mod==3:
  print('bon')
elif mod==0,1,6,8:
  print('pon')
else:
  print('hon')
Problem p02687 (python)

Fixed submission:
contest=input()
if contest=='ABC':
  print('ARC')
elif contest=='ARC':
  print('ABC')
else:
  print('Error')

Buggy submission (verdict: Runtime Error):
contest=input()
if contest='ABC':
  print('ARC')
elif contest='ARC':
  print('ABC')
else:
  print('Error')
Problem p02694 (python)

Fixed submission:
import math

x=int(input())
trial=0
p=100
while p<x:
  trial+=1
  p=p*1.01
  p=math.floor(p)
print(trial)

Buggy submission (verdict: Runtime Error):
X=int(input())
trial=0
p=100
while p<=x:
  trial+=1
  p=p*1.01
print(trial)
Problem p02700 (python)

Fixed submission:
a,b,c,d=map(int,input().split())
while a>0 and b>0:
  c-=b
  a-=d
if a<=0 and c>0:
  print('No')
elif c<=0:
  print('Yes')

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
while a,b>0:
  c-=b
  a-=d
if a<=0,b>0:
  print('No')
elif b<=0:
  print('Yes')
Problem p02705 (python)

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

Buggy submission (verdict: Runtime Error):
import math
pi=math.pi
r=int(input())
len=2*pi*r
return len

Buggy submission (verdict: Runtime Error):
import math
pi=math.pi()
r=int(input())
len=2*pi*r
print(len)

Buggy submission (verdict: Runtime Error):
import math
pi=math.pi()
r=int(input())
len=2*pi*r
return len
Problem p02675 (python)

Fixed submission:
a = int(input())
b = a - a // 10 * 10
c = ("pon" if b == 0 else
     "pon" if b == 1 else
     "hon" if b == 2 else
     "bon" if b == 3 else
     "hon" if b == 4 else
     "hon" if b == 5 else
     "pon" if b == 6 else
     "hon" if b == 7 else
     "pon" if b == 8 else
     "hon" if b == 9 else
     ""
     )
print(c)

Buggy submission (verdict: Runtime Error):
a = input()
b = a - a // 10 * 10
c = ("pon" if b == 0 else
     "pon" if b == 1 else
     "hon" if b == 2 else
     "bon" if b == 3 else
     "hon" if b == 4 else
     "hon" if b == 5 else
     "pon" if b == 6 else
     "hon" if b == 7 else
     "pon" if b == 8 else
     "hon" if b == 9 else
     ""
     )
print(c)
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split())
i = 1

for j in range(10000):
    H = H - A
    if H <= 0:
        i = i
    else:
        i = i + 1
if H <= 0:
    print(i)

Buggy submission (verdict: Runtime Error):
H, A = int(input().split())
i = 1

for j in range(10000):
  # i 回目の攻撃
  H = H - A
  
  # HP判定
  if H <= 0:
    i = i
  else:
    i = i + 1

# 何回攻撃すればよいか
if H <= 0:
  print(i)

Buggy submission (verdict: Runtime Error):
H = input()
A = input()

i = 1

# 1回目の攻撃
for j in range(10000):
    H = H - A
    if H < 0 :
      print(i)
    else:
      i = i + 1
Problem p02683 (python)

Fixed submission:
N,M,X = map(int,input().split())

A =  []
S = [0 for _ in range(N)] 
min_value = 0 
score=[0 for _ in range(M)] 

for x in range(N):
  A.append(list(map(int,input().split())))

for x in range(N):
  min_value += A[x][0]


sucess = 0

for bit in range(2**N):
  for i in range(N):
    if (bit >> i) & 1:
      S.append(A[i][0])
      for x in range(M):
        score[x] += A[i][x+1]
  flag = 0
  #print(score)
  for k in score:
    if k >= X:
      flag += 1
    if flag ==len(score):
      #print("S",S)
      if min_value >= sum(S):
        min_value = sum(S)
        sucess += 1 
        
  score=[0 for _ in range(M)]
  S =[]
  
if sucess > 0:
	print(min_value)
else:
  print("-1")

Buggy submission (verdict: Runtime Error):
N,M,X = map(int,input().split())

A =  []
S = [0 for _ in range(N)] 
min_value = 0 
score=[0 for _ in range(N)] 

for x in range(N):
  A.append(list(map(int,input().split())))

for x in range(N):
  min_value += A[x][0]
  
sucess = 0

for bit in range(2**N):
  for i in range(N):
    if (bit >> i) & 1:
      S.append(A[i][0])
      for x in range(M):
        score[x] += A[i][x+1]
  flag = 0

  for k in score:
    if k >= 10:
      flag += 1
    if flag ==len(score):
      if min_value >= sum(S):
        min_value = sum(S)
        sucess += 1 
        
  score=[0 for _ in range(N)]
  S =[]
  
if sucess > 0:
	print(min_value)
else:
  print("-1")
Problem p02700 (python)

Fixed submission:
A,B,C,D = map(int,input().split())
while True:
  C -= B
  if C <= 0:
    print("Yes")
    break
  A -= D
  if A <= 0:
    print("No")
    break

Buggy submission (verdict: Runtime Error):
A,B,C,D = map(int,input().split())
while True:
  A -= D
  C -= B
  if A < 0:
    print("No"):
    break
  if C < 0:
    print("Yes")
    break
Problem p02761 (python)

Fixed submission:
N,M = map(int,input().split())
N_list = [0]*N
flg_list  = [0]*N
flg = False
for i in range(M):
    s,c = map(int,input().split())
    if flg_list[s-1] == 0:
        N_list[s-1] = c
        flg_list[s-1] = 1
    elif N_list[s-1] != c:
        flg = True
        break
res = 0
for i in range(N-1,-1,-1):
    res += 10**i * N_list[N-1-i]

if N == 1 and not flg:
    print(res)
elif flg or (N_list[0] == 0 and flg_list[0] == 1):
    print("-1")
elif N == len(str(res)):
    print(res)
else:
    print(res+10**(N-1))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
N_list = [0]*N
flg_list  = [0]*N
flg = False
for i in range(M):
    s,c = map(int,input().split())
    if flg_list[s-1] == 0:
        N_list[s-1] = c
        flg_list[s-1] = 1
    elif N_list[s-1] != c:
        flg = True
        break
res = 0
for i in range(N-1,-1,-1):
    res += 10**i * N_list[N-1-i]

if N = 1:
    print(res)
elif flg or (N_list[0] == 0 and flg_list[0] == 1):
    print("-1")
elif N == len(str(res)):
    print(res)
else:
    print(res+10**(N-1))
Problem p02811 (python)

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

Buggy submission (verdict: Runtime Error):
K,X = map(int,input().split())
if 500*k >= X:
    print("Yes")
else:
    print("No")
Problem p02899 (python)

Fixed submission:
N = int(input())
K = list(map(int,input().split()))
M = dict(zip(range(1,N+1),K))
M = sorted(M.items(), key = lambda x:x[1])
newM = []
for i in M:
  newM.append(i[0])
print(*newM)

Buggy submission (verdict: Runtime Error):
N = int(input())
K = list(map(int,input().split()))
M = dict(zip(range(1,N+1),K))
M = sorted(M.items(), key = lambda x:x[1])
newM = []
for i in M:
  newM.append(i[0])
print(+newM)
Problem p02675 (python)

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

if N[-1] == '2':
  print('hon')
elif N[-1] == '4':
  print('hon')
elif N[-1] == '5':
  print('hon')
elif N[-1] == '7':
  print ('hon')
elif N[-1] == '9':
   print('hon')
elif N[-1] == '3':
   print('bon')
else:
   print('pon')

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

if N[-1] == '2':
  print 'hon'
elif N[-1] == '4':
  print'hon'
elif N[-1] == '5':
  print'hon'
elif N[-1] == '7':
  print 'hon'
elif N[-1] == '9':
   print'hon'
elif N[-1] == '3':
   print'bon'
else:
   print'pon'
Problem p03633 (python)

Fixed submission:
import fractions
import math
from functools import reduce
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

def lcm(*args):
    return reduce(lambda a,b: a * b // fractions.gcd(a, b), args)

arr_data = getinputdata()

n = int(arr_data[0][0])

arr=[int(arr_data[i][0]) for i in range(1,1+n)]

print(lcm(*tuple(arr)))

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

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

def lcm(*args):
    return reduce(lambda a,b: a * b // math.gcd(a, b), args)

arr_data = getinputdata()

n = int(arr_data[0][0])

arr=[int(arr_data[i][0]) for i in range(1,1+n)]

print(lcm(*tuple(arr)))
Problem p03659 (python)

Fixed submission:
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = True

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
list01 = [int(x) for x in arr_data[1]]

sumdata = sum(list01)

middledata = sumdata // 2
#初期値
x = list01[0]
y = sumdata-x
temp=abs(x-y)

for i in range(1, n-1):

    x += list01[i]
    y = sumdata-x
    
    if temp>abs(x-y):
        
        temp=abs(x-y)
        
        
print(temp)

Buggy submission (verdict: Runtime Error):
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = True

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = True

            else:

                flg = False
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

sumdata = 0

for v in list01:
    
    sumdata += abs(v)

mytotal = 0

for v in list(map(int, arr_data[1])):
    
    if mytotal + v > sumdata // 2:
        
        break
        
    else:
        
        mytotal += v
        
print(sumdata-mytotal-mytotal)
Problem p03721 (python)

Fixed submission:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

#回数
n = int(arr_data[0][0])

#番目
k = int(arr_data[0][1])

arr=[]

for i in range(1, 1 + n):
    
    arr.append(list(map(int, arr_data[i])))

arr.sort(key=lambda x:(x[0]))

#print(arr)

#sys.exit()

mysum=0

for i in range(0,n):
 
    cnt = arr[i][1]
    j = arr[i][0]
 

    if k<=mysum+cnt:
        
        print(j)
        
        break
        
    else:
        
        
        mysum+=cnt

Buggy submission (verdict: Runtime Error):
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

#回数
n = int(arr_data[0][0])

#番目
k = int(arr_data[0][1])

s=""

for i in range(1, 1 + n):

    cnt = int(arr_data[i][1])
    j = arr_data[i][0]

    s+=str(cnt * j)

print(s[k-1])
Problem p03864 (python)

Fixed submission:
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
x = int(arr_data[0][1])

arr=[int(arr_data[1][x]) for x in range(0,n)]

cnt=0

for i in range(n-1):
    
    zan=arr[i]+arr[i+1]-x
     
    if 0<arr[i+1]<=zan:

        cnt+=arr[i+1]
        zan-=arr[i+1]
        arr[i+1]=0

    elif arr[i+1]>zan>0:

        cnt+=zan
        arr[i+1]-=zan
        zan=0

    if 0<arr[i]<=zan:

        cnt+=arr[i]
        zan-=arr[i]
        arr[i]=0

    elif arr[i]>zan>0:

        cnt+=zan
        arr[i]-=zan
        zan=0

    
print(cnt)

Buggy submission (verdict: Runtime Error):
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
x = int(arr_data[0][1])

arr=[int(arr_data[1][x]) for x in range(0,n)]
cnt=0
for i in range(n-1):
    
    if arr[i]+arr[i+1]>x:
        
        if arr[i]-x>=0:
            
            cnt+=arr[i-x]
            arr[i]=0
            
        if arr[i]+arr[i+1]-x>=0:
            
            cnt+=arr[i+1]-x
            arr[i+1]=arr[i+1]-x
                   
print(cnt)
Problem p02694 (python)

Fixed submission:
from sys import exit

def main():
    X = int(input())
    deposit = 100

    i = 0
    while True:
        deposit = int(deposit * 1.01)
        i += 1

        if deposit >= X:
            print(i)
            exit()

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# from sys import exit

def main():
    x = int(input())
    d = 100
    ans = 0
    
    while d < x:
    d = int(d*1.01)
    ans += 1
    print(ans)

if __name__ == '__main__':
    main()
Problem p02702 (python)

Fixed submission:
def main():
    S = input()
    # S = "1" * 200000
    S = S[::-1]

    x = 1
    tot = 0
    cnt = [0] * 2019
    ans = 0

    for i in range(len(S)):
        # print("-----")
        # print(f"i: {i}")
        # print(f"tot: {tot}")
        # print(f"S[i]: {S[i]}")
        # print(f"x: {x}")
        # print(f"cnt: {cnt}")
        # print(f"cnt[tot]: {cnt[tot]}")
        # print(f"ans: {ans}")

        cnt[tot] += 1
        tot = (tot + (int(S[i]) * x)) % 2019
        ans += cnt[tot]
        x = (x * 10) % 2019
    
    # print("-----")
    # print(f"i: {i}")
    # print(f"tot: {tot}")
    # print(f"S[i]: {S[i]}")
    # print(f"x: {x}")
    # print(f"cnt: {cnt}")
    # print(f"cnt[tot]: {cnt[tot]}")
    # print(f"ans: {ans}")
    
    print(ans)


if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def main():
    S = input()
    # S = "1" * 200000
    S = S[::-1]

    x = float(1)
    tot = 0
    cnt = [0] * 2019
    ans = 0

    for i in range(len(S)):
        # print("-----")
        # print(f"i: {i}")
        # print(f"tot: {tot}")
        # print(f"S[i]: {S[i]}")
        # print(f"x: {x}")
        # print(f"cnt: {cnt}")
        # print(f"cnt[tot]: {cnt[tot]}")
        # print(f"ans: {ans}")

        cnt[tot] += 1
        tot = int((tot + (int(S[i]) * x)) % 2019)
        ans += cnt[tot]
        x = x * 10
    
    # print("-----")
    # print(f"i: {i}")
    # print(f"tot: {tot}")
    # print(f"S[i]: {S[i]}")
    # print(f"x: {x}")
    # print(f"cnt: {cnt}")
    # print(f"cnt[tot]: {cnt[tot]}")
    # print(f"ans: {ans}")
    
    print(ans)


if __name__ == '__main__':
    main()
Problem p02717 (python)

Fixed submission:

X, Y, Z = input().split()

X, Y = Y, X
X, Z = Z, X

print(X + " " + Y + " " + Z)

Buggy submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())

X, Y = Y, X
X, Z = Z, X

print(f'{X} {Y} {Z}')
Problem p03633 (python)

Fixed submission:
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

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

def lcm(a, b):
    g = gcd(a, b)
    return a // g * b

res = Ts[0]
for T in Ts:
    res = lcm(res, T)
print(int(res))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

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

def lcm(a, b):
    g = gcd(a, b)
    return a / g * b

res = Ts[0]
for T in Ts:
    res = lcm(res, T)
print(int(res))

Buggy submission (verdict: Runtime Error):
from collections import defaultdict

N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))

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

def lcm(a, b):
    g = gcd(a, b)
    return a / g * b

res = Ts[0]
for T in Ts[1:]:
    res = lcm(res, T)
print(int(res))
Problem p03351 (python)

Fixed submission:
a, b, c, d = map(int, input().split())
if abs(a - c) <= d or (abs(a - b) <= d and abs(b - c) < d):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
x = int(input())
import math
y = int(math.sqrt(x)) - 2
for i in range(y,y+5):
    if i ** 2 <= x and (i + 1)** 2 > x and i > 0:
        print(i ** 2)
Problem p02675 (python)

Fixed submission:
N = int(input())
a = N % 10
if a == 2 or a==4 or a==5 or a==7 or a==9:
    print('hon')
elif a == 0 or a==1 or a==6 or a==8:
    print('pon')
else:
    print('bon')

Buggy submission (verdict: Runtime Error):
N = int(input('number'))
a = N % 10
if a = 2 or 4 or 5 or 7 or 9:
  print('hon')
elif a = 0 or 1 or 6 or 8:
  print('pon')
else:
  print('bon')

Buggy submission (verdict: Runtime Error):
a = N % 10
if a = 2 or 4 or 5 or 7 or 9:
  print('hon')
elif a = 0 or 1 or 6 or 8:
  print('pon')
else:
  print('bon')
Problem p02683 (python)

Fixed submission:
import numpy as np 


n,m,x = map(int, input().split())


s_list = list()

for i in range(n):
    line = list(map(int, input().split()))
    s_list.append([line[0], np.array(line[1:], dtype=int)])


cands = list()
# cost, value
cands.append([0, np.zeros(m, dtype=int)])


for l in s_list:
    next_cands = list()
    for c in cands:
        next_cands.append([c[0] + l[0], c[1] + l[1]])
    cands += next_cands


min_cost = 10**12
for l in cands:
    if (l[1] >= x).all() and l[0] < min_cost:
        min_cost = l[0]


if min_cost == 10**12:
    print(-1)
else:
    print(min_cost)

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


n,m,x = map(int, input().split())


s_list = list()

for i in range(n):
    line = list(map(int, input().split()))
    s_list.append([line[0], np.array(line[1:], dtype=int)])


cands = list()
# cost, value
cands.append([0, np.zeros(m, dtype=int)])


for l in s_list:
    next_cands = list()
    for c in cands:
        next_cands.append([c[0] + l[0], c[1] + l[1]])
    cands += next_cands


min_cost = 10**6
for l in cands:
    if (l[1] >= x).all() and l[0] < min_cost:
        min_cost = l[0]


if min_cost == 10**6:
    print(-1)
else:
    print(min_cost)
Problem p02817 (python)

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

Buggy submission (verdict: Runtime Error):
a,b = input()
print(b+a)
Problem p02818 (python)

Fixed submission:
a, b, k = map(int, input().split())
 
if a >= k:
  print(a-k, b)
else:
  if a+b > k:
    print(0, b-(k-a))
  else:
    print(0,0)

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 0
  else:
    break
    
print(" ".join(map(str, [a,b])))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 0:
  else:
    break
    
print(" ".join(map(str, [a,b])))

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input())
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 0:
  else:
    break
    
print(" ".join(map(str, [a,b])))
Problem p02681 (python)

Fixed submission:
S = input()
T = input()
ns = len(S)
U = T[:ns]
if S == U:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
ns = len(S)
U = str[:ns]
if T == U:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
S = input()
T = input()
ns = len(S)
U = str[:S]
if T == U:
  print("Yes")
else:
  print("No")
Problem p02690 (python)

Fixed submission:
X = int(input())
for A in range(-120, 120):
  for B in range(-120, 120):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
      quit()

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

for A in range(100):
  for B in range(100):
    if A**5 - B**5 == X:
      print(str(A) + " " + str(B))
  break
    if A**5 + B**5 == X:
      print(str(A) + " -" + str(B))
  break

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

for A in range(100):
  C = A ** 5 - X
  B = C ** 0.2
  if B % 1 == 0:
    print(str(A) + " " + str(B))
    break
    
for B in range(100):
  C = B ** 5+ X
  A = C ** 0.2
  if A % 1 == 0:
    print(str(A) + " " + str(B))
    break

Buggy submission (verdict: Runtime Error):
import math
X = int(input())

for A in range(100):
  C = A ** 5 - X
  B = math.sqrt(C)
  if B % 1 == 0:
    print(str(A) + " " + str(B))
    break
    
for B in range(100):
  C = B ** 5 + X
  A = math.sqrt(C)
  if A % 1 == 0:
    print(str(A) + " " + str(B))
    break
Problem p02696 (python)

Fixed submission:
i = list(map(int, input().split()))
A = i[0]
B = i[1]
N = i[2]
if N < B-1:
    print(A * N // B)
else:
    print(A * (B-1) // B)

Buggy submission (verdict: Runtime Error):
i = list(map(int, input().split()))
A = i[0]
B = i[1]
N = i[2]
a = -10 ** 20
for x in range(1, N+1):
  s = A * x // B
  t = A * (X // B)
  if s -  t > a:
    a = s - t
print(a)

Buggy submission (verdict: Runtime Error):
i = list(map(int, input().split()))
A = i[0]
B = i[1]
N = i[2]
a = -10 ** 20
for x in range(1, N+1):
  s = A * x // B
  t_0 = x // B
  t = A * t
  u = s - t
  if u > a:
    a = u
print(a)