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

Fixed submission:
import sys
input = sys.stdin.readline
import numpy as np
x, y, a, b, c = map(int, input().split())
P = [0]*x + [int(p) for p in input().split()]
Q = [0]*y + [int(q) for q in input().split()]
R = [int(r) for r in input().split()]

P.sort()
Q.sort()
R.sort(reverse=True)
Px = P[a:]
Qy = Q[b:]
R = R[:x+y]
pc, qc = 0, 0
pqpq = [Px, Qy]
pqc = [pc, qc]
pqctop=[x, y]
for r in R:
    if pqc[0] == x:
        pq = 1
    elif pqc[1] == y:
        pq = 0
    else:
        if Px[pqc[0]]<Qy[pqc[1]]:
            pq = 0
        else:
            pq = 1
    if pqpq[pq][pqc[pq]] < r:
        pqpq[pq][pqc[pq]] = r
        pqc[pq]+= 1
    else:
        break

print(sum(Px)+sum(Qy))

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
import numpy as np
x, y, a, b, c = map(int, input().split())
P = [0]*x + [int(p) for p in input().split()]
Q = [0]*y + [int(q) for q in input().split()]
R = [int(r) for r in input().split()]

P.sort()
Q.sort()
R.sort(reverse=True)
Px = P[a:]
Qy = Q[b:]
R = R[:x+y]
pc, qc = 0, 0
pqpq = [Px, Qy]
pqc = [pc, qc]
for r in R:
    if Px[pqc[0]]<Qy[pqc[1]]:
        pq = 0
    else:
        pq = 1
    if pqpq[pq][pqc[pq]] < r:
        pqpq[pq][pqc[pq]] = r
        pqc[pq]+= 1
    else:
        break

print(sum(Px)+sum(Qy))
Problem p02747 (python)

Fixed submission:
s = input()
if len(s) %2 !=0:
  print("No")
else:
  c =0
  for i in range(len(s)//2):
    hi = s[2*i:2*i+2]
    if hi == "hi":
      pass
    else:
      c = 1
      break
  if c ==0:
    print("Yes")
    
  else:
    print("No")

Buggy submission (verdict: Runtime Error):
s = input()
if len(s) %2 !=0:
  print("No")
else:
  c =0
  for i in range(len(s)//2):
    hi = s[2*i:2*i+2]
    if hi == "hi":
      pass
    else:
      c = 1:
      break
  if c ==0:
    print("Yes")
    
  else:
    print("No")
Problem p02748 (python)

Fixed submission:
a, b, m = map(int, input().split())
A = [int(ae) for ae in input().split()]
B = [int(be) for be in input().split()]

amin = min(A)
bmin = min(B)
smin = amin + bmin

for i in range(m):
  x, y, c= map(int, input().split())
  th = smin + c
  apmin = A[x-1]
  if apmin > th:
    pass
  else:
    bpmin = B[y-1]
    spmin = apmin + bpmin -c
    if spmin < smin:
      smin = spmin
    else:
      pass
print(smin)

Buggy submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
A = [int(ae) for ae in input().split()]
B = [int(be) for be in input().split()]

amin = min(A)
bmin = min(B)
smin = amin + bmin

for i in range(m):
  x, y, c= map(int, input().split())
  th = smin -c
  apmin = A[x]
  if apmin > th:
    pass
  else:
    bpmin = B[y]
    spmin = apmin + bpmin -c
    if spmin < smin:
      smin = spmin
    else:
      pass
print(smin)
Problem p02972 (python)

Fixed submission:
n = int(input())
A = [int(s) for s in input().split()]
cen = n //2
ANS = [0]*(cen)
A_p = A[cen:n]
ANS = ANS + A_p

for i in range(cen):
    part_sum = sum(ANS[cen-i-1::cen-i])
    dot = part_sum % 2
    if dot == A[cen-i-1]:
        pass
    else:
        ANS[cen-i-1] = 1

sum_ans = sum(ANS)
print(sum_ans)
if sum_ans == 0:
    pass
else:
    B = []
    for i in range(n):
        if ANS[i] != 0:
            B.append(i+1)
        else:
            pass
    BB = [str(a) for a in B]
    BB =" ".join(BB)
    print(BB)

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [int(s) for s in input().split()]
cen = n //2
ANS = [0]*(cen)
A_p = A[cen:n]
ANS = ANS + A_p

for i in range(cen):
    part_sum = sum(ANS[cen-i-1::cen-i])
    dot = part_sum % 2
    if dot == A[cen-i-1]:
        pass
    else:
        ANS[cen-i-1] = 1

sum_ans = sum(ANS)
print(sum_ans)
if sum_ans == 0:
    pass
else:
    B=[]
    for i in range(n):
        if ANS[i] != 0:
            B.append(i+1)
        else:
            pass
    B = " ".join(B)
    print(B)
Problem p02993 (python)

Fixed submission:
str = input()
L = [int(s) for s in str]

if L[0] == L[1]:
    ans = "Bad"
elif L[1] == L[2]:
    ans = "Bad"
elif L[2] == L[3]:
    ans = "Bad"
else:
    ans = "Good"

print(ans)

Buggy submission (verdict: Runtime Error):
import bisect

n = int(input())

a, b = map(int, input().split())
task_lis = [[b, a]]
sum_a = 0
ch_over = 1


for i in range(n-1):
    a, b = map(int, input().split())
    if a > b:
        ch_over = 0
        break
    else:
        pass
    ok2 = bisect.insort_right(task_lis,[b, a])


for i in range(n):
    if chover == 0:
        break
    else:
        pass
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")
Problem p02996 (python)

Fixed submission:
n = int(input())
task_lis = sorted([[int(i) for i in input().split()] for _ in range(n)], key = lambda x:x[1])


sum_a = 0
ch_over = 1

for i in range(n):
    sum_a += task_lis[i][0]
    if task_lis[i][1] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")

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

 task_lis = sorted([[int(i) for i in input().split()] for _ in range(n)], key = lambda x:x[1])


sum_a = 0
ch_over = 1

for i in range(n):
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")

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

 task_lis = sorted([[int(i) for i in input().split()] for _ in range(n)])


sum_a = 0
ch_over = 1

for i in range(n):
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")

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

 task_lis = [[int(r) for i in input().split()] for _ in range(n)]


sum_a = 0
ch_over = 1

for i in range(n):
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
import bisect
import sys
input = sys.stdin.readline()

n = int(input())

a, b = map(int, input().split())
task_lis = [[b, a]]

for i in range(n-1):
    a, b = map(int, input().split())
    bisect.insort_right(task_lis,[b, a])

sum_a = 0
ch_over = 1

for i in range(n):
    sum_a += task_lis[i][1]
    if task_lis[i][0] < sum_a:
        ch_over = 0
        break

if ch_over == 0:
    print("No")
else:
    print("Yes")
Problem p03035 (python)

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

if a <= 5:
    c = 0
elif a <= 12:
    c = int(b / 2)
else:
    c = b

print(c)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())

I = input().split()
A = [int(s) for s in(I)]
d = 1

for i in range(m):
    b, c = map(int, input().split())
    if d == 1:
        A.sort()
        d = 0
    else:
        pass
    for j in range(b):
        if A[j] >= c:
            break
        else:
            A[j] = c
            d = 1
ans = sum(A)
print(ans)
Problem p03043 (python)

Fixed submission:
n, k = map(int, input().split())

g = 0
ps = 0
for i in range(n):
    g = i+1
    m = 0
    while g < k:
        g = g * 2
        m = m + 1
    p = float(0.5**m / n)
    ps = ps + p

print(ps)

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

m = 0
g = 0
ps = p
for i in range(n):
    g = i+1
    while g < k:
        g = g * 2
        m = m + 1
    p = double(0.5**m) / n 
    ps = ps + p

print(ps)

Buggy submission (verdict: Runtime Error):
n, k = map(int, imput().split())

m = 0

while g < k:
    g = n * 2
    m = m + 1

double(p) = 0.5**m
print(p)
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
n = int(input())
in_num = input().split()
lis_num = [int(s) for s in in_num]
m = max(lis_num)

x = [lis_num[i] % m for i in range(n)]
sx = max(x.remove(max(x)))
m2 = max(lis_num.remove(m))
y = [lis_num[i] % m2 for i in range(n)]
sy = max(y.remove(max(y)))
if sx == 0:
  ans = m
elif sy == 0:
  ans = m2
else:
  for i in range((m+1)//2, 0, -1):
    x = [lis_num[j] % i for j in range(n)]
    sx = max(x.remove(max(x)))
    if sx == 0:
      ans = i
      break
    else:
      continue
print(ans)
Problem p03110 (python)

Fixed submission:
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = input().split()
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Buggy submission (verdict: Runtime Error):
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = map(input().split())
  amo.append(a)
  ybt.append(y)
  
sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Buggy submission (verdict: Runtime Error):
amo = []
ybt = []
 
n = int(input())
for i in range(n):
  a, y = map(str, input().split())
  amo.append(a)
  ybt.append(y)
  
float sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Buggy submission (verdict: Runtime Error):
amo = []
ybt = []
 
n = int(input())
for in range(n):
  a, y = map(str, input().split())
  amo.append(a)
  ybt.append(y)
  
float sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)

Buggy submission (verdict: Runtime Error):
amo = []
ybt = []

n = int(input())
for in range(n):
  a, y = map(str, input().split())
  amo.append(a)
  ybt.append(y)

sum = 0
for i in range(n):
  if ybt[i] == "JPY":
    sum = sum + float(amo[i])
  else:
    sum = sum + float(amo[i])* 380000
    
print(sum)
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)

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

if a * b % ==0:
  print("Even")
else:
  print(Odd)
Problem p03493 (python)

Fixed submission:
str = input()

a = int(str[0])
b = int(str[1])
c = int(str[2])

print(a+b+c)

Buggy submission (verdict: Runtime Error):
str = input()
t = 0
 
for s in str
  t = t + int(str[s])
  
print(t)

Buggy submission (verdict: Runtime Error):
str = input()
t = 0

for s in str:
  t = t + int(str[s])
  
print(t)

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

for s in str:
  a[s] = int(str[s])
print(sum(a))
Problem p02584 (python)

Fixed submission:
x, k, d = map(int, input().split())

if x == 0:
    if k % 2 == 0:
        print(0)
    else:
        print(d)
elif x > 0:
    if x >= k * d:
        print(x - k * d)
    else:
        q, mod = divmod(x, d)
        k -= q
        if k % 2 == 0:
            print(mod)
        else:
            print(abs(mod - d))
elif x < 0:
    if abs(x) >= k * d:
        print(abs(x + k * d))
    else:
        q, mod = divmod(abs(x), d)
        k -= q
        if k % 2 == 0:
            print(mod)
        else:
            print(abs(mod - d))

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

if x >= 0:
    if x >= k * d:
        print(x - k * d)
    else:
        func(x, k, d)
        # q, mod = divmod(x, d)
        # k -= q
        # if k % 2 == 0:
        #     print(mod)
        # else:
        #     print(abs(mod - d))
else:
    if abs(x) >= k * d:
        print(abs(x) - k * d)
    else:
        func(x, k, d)
        # q, mod = divmod(abs(x), d)
        # k -= q
        # if k % 2 == 0:
        #     print(mod)
        # else:
        #     print(abs(mod - d))


def func(x, k, d):
    q, mod = divmod(abs(x), d)
    k -= q
    if k % 2 == 0:
        print(mod)
    else:
        print(abs(mod - d))
    return 0

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

if x >= 0:
    if x >= k * d:
        print(x - k * d)
    else:
        func(x, k, d)
        # q, mod = divmod(x, d)
        # k -= q
        # if k % 2 == 0:
        #     print(mod)
        # else:
        #     print(abs(mod - d))
else:
    if abs(x) >= k * d:
        print(abs(x) - k * d)
    else:
        func(x, k, d)
        # q, mod = divmod(abs(x), d)
        # k -= q
        # if k % 2 == 0:
        #     print(mod)
        # else:
        #     print(abs(mod - d))


def func(x, k, d):
    q, mod = divmod(abs(x), d)
    k -= q
    if k % 2 == 0:
        print(mod)
    else:
        print(abs(mod - d))

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

# if x == 0:
#     if k % 2 == 0:
#         print(0)
#     else:
#         print(d)
elif x >= 0:
    if x >= k * d:
        print(x - k * d)
    else:
        q, mod = divmod(x, d)
        k -= q
        if k % 2 == 0:
            print(mod)
        else:
            print(abs(mod - d))
elif x < 0:
    if abs(x) >= k * d:
        print(abs(x + k * d))
    else:
        q, mod = divmod(abs(x), d)
        k -= q
        if k % 2 == 0:
            print(mod)
        else:
            print(abs(mod - d))
Problem p02639 (python)

Fixed submission:
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in range(5):
  if x[i] is 0:
    print(i+1)

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in range(x):
  if x[i] is 0:
    print(i+1)

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split()))  # n個の数字がリストに格納される

for i in 5:
  if x[i] is 0:
    print(i+1)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
 
flag = True
for i in range(len(s)):
  if s[i] is not t[i]:
    flag = False
if flag is True:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()

flag = True
for i in range(s):
  if s[i] is not t[i]:
    flag = False
if flag is True:
  print("Yes")
else:
  print("No")
Problem p02582 (python)

Fixed submission:
string = input()
result = string.count("R")
if(result == 2 and string[1] == "S"):
  print("1")
else:
  print(result)

Buggy submission (verdict: Runtime Error):
string = input()
result = string.count("R")
if(result == 2 and string[1] = "S"):
  print("1")
else:
  print(result)
Problem p02681 (python)

Fixed submission:
s = input()
t = input()
if((c.islower() for c in s) and (d.islower() for d in t) and (s == t[0:len(s)]) and len(s) + 1 == len(t)):
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
s = input()
t = input()
print("Yes" if s in t else: "No")
Problem p02630 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**6)
N = int(input())
A=list(map(int,input().split()))
Q = int(input())
BC = [map(int, input().split()) for _ in range(Q)]
B, C = [list(i) for i in zip(*BC)]
sum=0
D=[0]*(10**5+1)
for i in range(N):
    sum+=A[i]
    D[A[i]]+=1
for i in range(Q):
    D[C[i]]+=D[B[i]]
    sum+=D[B[i]]*(C[i]-B[i])
    D[B[i]]=0
    print(sum)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**6)
N = int(input())
A=list(map(int,input().split()))
A.sort()
Q = int(input())
BC = [map(int, input().split()) for _ in range(Q)]
B, C = [list(i) for i in zip(*BC)]
sum=0
D=[0]*(10**5)
for i in range(N):
    sum+=A[i]
    D[A[i]]+=1
for i in range(Q):
    D[C[i]]+=D[B[i]]
    sum+=D[B[i]]*(C[i]-B[i])
    D[B[i]]=0
    print(sum)

Buggy submission (verdict: Runtime Error):
N = int(input())
A=list(map(int,input().split()))
A.sort()
Q = int(input())
BC = [map(int, input().split()) for _ in range(Q)]
B, C = [list(i) for i in zip(*BC)]
sum=0
D=[0]*(10**5)
for i in range(N):
    sum+=A[i]
    D[A[i]]+=1
for i in range(Q):
    D[C[i]]+=D[B[i]]
    sum+=D[B[i]]*(C[i]-B[i])
    D[B[i]]=0
    print(sum)
Problem p02612 (python)

Fixed submission:
s =int(input())

a= s%1000

if a==0:
  print(0)
else:
  print(1000-a)

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

a= s%1000

if a==0:
  print(0)
elif:
  print(10-a)
Problem p02640 (python)

Fixed submission:
x,y=map(int,input().split())
tr,km,flag=0,0,0

for i in range(x+1):
  z=x-i
  if i*2+z*4==y:
    flag=1
if flag==1:
  print("Yes")
else:
	print("No")

Buggy submission (verdict: Runtime Error):
x,y=map(int,input()).split())
tr,km,flag=0,0,0
for i in range(x):
  tr+=1
  for l in range(x-tr):
    km +=1
    if tr+km==y:
      flag=1
if frag==1:
  print("Yes")
else flag ==0:
  print("No")
Problem p02717 (python)

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

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(f"{c} {a} {b}")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
print(f"{c} {a} {b}")

Buggy submission (verdict: Runtime Error):
number = map(int, input().split())
list1=[]
for i in number:
    list1.append(i)
print(f"{list1[2]} {list1[0]} {list1[1]}")

Buggy submission (verdict: Runtime Error):
number = map(int, input().split())
list1=[]
for i in number:
    list1.append(i)
print(f"{list1[2]} {list1[0]} {list1[1]}")
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 = int(input())
X = int(input())
for i in range(X-K+1,X+K):
    print(i)
Problem p02983 (python)

Fixed submission:
l, r=map(int,input().split())
if r-l>=2019:
    minimum=0
else:
    left,right=l%2019,r%2019
    minimum=2018**2
    for i in range(left,right+1):
        for j in range(i+1,right+1):
            minimum=min(minimum,i*j%2019)
print(minimum)

Buggy submission (verdict: Runtime Error):
from itertools import combinations
l, r = map(int, input().split())
n = list(combinations(range(l, r+1), 2))
ans=[]
for N in n:
    ans.append(N[0]*N[1]%2019)
print(min(set(ans)))

Buggy submission (verdict: Runtime Error):
from itertools import combinations
l, r = map(int, input().split())
n = list(combinations(range(l, r+1), 2))
ans=[]
for N in n:
    ans.append(N[0]*N[1]%2019)
print(min(ans))
Problem p02717 (python)

Fixed submission:
a = input()
b = a.split()
print(b[2] + " " + b[0] + " " + b[1])

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(set((map(int, input().split()))))
vote = []
for Ai in A:
    if Ai >= (1 / (4 * M) * sum(A)):
        vote.append(Ai)
if len(vote) >= M:
    print("Yes")
else:
    print("No")
Problem p02818 (python)

Fixed submission:
list = list(map(int,input().split()))
A = list[0]
B = list[1]
K = list[2]

if A >= K:
    A = A - K
elif (A + B) >= K:
    B = B - K + A
    A = 0
else:
    A = B = 0

print(A, B)

Buggy submission (verdict: Runtime Error):
if A >= K:
    A = A - K
elif (A + B) >= K:
    B = B - K + A
    A = 0
else:
    A = B = 0

print(A, B)

Buggy submission (verdict: Runtime Error):
list = list(map(int,input().split()))
A = list[0]
B = list[1]
K = list[2]

for num in range(K):
    if(A < 1 && B < 1):
        break
    elif(A > 1):
        A -= 1
    elif(B < 1):
        B -= 1

print(A, B)
Problem p02921 (python)

Fixed submission:
a = [raw_input() for i in range(2)]
str1 = list(a[0])
str2 = list(a[1])
count = 0
for i in range(3):
  if str1[i]==str2[i]:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
#配列うけとる
a = [input() for i in range(2)]
str1 = list(a[0])
str2 = list(a[1])
count = 0
for i range(3):
  if str1[i]==str2[i]:
    count += 1
    
print(count)
Problem p02658 (python)

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

l = 1
for i in range(18):
    l *= 10

ans = 1

for A_ in A:
    ans *= A_
    if ans > l:
        ans = -1
        break

if 0 in A: ans = 0

print(ans)

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

lim = 1
for i in range(18):
    lim *= 10

ans = 1

for A_ in A:
    ans *= A
    if ans > lim:
        ans = -1
        break

print(ans)
Problem p02646 (python)

Fixed submission:
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if abs(B-A)<=(V-W)*T:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
A, V = map(int,input().split())
B, W = map(int,input().split())
T = int(input())
if (A-B)//(V-W) <= T:
    print("YES")
else:
    print("NO")
Problem p02658 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1 
if 0 in a:
        print(0)
else:
        for i in range(n):
                ans = ans * a[i]
                if ans > 10**18:
                        ans = -1
                        break
        print(ans)

Buggy submission (verdict: Runtime Error):
input()
ans = eval(input().replace(" ", "*"))
if ans > 10**18:
        print(-1)
else:
        print(ans)

Buggy submission (verdict: Runtime Error):
input();print(eval(input().replace(" ", "*")))
Problem p02789 (python)

Fixed submission:
N, M = map(int, input().split())
print("YNeos"[N!=M::2])

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

c = 0
for i in range(N):
    flag = 1
    for j in range(i):
        if P[j] < P[i]: 
            flag = 0 
            break
    if flag > 0:
        c += 1

print(c)
Problem p02848 (python)

Fixed submission:
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ'
n = int(input())
s = input()
ans = ''
for i in s:
        pos = alph.index(i)
        ans += alph[pos + n]
print(ans)

Buggy submission (verdict: Runtime Error):
alph = 'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXY'
n = int(input())
s = input()
ans = ''
for i in s:
        pos = alph.index(i)
        ans += alph[pos + n]
print(ans)
Problem p03308 (python)

Fixed submission:
_ = input()
A = list(map(int, input().split()))
print(max(A) - min(A))

Buggy submission (verdict: Runtime Error):
 = input()
A = list(map(int, input().split()))
print(max(A) - min(A))
Problem p03433 (python)

Fixed submission:
n, a = open(0).read().split()
if int(n) % 500 <= int(a):
        print("Yes")
else:
        print("No")

Buggy submission (verdict: Runtime Error):
n, a = open(0).read().split()
print('Yneos'[n%500>a::2])
Problem p03574 (python)

Fixed submission:
H, W = map(int, input().split())
matrix = [input() for i in range(H)] 
ans = ""  
for h in range(H):
        for w in range(W):
                bomb = 0 
                for i in range(-1, 2): 
                        if 0 <= h - 1 and 0 <= w + i < W:
                                if matrix[h - 1][w + i] == "#":
                                        bomb += 1
                        if h + 1 < H and 0 <= w + i < W:
                                if matrix[h + 1][w + i] == "#":
                                        bomb += 1
                for i in range(-1, 2, 2): 
                        if 0 <= w + i < W:
                                if matrix[h][w + i] == "#":
                                        bomb += 1
                if matrix[h][w] == "#":
                        ans += "#" 
                else:
                        ans += str(bomb)
                if W - 1 > 0:
                        if w % (W - 1) == 0 and w != 0:
                                ans += "\n"
                else:
                                ans += "\n"
print(ans)

Buggy submission (verdict: Runtime Error):
H, W = map(int, input().split())
matrix = [input() for i in range(H)] 
ans = ""  
for h in range(H):
        for w in range(W):
                bomb = 0 
                for i in range(-1, 2): 
                        if 0 <= h - 1 and 0 <= w + i < W:
                                if matrix[h - 1][w + i] == "#":
                                        bomb += 1
                        if h + 1 < H and 0 <= w + i < W:
                                if matrix[h + 1][w + i] == "#":
                                        bomb += 1
                for i in range(-1, 2, 2): 
                        if 0 <= w + i < W:
                                if matrix[h][w + i] == "#":
                                        bomb += 1
                if matrix[h][w] == "#":
                        ans += "#" 
                else:
                        ans += str(bomb)
                if w % (W - 1) == 0 and w != 0:
                        ans += "\n"
print(ans)