Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=input()
for i in map(int, s.split()):
    lis.append(i)
if lis[0]>lis[1]:
    print("safe")
else:
    print("unsafe")

Fixed submission:
s=input()
lis=s.split()
if int(lis[0])>int(lis[1]):
    print("safe")
else:
    print("unsafe")
Buggy python submission (verdict: Runtime Error):
lis_raw=[int(i) for i in input().split()]
print(max(lis[0]+lis[1], lis[0]-lis[1], lis[0]*lis[1]))

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

Buggy python submission (verdict: Runtime Error):
lis_raw=input().split()
lis = [int(i) for i in lis]
print(max(lis[0]+lis[1], lis[0]-lis[1], lis[0]*lis[1]))

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

Fixed submission:
name = input()
print(name[:3])
Buggy python submission (verdict: Runtime Error):
A,B,C,K=map(int,input().split())
S=[]
S.extend([1]*A)
S.extend([0]*B)
S.extend([-1]*C)
print(sum(S[:K]))

Fixed submission:
A,B,C,K = map(int,input().split())
ans=0
if A>=K:
    ans+=K
else:
    K=K-A
    if B>=K:
        ans+=A
    else:
        K=K-B
        ans=A-K
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
ans=0
t=min(B+1,N+1)
t_min=min(0,t-100)
for x in range(t_min,t):
    a=int(A*x/B)
    b=A * int(x/B)
    ans=max(ans,a-b)

print(ans)

Fixed submission:
A,B,N=map(int,input().split())
ans=0
t=min(B+1,N+1)

for x in range(t-2,t):
    a=int(A*x/B)
    b=A * int(x/B)
    ans=max(ans,a-b)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
ans=0
for x in range(min(B+1,N+1)):
    a=int(A*x/B)
    b=A * int(x/B)
    ans=max(ans,a-b)

print(ans)

Fixed submission:
A,B,N=map(int,input().split())
ans=0
t=min(B+1,N+1)

for x in range(t-2,t):
    a=int(A*x/B)
    b=A * int(x/B)
    ans=max(ans,a-b)

print(ans)
Buggy python submission (verdict: Runtime Error):
X=input()
m=int(X[0])
t=int(X[1:3])
print(1 if m*5>=t or len(X)>=4 else 0)

Fixed submission:
X=input()
Xi=int(X)
if Xi>=100:
    if len(X)>=4 and Xi>=2000:
        print(1)
    else:
        if Xi<1000:
            print(1 if int(X[0])*5>=int(X[1:3]) else 0)
        else:
            print(1 if int(X[0:2])*5>=int(X[2:4]) else 0)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
X=input()
m=int(X[0])
t=int(X[1:3])
print(1 if m*5>=t else 0)

Fixed submission:
X=input()
Xi=int(X)
if Xi>=100:
    if len(X)>=4 and Xi>=2000:
        print(1)
    else:
        if Xi<1000:
            print(1 if int(X[0])*5>=int(X[1:3]) else 0)
        else:
            print(1 if int(X[0:2])*5>=int(X[2:4]) else 0)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, K, Q = map(int, input().split())
score = np.array([K]*N)

for _ in range(Q):
    n = int(input())
    score[n-1] = score[n-1] + 1
    score=score-1

for i in score:
    print("Yes" if i>0 else "No")

Fixed submission:
import numpy as np
N, K, Q = map(int, input().split())
score = np.array([K]*N)

for _ in range(Q):
    n = int(input())
    score[n-1] = score[n-1] + 1

score=score-Q

for i in score:
    print("Yes" if i>0 else "No")
Buggy python submission (verdict: Runtime Error):
S=input()
s1=int(S[0:2])
s2=int(S[3:5])

if 1<=s1<=12 and (s2>12 or S2==0):
    print("MMYY")
elif (s1>12 or s1==0) and 1<=s2<=12:
    print("YYMM")
elif 1<=s1<=12 and 1<=s2<=12:
    print("AMBIGUOUS")
else:
    print("NA")

Fixed submission:
S=input()
s1=int(S[0:2])
s2=int(S[2:5])

if 1<=s1<=12:
    print("AMBIGUOUS" if 1<=s2<=12 else "MMYY")
else:
    print("YYMM" if 1<=s2<=12 else "NA")
Buggy python submission (verdict: Runtime Error):
X=int(input())
t=int(input())
print(X-t if X>=t else 0)

Fixed submission:
X, t = map(int,input().split())
print(X-t if X>=t else 0)
Buggy python submission (verdict: Runtime Error):
from collections import deque

N,M = map(int,input().split())

G=[[] for i in range(M+1)]

for i in range(M):
    n,m=map(int,input().split())
    G[n].append(m)
    G[m].append(n)

visited=[0]*(N+1)
ans=0
def dfs(now, num_visited=0):
    global ans
    visited[now] = 1
    num_visited+=1
    
    if num_visited==N:
        ans+=1
    
    for i in G[now]:
        next=i
        if visited[next]!=1:dfs(next,num_visited)
        
    visited[now] = 0

dfs(1)
print(ans)

Fixed submission:
from collections import deque

N,M = map(int,input().split())

G=[[] for i in range(N+1)]

for i in range(M):
    n,m=map(int,input().split())
    G[n].append(m)
    G[m].append(n)

visited=[0]*(N+1)
ans=0
def dfs(now, num_visited=0):
    global ans
    visited[now] = 1
    num_visited+=1
    
    if num_visited==N:
        ans+=1
    
    for i in G[now]:
        next=i
        if visited[next]!=1:dfs(next,num_visited)

    visited[now] = 0

dfs(1)
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()
print(a+" "+b+" "+c)

Fixed submission:
a,b,c = input().split(",")
print(a+" "+b+" "+c)
Buggy python submission (verdict: Runtime Error):
a,b,c= map(str,input().split())
a=int(a)
c=int(c)
if b=="+":
    print(a+c)
else:
    print(a-b)

Fixed submission:
a,b,c= map(str,input().split())
a=int(a)
c=int(c)
if b=="+":
    print(a+c)
else:
    print(a-c)
Buggy python submission (verdict: Runtime Error):
N,_ = map(str,input().split())
lists = [0,1,2,3,4,5,6,7,8,9]
s=list(map(int,input().split()))
price=""
flg=False

for i in s:
    lists.remove(i)

for i in N:
    for j,n in enumerate(lists):
        if int(i) <= int(j):
            price+=str(j)
            break
        if len(lists)==n:
            price+=str(lists[0])
            flg=True
#先頭0の場合
if lists[0]==0: lists.remove(0)
#繰り上がりの場合
if flg: price=str(lists[0])+price

print(price)

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

sums=0
for i in num:
	sums+=i
  
if sums ==17:
	print("YES")
else:
	print("NO")

Buggy python submission (verdict: Runtime Error):
num = list(map(input().split("")))

sums=0
for i in num:
	sums+=i
  
if sums ==17:
	print("YES")
else:
	print("NO")

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

sums=0
for i in num:
	sums+=i
  
if sums ==17:
	print("YES")
else:
	print("NO")

Buggy python submission (verdict: Runtime Error):
num = list(map(input()))

sums=0
for i in num:
	sums+=i
  
if sums ==17:
	print("YES")
else:
	print("NO")

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

sums=0
for i in num:
	sums+=i
  
if sums ==17:
	print("YES")
else:
	print("NO")
Buggy python submission (verdict: Runtime Error):
X, Y, Z = map(int, input().split())
 
print(Z+" "+X+" "+Y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input().split())
 
print(z+" "+x+" "+y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input().split())
 
print(z+""+x+""+y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input().split())

print(z+""+x+""+y)



Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x,y,z= map(int, input().split())

print(z+""+x+""+y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x,y,z= map(int, input().split())

print(z x y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x=input()
y=input()
z=input()

print(z x y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

Buggy python submission (verdict: Runtime Error):
x=input()
y= input()
z= input()

print(z x y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)

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

print(z x y)

Fixed submission:
x,y,z=map(int,input().split())
print(z,x,y)
Buggy python submission (verdict: Runtime Error):
s=int(input())

n=list(s)

if n[2]==n[3] and n[4]==n[5]:
  print("Yes")
else:
  print("No")

Fixed submission:
s=input()


if s[2]==s[3] and s[4]==s[5]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
x=input()

a=int(x%500)

b=int((x-a*500)%5)

c=1000*a+5*b

print(c)

Fixed submission:
x=int(input())

a=x//500

b=(x-a*500)//5

print(1000*a+5*b)

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

a=int(x%500)

b=int((x-a)%5)

c=1000*a+5*b

print(c)

Fixed submission:
x=int(input())

a=x//500

b=(x-a*500)//5

print(1000*a+5*b)

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

a=int(x//500)

b=int((x-a)//5)

c=1000*a+5*b

print(c)

Fixed submission:
x=int(input())

a=x//500

b=(x-a*500)//5

print(1000*a+5*b)
Buggy python submission (verdict: Runtime Error):
N,R = map(int,input().split())

num1=M*(M-1)*0.5
num2=N*(N-1)*0.5

print(num1+num2)

Fixed submission:
n, m = map(int, input().split())
ans = n*(n-1)//2 + m*(m-1)//2
print(ans)

Buggy python submission (verdict: Runtime Error):
N=input()
M=input()

num1=M*(M-1)*0.5
num2=N*(N-1)*0.5

print(num1+num2)

Fixed submission:
n, m = map(int, input().split())
ans = n*(n-1)//2 + m*(m-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
N=input()

math.ceil(N)

Fixed submission:
N=int(input())
import math
ans=math.ceil(N/2)
print(ans)
Buggy python submission (verdict: Runtime Error):
x,n = map(int,input().split())
p = input().split()
p.sort()
q = p[::-1]
a = x
b = x
for i in q:
  if a == int(i):
    a -= 1
for i in p:
  if b == int(i):
    b += 1 
if x - a <= b - x:
  print(a)
else:
  print(b)

Fixed submission:
x = input()
a,b,c,d,e = map(int,x.split())
print(15 - a-b-c-d-e)

Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())
a = 4 * x - y
b = y - 2*x
if a/2 == a//2 and a >= 0 and b/2 == b//2 and b >= 0:
  print('Yes')
else:
  print('No')

Fixed submission:
x = input()
a,b,c,d,e = map(int,x.split())
print(15 - a-b-c-d-e)

Buggy python submission (verdict: Runtime Error):
;


Fixed submission:
x = input()
a,b,c,d,e = map(int,x.split())
print(15 - a-b-c-d-e)
Buggy python submission (verdict: Runtime Error):
x,y = map(intinput()split())
a = 4x-y
if a/2 = a%2:
  print('Yes')
else:
  print('No')

Fixed submission:
x,y = map(int,input().split())
a = 4 * x - y
b = y - 2*x
if a/2 == a//2 and a >= 0 and b/2 == b//2 and b >= 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s,w = map(int,input().split)
print(s)

if s<=w:
  print('unsafe')
else:
  print('safe')

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

Buggy python submission (verdict: Runtime Error):

N = int(input())
A = list(map(int,input(). split ()))
  
if 0 in A:
  print(0)
  return
  
prod = 1
for a in A:
  prod *= a
  if prod > 1000000000000000000:
    print(-1)
    return
    
print(prod)
  



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

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = input().split()
a = 0
b = 1
while 2 * a <= n - 1 :
  b = b * int(x[a]) * int(x[n-1-a])
  a += 1
if b <= 1000000000000000000:
  print(b)
else:
  print(-1)


Fixed submission:
a,b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = input().split()
a = 0
b = 1
while a <= n - 1 :
  b = b * int(x[a])
  a += 1
if b <= 1000000000000000000:
  print(b)
else:
  print(-1)

Fixed submission:
n = int(input())
x = input().split()
a = 0
b = 1
if x.count('0') >= 1:
  print(0)
else:
  while a <= n - 1 and b <= 1000000000000000000:
    b = b * int(x[a])
    a += 1
  if b > 1000000000000000000:
    print(-1)
  else:
    print(b)

Buggy python submission (verdict: Runtime Error):
n = int(input())
x = input().split()
a = 0
b = 1
while a <= n - 1 or b > 10^8:
  b = b * int(x[a])
  a += 1
if b > 10^8:
  print('-1')
else:
  print(b)

Fixed submission:
n = int(input())
x = input().split()
a = 0
b = 1
if x.count('0') >= 1:
  print(0)
else:
  while a <= n - 1 and b <= 1000000000000000000:
    b = b * int(x[a])
    a += 1
  if b > 1000000000000000000:
    print(-1)
  else:
    print(b)
Buggy python submission (verdict: Runtime Error):
def main():
  x = input()

  if int(x[0:0:-1]) == 3:
    print('bon')
  else:
    if  0 or 1 or 6 or 8 in int(x[0:0:-1]):
      print('pon')
    else:
      print('hon')

main()

Fixed submission:
x = input()
x = x[::-1]
x = int(x[0])


if x == 3:
  print('bon')
else:
  if x == 0 or x == 1 or x == 6 or x == 8:
    print('pon')
  else:
    print('hon')
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
a = len(s)

if len(x) <=10 and len(x) >= 1 and len(t) == len(s) + 1 and t[0:a] == s[0:a]:
  print('yes')
else:
  print('no')

Fixed submission:
s = input()
t = input()
a = len(s)

if len(s) <=10 and len(s) >= 1 and len(t) == len(s) + 1 and t[0:a] == s[0:a]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
a = len(s)

if len(s) > 10 or len(s) < 1:
  print('no')
else:
  if t[0:a] != s:
    print('no')
  else:
    if len(t) == len(s) + 1:
      print('yes')

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

if a >= k:
  print(k)
else:
  if a + b >= k:
    print(a)
  else:
    print(2 * a + b - k)

Buggy python submission (verdict: Runtime Error):
def main():
  s = input()
  t = input()
  a = len(s)

  if len(s) > 10 or len(s) < 1:
    print('no')
  else:
    if t[0:a] != s:
      print('no')
    else:
      if len(t) == len(s) + 1:
        print('yes')

main()

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

if a >= k:
  print(k)
else:
  if a + b >= k:
    print(a)
  else:
    print(2 * a + b - k)
Buggy python submission (verdict: Runtime Error):
s = str(input())

if s == ABC:
  print('ARC')
else:
  if s == ARC:
    print('ABC')

Fixed submission:
s = str(input())

if s == 'ABC':
  print('ARC')
else:
  if s == 'ARC':
    print('ABC')
Buggy python submission (verdict: Runtime Error):
k = int(input())
a,b = int(input().split())
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')
   

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

Buggy python submission (verdict: Runtime Error):
x = input()
k = int(x[0,0])
a = int(x[1, 0])
b = int(x[1, 1])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

Buggy python submission (verdict: Runtime Error):
x = input()
x = x.split()
x = x.split(\n)
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')


Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

Buggy python submission (verdict: Runtime Error):
x = input()
x = x.split()
x = x.split('\n')
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')


Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

Buggy python submission (verdict: Runtime Error):
x = input()
x = x.split()
x = x.split('/')
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')


Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

Buggy python submission (verdict: Runtime Error):
x = input()
x = x.split()
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')

Buggy python submission (verdict: Runtime Error):
x = input()
x = x.split()
k = int(x[0])
a = int(x[1])
b = int(x[2])
if k <= b - a:
  print('OK')
else:
  if b % k <= a % k:
    print('OK')
  else:
    print('NG')
   

Fixed submission:
k = int(input())
a,b = map(int,input().split())
if k <= b - a:
  print('OK')
else:
  if b // k > a // k or a % k == 0:
    print('OK')
  else:

    print('NG')
Buggy python submission (verdict: Runtime Error):
s,w = map(int,input().split)

if s<=w:
  print('unsafe')
else:
  print('safe')

Fixed submission:
s,w = map(int,input().split())

if s<=w:
  print('unsafe')
else:
  print('safe')

Buggy python submission (verdict: Runtime Error):
s,w = map(int,split.input())


if s<=w:
  print('unsafe')
else:
  print('safe')

Fixed submission:
s,w = map(int,input().split())

if s<=w:
  print('unsafe')
else:
  print('safe')

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

if s<=w:
  print('unsafe')
else:
  print('safe')

Fixed submission:
s,w = map(int,input().split())

if s<=w:
  print('unsafe')
else:
  print('safe')

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

if s<=w:
  print('unsafe')
else:
  print('safe')

Fixed submission:
s,w = map(int,input().split())

if s<=w:
  print('unsafe')
else:
  print('safe')
Buggy python submission (verdict: Runtime Error):
s = int(input())
if 7 in s:
  print('yes')
else:
  print('no')

Fixed submission:
if "7" in input():
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
if 7 in int(input()):
  print('yes')
else:
  print('no')

Fixed submission:
if "7" in input():
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = input().split()
print(a[3] +' ' +a[1]+' ' + a[2])

Fixed submission:
a = input().split()
print(a[2] +' ' +a[0]+' ' + a[1])
Buggy python submission (verdict: Runtime Error):
x = input()
a = x.sprit(' ')
if int(a[0]) + int(a[2]) + int(a[4]) >=22:
 print('bust')
else:
 print('win')


Fixed submission:
x = input()
x = x.split()
if int(x[0]) + int(x[1]) + int(x[2]) >=22:
 print('bust')
else:
 print('win')

Buggy python submission (verdict: Runtime Error):
x = input()
if int(x[0]) + int(x[2]) + int(x[4]) >=22:
 print('bust')
else:
 print('win')

Fixed submission:
x = input()
x = x.split()
if int(x[0]) + int(x[1]) + int(x[2]) >=22:
 print('bust')
else:
 print('win')

Buggy python submission (verdict: Runtime Error):
x = input()
if int(x[0]) + int(x[2]) + int(x[4]) >=22 ;
 print('bust')
else;
 print('win')

Fixed submission:
x = input()
x = x.split()
if int(x[0]) + int(x[1]) + int(x[2]) >=22:
 print('bust')
else:
 print('win')
Buggy python submission (verdict: Runtime Error):
def main():
  n = int(input())

	l = list(map(int, input().split()))

	ans = 1

  for x in l:
    ans = ans*x
    if(ans > 1000000000000000000):
      print(-1)
      return


  print(ans)

main()

Fixed submission:
def main():
    n = int(input())
    l = list(map(int, input().split()))
    ans = 1
    
    if 0 in l:
      print(0)
      return
 
    for x in l:
        ans = ans*x
        if(ans > 1000000000000000000):
            print(-1)
            return
    print(ans)
 
main()

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

l = list(map(int, input().split()))

ans = 1

for x in l:
  ans = ans*x
  
if(ans > 1000000000000000000):
  print(-1)
else:
  print(ans)

Fixed submission:
def main():
    n = int(input())
    l = list(map(int, input().split()))
    ans = 1
    
    if 0 in l:
      print(0)
      return
 
    for x in l:
        ans = ans*x
        if(ans > 1000000000000000000):
            print(-1)
            return
    print(ans)
 
main()

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

l = list(map(int, input().split()))

for x in l:
  ans = ans*x
  
if(ans > 1000000000000000000):
  print(-1)
else:
  print(ans)

Fixed submission:
def main():
    n = int(input())
    l = list(map(int, input().split()))
    ans = 1
    
    if 0 in l:
      print(0)
      return
 
    for x in l:
        ans = ans*x
        if(ans > 1000000000000000000):
            print(-1)
            return
    print(ans)
 
main()
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
prices = list(map(input().split()))
print(sum(sorted(prices[:k])))

Fixed submission:
n, k = map(int, input().split())
price = list(map(int, input().split()))
print(sum(sorted(price)[:k]))
Buggy python submission (verdict: Runtime Error):
letter = input()
  
if letter.isUpper()==True:
  print('A')
else:
  print('a')
  

Fixed submission:
letter = input()

if letter.isupper()==True:
  print('A')
else:
  print('a')
Buggy python submission (verdict: Time Limit Exceeded):
k=int(input())
n=len(input())
mod=10**9+7

def prepare(m, mod=10 ** 9 + 7):
	fac = [1] * (m + 1)
	inv = [1] * (m + 1)
	for i in range(1, m + 1):
		fac[i] = fac[i - 1] * i % mod
	inv[-1] = pow(fac[-1], mod - 2, mod)
	for i in range(m - 1, -1, -1):
		inv[i] = inv[i + 1] * (i + 1) % mod
	return fac, inv

fac, inv = prepare(n+k)

def cmb(n, r):
	assert n >= r >= 0
	return fac[n] * inv[n - r] * inv[r] % mod

ans=0
for i in range(0,k+1):
	ans+=pow(25,k-i,mod)*pow(26,i,mod)%mod*cmb(n+k-i-1,k-i)%mod
	ans%=mod
print(ans)

Fixed submission:
k=int(input())
n=len(input())
mod=10**9+7

def prepare(m, mod=10 ** 9 + 7):
	fac = [1] * (m + 1)
	inv = [1] * (m + 1)
	for i in range(1, m + 1):
		fac[i] = fac[i - 1] * i % mod
	inv[-1] = pow(fac[-1], mod - 2, mod)
	for i in range(m - 1, -1, -1):
		inv[i] = inv[i + 1] * (i + 1) % mod
	return fac, inv

fac, inv = prepare(n+k)

def cmb(n, r):
	assert n >= r >= 0
	return fac[n] * inv[n - r] * inv[r] % mod

ans=0
for i in range(0,k+1):
	ans+=pow(25,k-i,mod)*pow(26,i,mod)%mod*cmb(n+k-i-1,k-i)%mod
	ans%=mod
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
def main():
	A,B,C,D=map(int,input().split())
	mod=998244353
	dp=[[0]*(C-A+1) for _ in range(D-B+1)]
	dp[0][0]=1
	for i in range(1,D-B+1):
		dp[i][0]=dp[i-1][0]*A%mod
	for j in range(1,C-A+1):
		dp[0][j]=dp[0][j-1]*B%mod
	for i in range(1,D-B+1):
		for j in range(1,C-A+1):
			dp[i][j]+=(dp[i-1][j]*(A+j)+dp[i][j-1]*(B+i)-((B+i-1)*(A+j-1))*dp[i-1][j-1]+mod)%mod
	print(dp[-1][-1])

if __name__=='__main__':
	main()

Fixed submission:
A,B,C,D=map(int,input().split())
mod=998244353
dp=[[0]*(C-A+1) for _ in range(D-B+1)]
dp[0][0]=1
for i in range(1,D-B+1):
	dp[i][0]=dp[i-1][0]*A%mod
for j in range(1,C-A+1):
	dp[0][j]=dp[0][j-1]*B%mod
for i in range(1,D-B+1):
	for j in range(1,C-A+1):
		dp[i][j]+=(dp[i-1][j]*(A+j)+dp[i][j-1]*(B+i)-((B+i-1)*(A+j-1))*dp[i-1][j-1]+mod)%mod
print(dp[-1][-1])

Buggy python submission (verdict: Time Limit Exceeded):
A,B,C,D=map(int,input().split())
mod=998244353
dp=[[0]*(C-A+1) for _ in range(D-B+1)]
dp[0][0]=1
for i in range(1,D-B+1):
	dp[i][0]=dp[i-1][0]*A%mod
for j in range(1,C-A+1):
	dp[0][j]=dp[0][j-1]*B%mod
for i in range(1,D-B+1):
	for j in range(1,C-A+1):
		dp[i][j]+=(dp[i-1][j]*(A+j)+dp[i][j-1]*(B+i)-((B+i-1)*(A+j-1))*dp[i-1][j-1]+mod)%mod
print(dp[-1][-1])

Fixed submission:
A,B,C,D=map(int,input().split())
mod=998244353
dp=[[0]*(C-A+1) for _ in range(D-B+1)]
dp[0][0]=1
for i in range(1,D-B+1):
	dp[i][0]=dp[i-1][0]*A%mod
for j in range(1,C-A+1):
	dp[0][j]=dp[0][j-1]*B%mod
for i in range(1,D-B+1):
	for j in range(1,C-A+1):
		dp[i][j]+=(dp[i-1][j]*(A+j)+dp[i][j-1]*(B+i)-((B+i-1)*(A+j-1))*dp[i-1][j-1]+mod)%mod
print(dp[-1][-1])