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

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

x_sort = sorted(X)
m = N//2 - 1
for i in range(N):
    if X[i] <= x_sort[m]:
        print(x_sort[m + 1])
    else:
        print(x_sort[m])

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

x_sort = sorted(X)
m = N/2 - 1
for i in range(N):
    if X[i] <= x_sort[m]:
        print(x_sort[m + 1])
    else:
        print(x_sort[m])
Problem p03399 (python)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
print(min(a, b) + min(c, d))

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

Fixed submission:
N = int(input())

b = {}
for i in range(N):
  s = str(input())
  if b.get(s) is None:
    b[s] = 1
  else:
    b[s] += 1
    
r = {}
M = int(input())
for i in range(M):
  s = str(input())
  if r.get(s) is None:
    r[s] = 1
  else:
    r[s] += 1

ans = -999999
for st in b:
  if r.get(st) is None:
    ans = max(ans, b[st])
  else:
    ans = max(ans, b[st] - r[st])
if ans >= 0:
  print(ans)
else:
  print(0)

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

b = {}
for i in range(N):
  s = str(input())
  if b.get(s) is None:
    b[s] = 1
  else:
    b[s] += 1
    
r = {}
for i in range(N):
  s = str(input())
  if r.get(s) is None:
    r[s] = 1
  else:
    r[s] += 1

ans = -999999
for st in b:
  if r.get(st) is None:
    ans = max(ans, b[st])
  else:
    ans = max(ans, b[st] - r[st])
print(ans)
Problem p03415 (python)

Fixed submission:
s1 = list(str(input()))
s2 = list(str(input()))
s3 = list(str(input()))
print(s1[0] + s2[1] + s3[2])

Buggy submission (verdict: Runtime Error):
s1 = list(str(iuput()))
s2 = list(str(iuput()))
s3 = list(str(iuput()))
print(s1[0] + s2[1] + s3[2])
Problem p03433 (python)

Fixed submission:
n = int(input())
a = int(input())
if (n% 500) <= a:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = int(input())
if (n% 500) <= A:
  print("Yes")
else:
  print("No")
Problem p03434 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
alice = 0
bob = 0
for index, a in enumerate(A):
  if (index % 2)  == 0:
    alice += a
  else:
    bob += a
print(alice - bob)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort(reversed=True)
alice = 0
bob = 0
for index, a in enumerate(A):
  if (index % 2)  == 0:
    alice += a
  else:
    bob += a
print(alice - bob)
Problem p03447 (python)

Fixed submission:
X = int(input())
A = int(input())
B = int(input())
ans = 0
remain = X - A
for i in range(100000):
  if (remain - B) < 0:
    ans = remain
    break
  elif (remain - B) == 0:
    ans = 0
    break
  else:
    remain -= B
print(ans)

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

remain = X - A
for i in range(100000):
  if (remain - B) < 0:
    print(ans)
    break
  elif (remain - B) == 0:
    print(0)
    break
  else:
    remain -= B
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())

ans = 0 
for i in range(0, A + 1):
  numi = i * 500
  if numi == X:
    ans += 1
  elif numi < X:
    for j in range(0, B + 1):
      numj = j * 100 + numi
      if numj == X:
        ans += 1
      elif numj < X:
        for k in range(0, C + 1):
          numk = k * 50 + numj
          if numk == X:
            ans += 1
          elif numk < X:
            continue
          else:
            break
      else:
        break
  else:
    continue
print(ans)

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

ans = 0 
for i in range(0, A + 1):
  numi = i * 500
  if numi == X:
    ans += 1
  elif numi < X:
    for j in range(0, B + 1):
      numj = j * 100 + numi
      if numj == X:
        ans += 1
      elif numj < X:
        for k in range(0, k + 1):
          numk = k * 50 + numj
          if numk == X:
            ans += 1
          elif numk < X:
            continue
          else:
            break
      else:
        break
  else:
    continue
print(ans)
Problem p03469 (python)

Fixed submission:
S = list(str(input()))

ans = ''
y = ''

for index, s in enumerate(S):
  y += s
  if index == 3:
    ans = '2018'
    break
    
for s in S[4:]:
  ans += s
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(str(input()))

ans = ''
y = ''

for index, s in enumerate(S):
  y += s
  if index == 3:
    ans = 2018
    break
    
for s in S[4:]:
  ans += s
print(ans)
Problem p03487 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
dic = {}
for i in range(N):
  if dic.get(A[i]) is None: 
    dic[A[i]] = 1
  else:
    dic[A[i]] += 1

ans = 0
for k in dic:
  if dic[k] >= k:
    ans += abs(dic[k] - k)
  else:
    ans += dic[k]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())
dic = {}
for i in range(N):
  if dic.get(A[i]) is None: 
    dic[A[i]] = 1
  else:
    dic[A[i]] += 1

ans = 0
for k in dic:
  if dic[k] >= k:
    ans += abs(dic[k] - k)
  else:
    ans += dic[k]
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
dic = {}
for i in range(N):
  num = int(input())
  if dic.get(num) is None: 
    dic[n] = 1
  else:
    dic[n] += 1

ans = 0
for k in dic:
  if dic[k] >= k:
    ans += abs(dic[k] - k)
  else:
    ans += dic[k]
print(ans)
Problem p03502 (python)

Fixed submission:
N = str(input())
L = list(N)
f = 0
for l in L:
  f += int(l)
if (int(N) % f) == 0:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = str(input())
L = list(N)
f = 0
for l in L:
  f += l
if (int(N) % f) == 0:
  print("Yes")
else:
  print("No")
Problem p03547 (python)

Fixed submission:
a,b = map(str, input().split())
if a < b:
  print("<")
elif a == b:
  print("=")
else:
  print(">")

Buggy submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a < b:
  print("<")
elif a == b:
  print("=")
else:
  print(">")
Problem p03555 (python)

Fixed submission:
c1 = str(input())
c2 = str(input())
c1 = list(c1)[::-1]
c2 = list(c2)
if c1 == c2:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
c1,c2 = map(str, input(),split())
c1 = list(c1)[::-1]
c2 = list(c2)
if c1 == c2:
  print("YES")
else:
  print("NO")
Problem p03564 (python)

Fixed submission:
N = int(input())
K = int(input())
dp = [0] * (N+10)
dp[0] = 1
for i in range(1, N+1):
  dp[i] = min(dp[i-1] * 2, dp[i-1] + K)
print(dp[N])

Buggy submission (verdict: Runtime Error):
N = int(input())
K = int(input())
dp = [0] * (N+10)
dp[0] = 1
for i in range(1, N):
  dp[i] = min(d[i-1] * 2, d[i-1] + K)
print(dp[N-1])
Problem p03645 (python)

Fixed submission:
N, M = map(int, input().split())
first = set()
second = set()
for _ in range(M):
  a, b = map(int, input().split())
  if a == 1:
    first.add(b)
  elif b == N:
    second.add(a)

ans = 0
for i in first:
  if i in second:
    ans = 1
    break
if ans:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
first = []
second = []
for _ in range(M):
  a, b = map(int, input().split())
  if a == 1:
  	first.append(b)
  elif b == N:
    second.append(a)

ans = 0
for i in first:
  if i in second:
    ans = 1
    break
if ans:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")
Problem p03672 (python)

Fixed submission:
S = list(str(input()))

ans = 0
num = 0
while num < len(S):
  num += 1
  s = S[:len(S)-num]
  if len(s) % 2 == 0:
    if s[:int(len(s)/2)] == s[int(len(s)/2):]:
      ans = len(s)
      break
print(ans)

Buggy submission (verdict: Runtime Error):
S = list(str(input()))

ans = 0
num = 0
while num < len(S):
  num += 1
  s = S[:len(S)-num]
  if len(s) % 2 == 0:
  　　if s[:len(s)/2] == s[len(s)/2:]:
        ans = len(s)
        break
print(ans)
Problem p03681 (python)

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

if N == M:
  print((2 * math.factorial(N) * math.factorial(M))%((10**9)+7))
else:
  if abs(N-M) == 1:
    print((math.factorial(N) * math.factorial(M))%((10**9)+7))
  else:
    print(0)

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

def kaizyo(n):
  if n == 1:
    return n
  return n * (n-1) 

if N == M:
  print(2 * kaizyo(N) * kaizyo(M))
else:
  if abs(N-M) == 1:
    print(kaizyo(N) * kaizyo(M))
  else:
    print(0)
Problem p03695 (python)

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

l = [0 for i in range(9)]
for a in A:
  ind = 0
  while ind < 8:
    if a < (ind+1)*400:
      break
    ind += 1
  l[ind] += 1

ans_max = 0
ans_min = 0
for i in range(0, 8):
  if l[i] > 0:
    ans_max += 1
    ans_min += 1
if l[-1] > 0:
  ans_max = ans_max + l[-1]
  ans_min = max(ans_min, 1)
print(ans_min, ans_max)

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

l = [0 for i in range(9)]
for a in A:
  ind = 0
  while ind < 9:
    if a < (ind+1)*400:
      break
    ind += 1
  l[ind] += 1

ans_max = 0
ans_min = 0
for i in range(0, 8):
  if l[i] > 0:
    ans_max += 1
    ans_min += 1
if l[-1] > 0:
  ans_max = min(ans_max + l[-1] , 9)
  ans_min = max(ans_min, 1)
print(ans_min, ans_max)
Problem p03729 (python)

Fixed submission:
a, b, c = map(str, input().split())
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a[-1]==b[0] and b[-1]==c[0]:
  print("YES")
else:
  print("NO")
Problem p03738 (python)

Fixed submission:
a = int(input())
b = int(input())
if a>b:
  print("GREATER")
elif a<b:
  print("LESS")
else:
  print("EQUAL")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a>b:
  print("GREATER")
elif a<b:
  print("LESS")
else:
  print("EQUAL")
Problem p03777 (python)

Fixed submission:
a, b = map(str, input().split())
if a == "H":
  print(b)
else:
  if b == "H":
    print("D")
  else:
    print("H")

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a == "H":
  print(b)
else:
  if b == "H":
    print("D")
  else:
    print("H")
Problem p03796 (python)

Fixed submission:
N = int(input())
power = 1
for i in range(N):
  power = (power*(i+1)) % (10**9+7)
print(power)

Buggy submission (verdict: Runtime Error):
N = int(input())
power = 1
for i in range(N):
  power *= i+1
print(power / (pow(10, 9) + 7))
Problem p03943 (python)

Fixed submission:
a,b,c = map(int,input().split())
l = [a,b,c]
l.sort()
if l[0] + l[1] == l[2]:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
l = [a,b,c]
l.sort()
if l[0] + 1[1] == 1[2]:
  print("Yes")
else:
  print("No")
Problem p04012 (python)

Fixed submission:
w = str(input())
s = {}
 
for wrd in w:
  if s.get(wrd) is None:
    s[wrd] = 1
  else:
    s[wrd] += 1
 
ans = 1
for wrd in s:
  if s[wrd] %2 !=0:
    ans = 0
    break
if ans:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
w = str(input())
s = dic()

for wrd in w:
  if s.get(wrd) is None:
    s[wrd] = 1
  else:
    s[wrd] += 1

ans = 1
for wrd in s:
  if s[wrd] %2 !=0:
    ans = 0
    break
if ans:
  print("Yes")
else:
  print("No")
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 = int(input())
P = list(map(int, input().split()))

cnt = 0
for i in range(N):
    Flg = True
    for j in range(i):
        if P[j] < P[i]:
            Flg = False
            break
    if Flg:
        cnt += 1
print(cnt)
Problem p02786 (python)

Fixed submission:
H = int(input())
 
 
def main(H):
  if H == 1:
    return 1
  else:
    return main(H//2)*2 + 1
 
if __name__=='__main__':
  print(main(H))

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

def calc(H):
  a = int(H/2)
  return a*2 + 1


def main(H):
  if H == 1:
    return 1
  else:
    return calc(H)

if __name__=='__main__':
  main()
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 = int(input()).split()

if N == M:
  print("Yes")
else:
  print("No")
Problem p02817 (python)

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

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


if A + B <= K:
    print(0, 0)

elif A <= K:
    C = K - A
    print(0, B-C)

else:
    print(A - K, B)

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


if A + B <= K:
    print(0, 0)

elif A <= K:
    C = K - A
    print(0, B-C)

else:
    print(A - K, B)
Problem p02830 (python)

Fixed submission:
N = int(input())
A,B = input().split()
ans = []
for i in range(0,N):
  ans.append(A[i] + B[i])

print("".join(ans))

Buggy submission (verdict: Runtime Error):
N = int(input())
A,B = input().split()
ans = []
for i in range(N+1):
  ans.append(A[i] + B[i])
print("".join(ans))
Problem p02784 (python)

Fixed submission:
H,N = map(int,input().split())
A = list(map(int, input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H,N = int(input())
A = list(map(int, input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
if sum(A)>=H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
if sum(A)>=H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
 
if sum(A)>H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
 
if sum(A[i])>H:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
 
if sum(A[i])>N:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())
 
if (sum(A[i]>N):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A= [0] * N
for i in range(N):
    A[i]= map(int, input().split())

if (sum(A[i]>N);
    print("Yes")
else;
    print("No")
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,input().split())
if N=M:
  print("Yes")
else:
  print("No")

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

Buggy submission (verdict: Runtime Error):
N,M=map(int,input().split)
if N=M:
  print("Yes")
else:
  print("No")
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 p02946 (python)

Fixed submission:
k, x = map(int, input().split())
for i in range(x-k+1,x+k):
	print (i)

Buggy submission (verdict: Runtime Error):
k, x = map(int, input().split())
for i in range(x-k+1,x+k-1)
	print (i)

Buggy submission (verdict: Runtime Error):
k, x = map(int, input().split())
for i in range(x-k+1,x+k-1):
print (i)

Buggy submission (verdict: Runtime Error):
k, x = map(int, input().split())
for i in range(x-k+1,x+k-1)
print (i)

Buggy submission (verdict: Runtime Error):
k, x = map(int, input().split())
print range(x-k+1,x+k-1)
Problem p02952 (python)

Fixed submission:
N = int(input())
ans = 0
for i in range(1, N + 1):
	if len(str(i)) % 2 == 1:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
 ans = 0
for i in range(1, N + 1):
	if len(str(i)) % 2 == 1:
	ans += 1
print(ans)
Problem p02988 (python)

Fixed submission:

n = int(input())
p = list(map(int, input().split()))
ans = 0
for i in range(n - 2):
	if p[i] < p[i + 1] < p[i + 2] or p[i + 2] < p[i + 1] < p[i]:
		ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
p = list(map(int, input().split()))
count=0
for i in range (n - 2):
	if p[i]>p[i + 1]>p[i + 2] or p[i + 2]>p[i + 1]>p[i]:
    	count=count+1
print(count)

n

Buggy submission (verdict: Runtime Error):
n=int(input())
p = list(map(int, input().split()))
count=0
for i in range (n-2):
	if p[i]>p[i+1]>p[i+2] or p[i+2]>p[i+1]>p[i]:
    	count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
p = list(map(int, input().split()))
count=0
for i in range (n-2)
	if p[i]>p[i+1]>p[i+2] or p[i+2]>p[i+1]>p[i]:
    	count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
p = list(map(int, input().split()))
count=0
for i in range(n-2)
	if p[i]>p[i+1]>p[i+2] or p[i+2]>p[i+1]>p[i]:
    	count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
p = list(map(int, input().split()))
count=0
for i in range((n-2)
	if p[i]>p[i+1]>p[i+2] or p[i+2]>p[i+1]>p[i]:
    	count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
p = list(map(int, input().split()))
count=0
for i in p
	if p[i]>p[i+1]>p[i+2] or p[i+2]>p[i+1]>p[i]:
    	count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
p = [int(x) for x in input().split()] 
count=0
for i in range(n-2)
	if p[i]>p[i+1]>p[i+2] or p[i+2]>p[i+1]>p[i]:
    	count=count+1
print(count)

Buggy submission (verdict: Runtime Error):
n=int(input())
p = [int(x) for x in input().split()] 
count=0
for i in p
	if p[i]>p[i+1]>p[i+2] or p[i+2]>p[i+1]>p[i]:
    	count=count+1
print(count)
Problem p02783 (python)

Fixed submission:
nums = input().strip().split()
h = int(nums[0])
a = int(nums[1])
if h % a == 0:
    print(h // a)
else:
    print(h // a + 1)

Buggy submission (verdict: Runtime Error):
h = int(input())
a = int(input())
print(h // a + 1)

Buggy submission (verdict: Runtime Error):
h = input()
a = input()
print(h // a + 1)
Problem p02783 (python)

Fixed submission:
import numpy as np

H, A = map(int, input().split())

print(int(np.ceil(H/A)))

Buggy submission (verdict: Runtime Error):
H, N = map(int, input().split())
A_list = list(map(int, input().split()))
if H <= sum(A_list):
    print('Yes')
else:
    print('No')
Problem p02784 (python)

Fixed submission:
h, n = list(map(int, input().split(' ')))
a = list(map(int, input().split(' ')))
 
if sum(a) >= h:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
h, n = input().split(' ')
as = list(map(int, input().split(' ')))

if sum(as) >= h:
  print('Yes')
else:
  print('No')
Problem p02786 (python)

Fixed submission:
def rec_count(num):
    if num == 1:
        return 1
    elif num == 2:
        return 3
    elif num == 3:
        return 3
    else:
        split = num // 2
        return 1 + 2 * rec_count(split)

h = int(input())
print(rec_count(h))

Buggy submission (verdict: Runtime Error):
def rec_count(num):
    if num == 0:
        return 0
    elif num == 1:
        return 1
    elif num == 2:
        return 3
    elif num == 3:
        return 3
    else:
        split = num / 2
        return 1 + 2 * rec_count(split)

h = int(input())
print(rec_count(h))
Problem p02787 (python)

Fixed submission:
#!/usr/bin/env python3
import sys


def solve(H: int, N: int, A: "List[int]", B: "List[int]"):
    nodes = {0: 0}
    fixed = 0
    unfixed = set()
    while True:
        cost = nodes[fixed]
        for a, b in zip(A,B):
            new_node = fixed + a
            last = nodes.get(new_node, 999999999)
            new_cost = cost + b
            if last > new_cost:
                nodes[new_node] = new_cost
                unfixed.add(new_node)
        fixed = min(unfixed)
        if fixed >= H:
            break
        unfixed.remove(fixed)
    print(min([v for k, v in nodes.items() if k >= H]))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    A = [int()] * (N)  # type: "List[int]"
    B = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(H, N, A, B)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys


def solve(H: int, N: int, A: "List[int]", B: "List[int]"):
    nodes = {0: 0}
    fixed = 0
    unfixed = set()
    while True:
        cost = nodes[fixed]
        for a, b in zip(A,B):
            new_node = fixed + a
            last = nodes.get(new_node, 999999)
            new_cost = cost + b
            if last > new_cost:
                nodes[new_node] = new_cost
                unfixed.add(new_node)
        fixed = min(unfixed)
        unfixed.remove(fixed)
        if fixed >= H:
            break
    print(min([v for k, v in nodes.items() if k >= H]))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    A = [int()] * (N)  # type: "List[int]"
    B = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(H, N, A, B)

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

Fixed submission:
s=input().strip()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.replace("dreamer","")
s=s.replace("dream","")
print("YES" if not s else "NO")

Buggy submission (verdict: Runtime Error):
s=input().strip()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.repalce("dreamer","")
s=s.reaplce("dream","")
print("YES" if s else "NO")

Buggy submission (verdict: Runtime Error):
s=input().strip()
s=s.replace("eraser","")
s=s.replace("erase","")
s=s.repalce("dreamer","")
s=s.reaplce("dream","")
print("YES" if s else "NO")