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

Fixed submission:
info_A = input().split()
info_B = input().split()
T = int(input())
win = ''

A = int(info_A[0]) #A（鬼）の開始位置
V = int(info_A[1]) #A（鬼）の速度
B = int(info_B[0]) #B（逃げる側）の開始位置
W = int(info_B[1]) #B（逃げる側）の速度

# 逃げる側の速度が同じか速ければ追いつけない
if W >= V:
    win = 'B'

else:
# T秒後までに同じ座標にいればAが勝つ
    k = (B-A)/(V-W)
    if A>B:
        k = -k
    
    if k <= T and 0 < k:
        win = 'A'
    else:
        win = 'B'


if win == 'A':
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
info_A = input().split()
info_B = input().split()
T = int(input())
win = ''

A = int(info_A[0]) #A（鬼）の開始位置
V = int(info_A[1]) #A（鬼）の速度
B = int(info_B[0]) #B（逃げる側）の開始位置
W = int(info_B[1]) #B（逃げる側）の速度

# 逃げる側の速度が同じか速ければ追いつけない
if W >= V:
    win = 'B'

else:
# T秒後までに同じ座標にいればAが勝つ
    k = (B-A)/(V-W)
    if k <= T and 0 < k and (k*10)%10 == 0
        win = 'A'

if win == 'A':
    print('YES')
else:
    print('NO')
Problem p02900 (python)

Fixed submission:
import math

input = raw_input

def isprime(n):
    if n == 1: return True
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

A,B = map(int, input().split(" "))

a = []
for i in range(1,int(math.sqrt(A))+1):
    if A % i == 0:
        a.append(i)
        if i != A / i:
            a.append(A/i)

b = []
for i in range(1,int(math.sqrt(B))+1):
    if B % i == 0:
        b.append(i)
        if i != B / i:
            b.append(B/i)
c = 0
for i in a:
    if i in b and isprime(i):
        c += 1
print(c)

Buggy submission (verdict: Runtime Error):
input = raw_input

def isprime(n):
    if n == 1: return True
    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

A,B = map(int, input().split(" "))

a = []
for i in range(1,int(math.sqrt(A))+1):
    if A % i == 0:
        a.append(i)
        if i != A / i:
            a.append(A/i)

b = []
for i in range(1,int(math.sqrt(B))+1):
    if B % i == 0:
        b.append(i)
        if i != B / i:
            b.append(B/i)
c = 0
for i in a:
    if i in b and isprime(i):
        c += 1
print(c)
Problem p03078 (python)

Fixed submission:
def lsum(x):
    return A[x[0]] + B[x[1]] + C[x[2]]

def nextlist():
    global lx
    idx = 0
    m = lsum(lx[0])
    for i in range(len(lx)):
        s = lsum(lx[i])
        if m < s:
            m = s
            idx = i
    p = lx.pop(idx)
    wa.append(lsum(p))
    if p[0] > 0:
        if not [p[0]-1, p[1], p[2]] in lx:
            lx.append([p[0]-1, p[1], p[2]])
    if p[1] > 0:
        if not [p[0], p[1]-1, p[2]] in lx:
            lx.append([p[0], p[1]-1, p[2]])
    if p[2] > 0:
        if not [p[0], p[1], p[2]-1] in lx:
            lx.append([p[0], p[1], p[2]-1])

l1 = list(map(int, input().split(" ")))

X,Y,Z,K = l1[0],l1[1],l1[2],l1[3]
A = sorted(list(map(int, input().split(" "))))
B = sorted(list(map(int, input().split(" "))))
C = sorted(list(map(int, input().split(" "))))

wa = []
lx = [[X-1,Y-1,Z-1]]

for i in range(K):
    nextlist()

for l in wa:
    print(l)

Buggy submission (verdict: Runtime Error):
def lsum(x):
    return A[x[0]] + B[x[1]] + C[x[2]]

def nextlist():
    global lx
    idx = 0
    m = lsum(lx[0])
    for i in range(len(lx)):
        s = lsum(lx[i])
        if m < s:
            m = s
            idx = i
    p = lx.pop(idx)
    wa.append(lsum(p))
    if p[0] > 0:
        if not [p[0]-1, p[1], p[2]] in lx:
            lx.append([p[0]-1, p[1], p[2]])
    if p[1] > 0:
        if not [p[0], p[1]-1, p[2]] in lx:
            lx.append([p[0], p[1]-1, p[2]])
    if p[2] > 0:
        if not [p[0], p[1], p[2]-1] in lx:
            lx.append([p[0], p[1], p[2]-1])

l1 = list(map(int, input().split(" ")))

X,Y,Z,K = l1[0],l1[1],l1[2],l1[3]
A = sorted(list(map(int, input().split(" "))))
B = sorted(list(map(int, input().split(" "))))
C = sorted(list(map(int, input().split(" "))))

wa = []
lx = [[X-1,Y-1,Z-1]]

for i in range(K):
    nextlist()

for l in wa:
    print(l)
Problem p03163 (python)

Fixed submission:
N,W = map(int, input().strip().split(" "))
oj = []
for i in range(N):
    tmp = list(map(int, input().strip().split(" ")))
    oj.append(tmp)

dp = [[0] * (W+1) for i in range(N)]
for i in range(W+1):
    dp[0][i] = oj[0][1] if oj[0][0] <= i else 0

for i in range(1,N):
    for j in range(W+1):
        if j < oj[i][0]:
            dp[i][j] = dp[i-1][j]
        else:
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-oj[i][0]] + oj[i][1])
print(max(dp[N-1]))

Buggy submission (verdict: Runtime Error):
N,W = map(int, input().strip().split(" "))
oj = []
for i in range(N):
    tmp = list(map(int, input().strip().split(" ")))
    oj.append(tmp)

def chk(x):
    s = f"{x:b}"
    s = s[-1::-1]
    w = 0
    v = 0
    for i in range(len(s)):
        if s[i] == '1':
            w += oj[i][0]
            v += oj[i][1]
    return w,v

ans = 0
for i in range(0, 2**N):
    w,v = chk(i)
    if w <= W and v > ans:
        ans = v
print(ans)

Buggy submission (verdict: Runtime Error):
N,W = map(int, input().strip().split(" "))
oj = []
for i in range(N):
    tmp = list(map(int, input().strip().split(" ")))
    oj.append(tmp)

def chk(x):
    s = f"{x:b}"
    s = s[-1::-1]
    w = 0
    v = 0
    for i in range(len(s)):
        if s[i] == '1':
            w += oj[i][0]
            v += oj[i][1]
    return w,v

ans = 0
for i in range(0, 2**N):
    w,v = chk(i)
    if w <= W and v > ans:
        ans = v
print(ans)
Problem p03164 (python)

Fixed submission:
N,W = map(int, input().strip().split(" "))
oj = []
for i in range(N):
    tmp = list(map(int, input().strip().split(" ")))
    oj.append(tmp)

#dp = [0] * (W+1)
M = 100 * 1001
dp = [10**10] * M

dp[oj[0][1]] = oj[0][0]

for i in range(1,N):
    for j in range(M, -1, -1):
        if j + oj[i][1] < M:
            dp[j + oj[i][1]] = min(dp[j + oj[i][1]], dp[j] + oj[i][0])
    dp[oj[i][1]] = min(dp[oj[i][1]], oj[i][0])

v = 0
for i in range(M):
    if dp[i] <= W:
        v = i
print(v)

Buggy submission (verdict: Runtime Error):
N,W=map(int,input().split())
oj=[]
for i in range(N):
  oj.append(list(map(int,input().split())))
M=100*1001
dp=[10**10]*M
dp[0]=0
for i in range(N):
  for j in range(M,-1,-1):
    if j+oj[i][1]<M:
      k=j+oj[i][1]
      dp[k]=min(dp[k,dp[j]+oj[i][0])
v=0
for i in range(M):
  if dp[i]<=W:v=i
print(v)

Buggy submission (verdict: Runtime Error):
N,W = map(int, input().strip().split(" "))
oj = []
for i in range(N):
    tmp = list(map(int, input().strip().split(" ")))
    oj.append(tmp)

dp = [0] * (W+1)
for i in range(W+1):
    dp[i] = oj[0][1] if oj[0][0] <= i else 0

for i in range(1,N):
    for j in range(W,-1,-1):
        if j < oj[i][0]:
            dp[j] = dp[j]
        else:
            dp[j] = max(dp[j], dp[j-oj[i][0]] + oj[i][1])
print(max(dp))
Problem p02645 (python)

Fixed submission:
import fileinput
 
lines = list(fileinput.input())
 
for x in lines:
	print(x[:3])

Buggy submission (verdict: Runtime Error):
import fileinput
 
lines = list(fileinput.input())
 
for x in lines():
	print(x[:3])

Buggy submission (verdict: Runtime Error):
import fileinput
 
lines = list(fileinput.input())
 
for x in lines():
	print(x[-3:])
Problem p02645 (python)

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

Buggy submission (verdict: Runtime Error):
import sys
from itertools import accumulate

N, K = [int(x) for x in input().split()]
A = [int(x) for x in input().split()]

current_arr = A
if K > 41:
    print(*([N]*N))
else:
    for _ in range(K):
        imos = [0] * N
        ruiseki = [0] * (N+1)
        for i, ai in enumerate(current_arr):
            imos[max([0, i-ai])] += 1
            if i+ai+1 < N:
                imos[i+ai+1] -= 1
        for j, im in enumerate(imos):
            ruiseki[j+1] = ruiseki[j] + im
        current_arr = ruiseki[1:]
#print(imos)
#print(ruiseki)
#print(*accumulate(imos))
    print(*current_arr)
Problem p02993 (python)

Fixed submission:
S = input()
A = [int(S[0]),int(S[1]),int(S[2]),int(S[3])]

flg = 0
for i in range(len(A) - 1):
  if A[i] == A[i + 1]:
    flg = 1
    break

if flg:
  print("Bad")
else:
  print("Good")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [None for _ in range(N)]
B = [None for _ in range(N)]
endflg = [0 for _ in range(N)]
for i in range(N):
  A[i],B[i] = map(int,input().split())
time = 0

limit = max(B) + 1

for i in range(N):
  Pb = B.index(min(B))
  if time + A[Pb] <= B[Pb]:
    endflg[Pb] = 1
    B[Pb] = limit
    time = time + A[Pb]
  else:
    break
    
if endflg == [1 for _ in range(N)]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
def GCD(a,b):
  if a<b:
    tmp = a
    a = b
    b = tmp
 
  r = a % b
  while (r!=0): 
    a = b
    b = r
    r = a % b
  return b


A,B,C,D = map(int,input().split())
A = A - 1
upperC = int(B // C)
upperD = int(B // D)
lowerC = int(A // C)
lowerD = int(A // D)

numC = upperC - lowerC
numD = upperD - lowerD

gcd = GCD(C,D)

lcm = C * D / gcd
upperL = int(B / lcm)
lowerL = int(A / lcm)
numL = upperL - lowerL

print(str(B - A - (numC + numD - numL)))
Problem p02994 (python)

Fixed submission:
N,L = map(int,input().split())
taste = [(L+i) for i in range(N)]
taste_abs = [abs(taste[i]) for i in range(N)] 
p = taste_abs.index(min(taste_abs))
taste[p] = 0
print(str(sum(taste)))

Buggy submission (verdict: Runtime Error):
N,L = map(int,input().split())
taste = [None for _ in range(N)]
for i in range(N):
  taste[i] = L + i
taste_abs = [abs(taste[i]) for i in range(N)] 
  
p = taste.index(min(taste_abs))
taste[p] = 0
print(str(sum(taste)))
Problem p02996 (python)

Fixed submission:
N = int(input())
A = [None for _ in range(N)]
B = [None for _ in range(N)]
endflg = [0 for _ in range(N)]
for i in range(N):
  A[i],B[i] = map(int,input().split())
time = 0
 
z = zip(B,A)
s = sorted(z)
for i in range(N):
  if time + s[i][1] <= s[i][0]:
    time = time +  s[i][1]
    endflg[i] = 1
  else :
    break
    
if endflg == [1 for _ in range(N)]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [None for _ in range(N)]
B = [None for _ in range(N)]
endflg = [0 for _ in range(N)]
for i in range(N):
  A[i],B[i] = map(int,input().split())
time = 0
 
z = zip(B,A)
s = sorted(z)
for i in range(N):
  if time + s[i][1] <= s[i][0]:
    time = time + = s[i][1]
    endflg[i] = 1
  else :
    break
    
if endflg == [1 for _ in range(N)]:
  print("Yes")
else:
  print("No")
Problem p02645 (python)

Fixed submission:
s = input()
print(s[0:3])

Buggy submission (verdict: Runtime Error):
s = list(input())
print(''.join(li[0:2]))
Problem p02645 (python)

Fixed submission:
val = input()
print(val[0:3])

Buggy submission (verdict: Runtime Error):
import random
val = input()
 
if len(val)<=3:
  val = input('Enter your name: ')
elif len(val)>=20:
  val = input('Enter your name: ')
else:
  t = random.randint(0,len(val)-3)
  print(val[t:t+3])

Buggy submission (verdict: Runtime Error):
import random
val = input('Enter your name: ')
 
if len(val)<=3:
  val = input('Enter your name: ')
elif len(val)>=20:
  val = input('Enter your name: ')
else:
  print(len(val))
  t = random.randint(0,len(val)-3)
  print(val[t:t+3])

Buggy submission (verdict: Runtime Error):
import random
val = input('Enter your name: ')
 
if len(val)<=3:
  val = input('Enter your name: ')
elif len(val)>=20:
  val = input('Enter your name: ')
 
else:
 print(len(val))
 t = random.randint(0,len(val)-3)
 print(val[t:t+3])

Buggy submission (verdict: Runtime Error):
val = input('Enter your name: ')

if len(val)<=3:
  val = input('Enter your name: ')
elif len(val)>=20:
  val = input('Enter your name: ')

else:

print(val)

print(len(val))

t = random.randint(0,len(val)-2)

print(val[t]val[t+1]val[t+2])
Problem p02645 (python)

Fixed submission:
# -*- coding: utf-8 -*-

_in = input()

# if True:
#     print(_in)
# else:
#     print(_in)

print(_in[0:3])

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10000)

a, v = map(int, input().split(" "))
b, w = map(int, input().split(" "))
t = int(input())


def onigokko(a, v, b, w):
    if v == w or a == b:
        return False

    if b > a:
        time = (b-a)/(v-w)
    else:
        time = (b-a)/(w-v)

    if time < 0:
        return False
    if time.is_integer():
        return True
    if time > t:
        return False

    onigokko(a, v, b, w)


result = onigokko(a, v, b, w)
if result:
    print("YES")
else:
    print("NO")
Problem p02645 (python)

Fixed submission:
s=input()
print(s[0:3])

Buggy submission (verdict: Runtime Error):
import sys
a,v=list(map(int,input().split()))
b,w=list(map(int,input().split()))
t=int(input())
if v-w==0:
  if a==b:
    print("YES")
  else:
    print("NO")
  sys.exit()
temp=(b-a)/(v-w)
if temp<0 or temp>t:
  print("NO")
else:
  print("YES")
Problem p02681 (python)

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

Buggy submission (verdict: Runtime Error):
n,k=list(map(int,input().split()))
arr=list(map(int,input().split()))
vis=[False for i in range(n)]
a=[]
start=curr=0
vis[0]=True
a.append(start)
for i in range(k):
    curr=a[-1]
    if vis[arr[curr-1]-1]:
        a.append(arr[curr-1] - 1)
        break
    else:
        vis[arr[curr-1]-1]=True
        a.append(arr[curr-1]-1)
#now i have req cycle
if 3>5 and a[0]==a[-1]:
    a.pop()
    #print("helo")
    #print(len(a),a)
    print(a[k%(len(a))]+1)
else:
    count=0
    #print(a,"a")
    for i in range(len(a)):
        if a[i]==a[-1]:
            new=a[i:-1]
            #print(new,a[i:-1])
            break
        else:
            count+=1
    #print(len(new),new)
    #rint(count,"c")
    print(new[(k-count)%(len(new))]+1)
Problem p02645 (python)

Fixed submission:
import random
S=input()
r = random.randint(0,len(S)-3)
result =""
result = S[r]+S[r+1]+S[r+2]
print(result)

Buggy submission (verdict: Runtime Error):
import random
S=input()
r = random.randint(0,len(S)-4)
result =""
result = S[r]+S[r+1]+S[r+2]
print(result)

Buggy submission (verdict: Runtime Error):
import random
S=input()
r = random.randint(0,len(S)-4)
result =""
result = S[r]+S[r+1]+S[r+2]
print(result)

Buggy submission (verdict: Runtime Error):
import random
S=input()
rl=[random.randint(0,len(S))for i in range(3)]
result = ""
for j in rl:
  result = result + S[j]
print(result)

Buggy submission (verdict: Runtime Error):
import random
i=input()
rl=[random.randint(0,len(i))for i in range(3)]
result = ""
for j in rl:
  result = result + i[j]
print(result)
Problem p02923 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
 
c1 =0
c2 =0
for i in range(N-1):
  if H[i] >= H[i+1]:
    c1+=1
  else:
    if c1 > c2:
      c2=c1
    c1=0
if c1>c2:
  c2=c1
print(c2)

Buggy submission (verdict: Runtime Error):
N = input()
H = list(map(int,input().split()))
 
c1 =0
c2 =0
for i in range(N-1):
  if H[i] >= H[i+1]:
    c1+=1
  else:
    if c1 > c2:
      c2=c1
    c1=0
print(c2)

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

c1 =0
c2 =0
for i in range(N-1):
  c2=0
  for j in range(i+1:N-2):
    if H[i] >= H[j]:
      c2+=1
  c1=c2
print(c1)
Problem p02981 (python)

Fixed submission:
i=input()
ii = i.split()
if int(ii[0]) * int(ii[1]) < int(ii[2]):
  print(int(ii[0]) * int(ii[1]))
else:
  print(int(ii[2]))

Buggy submission (verdict: Runtime Error):
n=input()
n.split(" ")
if int(n[0])*int(n[1]) < int(n[2]):
  print(int(n[0])*int(n[1]))
else:
  print(int(n[2]))
Problem p02645 (python)

Fixed submission:
A = str(input())
print(A[0:3])

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

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

Fixed submission:
N,M = map(int,input().split())
A =list(map(int, input().split()))
Asum = sum(A)
if Asum > N:
  print(-1)
else:
  print(N - Asum)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,M = map(int,input().split())
A = [int(a) for a input().split()]

Asum = sum(A)
if Asum > N:
  print(-1)
else:
  print(N - Asum)
Problem p02789 (python)

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

Buggy submission (verdict: Runtime Error):
N,M = map(int,inport().split())
if N == M:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N,M = map(str,inport().split())
if N == M:
  print("Yes")
else:
  print("No")
Problem p02817 (python)

Fixed submission:
S,T = map(str,input().split())
print(T + S)

Buggy submission (verdict: Runtime Error):
S,T = map(str,imput().split())
print(S + T)

Buggy submission (verdict: Runtime Error):
S,T = map(str,import().split())
print(S + T)
Problem p02952 (python)

Fixed submission:
N = int(input())
if N < 10:
  print(N)
else:
  if 9 < N < 100:
    print("9")
  else:
    if 99 < N < 1000:
      print(N - 90)
    else:
      if 999 < N < 10000:
        print("909")
      else:
        if 9999 < N < 100000:
          print(909 +  N - 9999)
        else:
          if N == 100000:
            print("90909")

Buggy submission (verdict: Runtime Error):
N = input()
if N < 10:
  print(N)
else:
  if 9 < N < 100:
    print("9")
  else:
    if 99 < N < 1000:
      print(N - 90)
    else:
      if 999 < N < 10000:
        print("909")
      else:
        if 9999 < N < 100000:
          print(909 +  N - 9999)
        else:
          if N = 100000:
            print("90909")
Problem p02969 (python)

Fixed submission:
r = int(input())
s = 3 * r * r
print(s)

Buggy submission (verdict: Runtime Error):
r = map(int,input().split())
s = 3 * r * r
print("s")

Buggy submission (verdict: Runtime Error):
r = map(int,input())
s = 3 * r * r
print("s")

Buggy submission (verdict: Runtime Error):
r = input()
s = 3 * r * r
print("s")

Buggy submission (verdict: Runtime Error):
r = input()
s = 3 * (r ** 2)
print("s")

Buggy submission (verdict: Runtime Error):
r = input()
s = 3 * (r ** 2)
print(s)

Buggy submission (verdict: Runtime Error):
r = input()
s = 3 * (a ** 2)
print(s)

Buggy submission (verdict: Runtime Error):
r = input()
s = 3 * a ** 2
print("s")

Buggy submission (verdict: Runtime Error):
print(3*input()*input())

Buggy submission (verdict: Runtime Error):
r = map(int,input().int())
s = 3 * r ** 2
print(s)

Buggy submission (verdict: Runtime Error):
r = map(int,input())
s = 3 * r ** 2
print(s)

Buggy submission (verdict: Runtime Error):
r = input()
s = 3 * (r ^ 2)
print(3 * s)
Problem p02981 (python)

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

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

Buggy submission (verdict: Runtime Error):
densya = N * A
if densya >= B:
	print(B)
else:
	print(A)

Buggy submission (verdict: Runtime Error):
input.split() = list
densya = list[1] * list[2]
if densya >= list[3]:
	print(list[3])
else:
	print(densya)
Problem p03455 (python)

Fixed submission:
a , b = map(int,input().split())
if (a * b) % 2 ==0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a , b = map(int,input().split())
if (a * b) % 2 ==0:
    print("even")
    else:
      print("odd")
Problem p03473 (python)

Fixed submission:
print(48 - int(input()))

Buggy submission (verdict: Runtime Error):
print(48 - input())

Buggy submission (verdict: Runtime Error):
M = map(int,input().split())
print(48 - M)

Buggy submission (verdict: Runtime Error):
M = map(int,input())
print(48 - M)

Buggy submission (verdict: Runtime Error):
M = map(int,input())
a = 48 - M
print(a)

Buggy submission (verdict: Runtime Error):
M = map(int,input())
print(48 - M)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
print(input().count(1))

Buggy submission (verdict: Runtime Error):
print(input().counter("1"))

Buggy submission (verdict: Runtime Error):
s = input().counter(1)
print (s)

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

Fixed submission:
n = int(input())
a = int(input())
print(n * n - a)

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

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

x = A*B

print(x)

Buggy submission (verdict: Runtime Error):
    a,b = int,input().split()
     
    c = float(b)
     
    x = a*c
     
    print(math.floor(x))

Buggy submission (verdict: Runtime Error):
A,B = input().split()
x = A*B
print(x)
Problem p03005 (python)

Fixed submission:
N, K = map(int, input().split())
if K == 1:
  print(0)
else:
  print(N - K)

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
if K = 1:
  print(0)
else:
  print(N - K)
Problem p02645 (python)

Fixed submission:
def first_three(str):
	return str[:3] if len(str) > 3 else str
  
val = input()
print(first_three(val))

Buggy submission (verdict: Runtime Error):
def first_three(str):
	return str[:3] if len(str) > 3 else str
  
  val = input()
 print(first_three(val))
Problem p03478 (python)

Fixed submission:

N, A, B = list(map(int, input().rstrip().split(' ')))
LIST_RESULT = []

for i in range(1, N+1):
    str_i = str(i)
    l = len(str_i)

    sum_tmp = 0
    for x in range(l):
        sum_tmp += int(str_i[x])
    if A <= sum_tmp and sum_tmp <= B:
        LIST_RESULT.append(i)

sum_result = sum(LIST_RESULT)
print(sum_result)

Buggy submission (verdict: Runtime Error):
N, A, B = list(map(int, input().rstrip().split(' ')))
LIST_RESULT = []

for i in range(1, N+1):
    str_i = str(i)
    l = len(str_i)

    sum = 0
    for x in range(l):
        sum += int(str_i[x])
    if A <= sum and sum <= B:
        LIST_RESULT.append(sum)

sum_result = sum(LIST_RESULT)
print(sum_result)
Problem p02756 (python)

Fixed submission:
from collections import deque

S = deque(input())
Q = int(input())
flg = True
for _ in range(Q):
    query = input()
    if query[0] == "1":
        flg = not flg
    else:
        _,F,C = query.split()
        if (F == "1" and flg) or (F == "2" and not flg):
            S.appendleft(C)
        else:
            S.append(C)
if not flg:
    S.reverse()

print(''.join(S))

Buggy submission (verdict: Runtime Error):
import math
S = input()
Q = int(input())
for n in range(Q):
    T,F,C = input()
    if T == "1":
        S = S[::-1]
    else:
        if F == "1":
            S = C + S
        else:
            S = S + C
print(S)
Problem p02719 (python)

Fixed submission:
n,k=map(int,input().split())
if not n or k == 1:
	print(0)
else:
	if n >= k:
		n = n%k
	print(min(n,k-n))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
print(min(n%k,k%n))
Problem p02724 (python)

Fixed submission:
n=int(input())
print(n//500 * 1000 + (n%500)//5 * 5)

Buggy submission (verdict: Runtime Error):
n=int(input())
print(n//500 * 1000 + x//5 * 5)
Problem p02727 (python)

Fixed submission:
X,Y,A,B,C=map(int,input().split())
P=sorted([int(x) for x in input().split()])
Q=sorted([int(x) for x in input().split()])
R=sorted([int(x) for x in input().split()],reverse=True)

p=A-X
q=B-Y

final=sorted(P[p:]+Q[q:])

ans=sum(final)

i=0

for item in R:
	if item > final[i]:
		ans-=final[i]
		ans+=item
		i+=1

print(ans)

Buggy submission (verdict: Runtime Error):
X,Y,A,B,C=map(int,input().split())
P=sorted([int(x) for x in input().split()])
Q=sorted([int(x) for x in input().split()])
R=sorted([int(x) for x in input().split()],reverse=True)

p=A-X
q=B-Y

ans=0

for item in R:

	if item > P[p] and p<A:
		ans+=item
		p+=1
	elif item > Q[q] and q<B:
		ans+=item
		q+=1

print(ans+sum(P[p:])+sum(Q[q:]))
Problem p02958 (python)

Fixed submission:
n=int(input())
arr=[int(x) for x in input().split(' ')]
arr2=sorted(arr)
for x in range(n):
	if x+1==arr[x]:
		continue
	else:
		t=arr[x]
		arr[x]=arr[t-1]
		arr[t-1]=t
		break
# print(arr,arr2)
if arr==arr2:
	print("YES")
else:
	print("NO")

Buggy submission (verdict: Runtime Error):
n=int(input())
arr=[int(x) for x in input().split(' ')]
arr2=sorted(arr)
for x in range(n):
  if x+1==arr[x]:
    continue
  else:
    swap(arr[x],arr[arr[x]-1])
    break
if arr==arr2:
  print("YES")
else:
  print("NO")