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

Fixed submission:
D = int(input())
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
elif D == 22:
  print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
N = int(input())
p_list = [int(i) for i in input().split()] 
sum = 0
for i in range(N):
  if p_list[i] == max(p_list):
    sum += int(p_list[i]/2)
  else:
    sum += p_list[i]
print(sum)

Buggy submission (verdict: Runtime Error):
D = int(input())
 
if D ==25;
  print("Christmas)"
else if D ==24;
  print("Christmas Eve")
else if D ==23;
  print("Christmas Eve Eve")
else if D ==22;
  print("Crhistmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):

Copy
D = int(input())
 
if D ==25;
  print("Christmas")
if D ==24;
  print("Christmas Eve")
if D ==23;
  print("Christmas Eve Eve")
if D ==22;
  print("Crhistmas Eve Eve Eve")

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

if D ==25;
  print("Christmas)"
if D ==24;
  print("Christmas Eve")
if D ==23;
  print("Christmas Eve Eve")
if D ==22;
  print("Crhistmas Eve Eve Eve")
Problem p03210 (python)

Fixed submission:
X = int(input())

if X==3 or X==5 or X==7:
	print('YES')
else:
  	print('NO')

Buggy submission (verdict: Runtime Error):
X = int(input())
	if X==3 or X==5 or X==7:
    	print('Yes')
    else:
    	print('No')
Problem p03220 (python)

Fixed submission:
N = int(input())
T , A = (int(i) for i in input().split())
H_list = [int(h) for h in input().split()]
 
A_list = [abs((T-0.006*H_list[n])-A) for n in range(N)]
 
number = 0
for n ,x in enumerate(A_list):
    if x == min(A_list):
        number = n+1
print(number)

Buggy submission (verdict: Runtime Error):
N = int(input())
T , A = (int(i) for i in input().split())
H_list = [int(h) for h in input().split()]
 
A_list = [abs((T-0.006*H_list[n])-A) for n in range(N)]

for n ,x in enumerate(A_list):
  if x == min(A_list):
    number == n
print(n)
Problem p03243 (python)

Fixed submission:
N = str(input())

list = [111*int(c) for c in '123456789']
list.sort()

x = 0
for number in list:
    if number < int(N):
        continue
    else:
        x = number
        break
print(x)

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

list = [int(c)+10*int(c)+100*int(c) for c in str(N)]
list.sort()

x = 0
for i in range(N):
    if list[i] < N:
        continue
    else:
        x = list[i]
print(x)
Problem p03251 (python)

Fixed submission:
N, M, X, Y = (int(i) for i in input().split())
l_x = [int(x) for x in input().split()]
l_y = [int(y) for y in input().split()]

l_x.append(X)
l_y.append(Y)
if max(l_x) >= min(l_y):
    print('War')
else:
    print('No War')

Buggy submission (verdict: Runtime Error):
N, M, X, Y = (int(i) for i in input().split())
l_x = [int(x) for x in input().split()]
l_y = [int(y) for y in input().split()]

if max(l_x) => min(l_y):
    print('War')
else:
    print('No War')
Problem p03293 (python)

Fixed submission:
S = str(input())
T = str(input())
 
S = S+S
if T in S:
  print('Yes')
else:
  print('No')

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

S = S+S
if T in S:
  print('Yes')
else:
  print('No')
Problem p03352 (python)

Fixed submission:
X =int(input())
max = 1 #このように書かないとX = 1,2 のときに正しい値を返せない。listにappendだとlistが空になってエラーになる。
for k in range(X):
    for j in range(X):
        if k**2 > X:
            break
        elif k**j > X:
            sub_max = k**(j-1)
            if sub_max >= max:
                max = sub_max
            break
            
print(max)

Buggy submission (verdict: Runtime Error):
X =int(input())
list = []
for k in range(X):
    for j in range(X):
        if k**2 > X:
            break
        elif k**j > X:
            list.append(k**(j-1))
            break
            
print(max(list))

Buggy submission (verdict: Runtime Error):
X =int(input())
list = []
for k in range(X):
    for j in range(X):
        if k**2 > X:
            break
        elif k**j > X:
            list.append(k**(j-1))
            break
            
print(max(list))
Problem p02684 (python)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
dir = a[0]
hash_a = [0 for _ in range(n)]
hash_a[0] = 1
cnt = 0
two = 0
while True:
    k -= 1
    cnt += 1
    if k == 0:
        break
    dir = a[dir - 1]
    if hash_a[dir - 1] == 0 or hash_a[dir - 1] == 1 or hash_a[dir - 1] == 2:
        hash_a[dir - 1] += 1
        if hash_a[dir - 1] == 2:
            two += 1
    elif hash_a[dir - 1] == 3:
        k = (k + cnt) - (cnt - (two * 2))
        k %= two
        hash_a = [-k for _ in range(n)]
print(dir)

Buggy submission (verdict: Runtime Error):
while True:
    k -= 1
    cnt += 1
    if k == 0:
        break
    dir = a[dir - 1]
    if hash_a[dir - 1] == 0 or hash_a[dir - 1] == 1 or hash_a[dir - 1] == 2:
        hash_a[dir - 1] += 1
        if hash_a[dir - 1] == 2:
            two += 1
    elif hash_a[dir - 1] == 3:
        k = (k + cnt) - (cnt - (two * 2))
        k %= two
        hash_a = [-k for _ in range(n)]
print(dir)

Buggy submission (verdict: Runtime Error):
while True:
    k -= 1
    cnt += 1
    if k == 0:
        break
    dir = a[dir - 1]
    if hash_a[dir - 1] == 0 or hash_a[dir - 1] == 1 or hash_a[dir - 1] == 2:
        hash_a[dir - 1] += 1
        if hash_a[dir - 1] == 2:
            two += 1
    elif hash_a[dir - 1] == 3:
        k = (k + cnt) - (cnt - (two * 2))
        k %= two
        hash_a = [-k for _ in range(n)]
print(dir)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dir = a[0]
hash_a = [False for _ in range(n)]
hash_a[0] = True
cnt = 0
while True:
    k -= 1
    cnt += 1
    if k == 0:
        break
    dir = a[dir - 1]
    if not hash_a[dir - 1]:
        hash_a[dir - 1] = True
    else:
        k %= cnt - 1
print(dir)

Buggy submission (verdict: Runtime Error):
n, k = map(int, input().split())
a = list(map(int, input().split()))
dir = a[0]
hash_a = [False for _ in range(n)]
hash_a[0] = True
cnt = 0
while True:
    k -= 1
    if k == 0:
        break
    dir = a[dir - 1]
    if not hash_a[dir - 1]:
        hash_a[dir - 1] = True
    else:
        k %= cnt
    cnt += 1
print(dir)
Problem p02718 (python)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= sum(a)*(1/(4*m)):
    cnt += 1

if cnt >= m:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
for i in a:
  if i >= (1/(4*m)):
    cnt += 1

if cnt < M:
  print("No")
else:
  print("Yes")

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
cnt = 0
 
if sum(a) < (1/4m) or n < m:
  print("No")
else:
  print("Yes")

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

for i in a:
  if i >= (1/4m):
    cnt += 1

if cnt < M:
  print("No")
else:
  print("Yes")
Problem p02765 (python)

Fixed submission:
n, r = map(int, input().split())
if n >= 10:
  print(r)
else:
  print(r + 100*(10 - n))

Buggy submission (verdict: Runtime Error):
n, r = map(int, input.split())
if n >= 10:
  print(r)
else:
  print(r + 100*(10 - n))
Problem p02921 (python)

Fixed submission:
s = str(input())
t = str(input())

s = [_ for _ in s]
t = [_ for _ in t]

count = 0
for i in range(3):
  if s[i] == t[i]:
    count += 1
print(count)

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

s = [_ for _ in s]
t = [_ for _ in t]

count = 0
for i in 3:
  if s[i] == t[i]:
    count += 1
print(count)

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

s = [_ for _ in s]
t = [_ for _ in t]

count = 0
for i in 3:
  if s[i] == t[i]:
    count += 1
print(count)
Problem p02922 (python)

Fixed submission:
a, b = map(int, input().split())
cnt = 0
sum_a = 1
while(sum_a < b):
  sum_a += (a - 1)
  cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
cnt = 1
sum_a = a
if a == b:
  print(cnt)
  return 0
while(1):
  if sum_a >= b:
    break
  sum_a = sum_a + a - 1
  cnt += 1
print(cnt)

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split())
cnt = 1
sum_a = a
if a == b:
  print(1)
  return 0
while(1):
  if sum_a >= b:
    break
  sum_a = sum_a + a - 1
  cnt += 1
print(cnt)
Problem p02924 (python)

Fixed submission:
n = int(input())
ans = n * (n - 1) // 2
print(int(ans))

Buggy submission (verdict: Runtime Error):
n = input()
ans = 0.5 * n * (n - 1)
print(int(ans))
Problem p02934 (python)

Fixed submission:
n=int(input())
a=list(map(int, input().split()))
top = 1
item = 1
below = []
belows = 0
for i in a:
  top *= i
for num in range(len(a)):
  for _, j in enumerate(a):
    if _ != num:
    	item *= j
  below.append(item)
  item = 1
for b in below:
  belows += b
ans = top/belows
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=list(map(int, input().split()))
top = 1
item = 1
below = []
belows = 1
for i in a:
  top *= i
for num in range(len(a))
  for _, j in enumerate(a):
    if _ != num:
    	item *= j
  below.append(item)
for b in below:
  belows += b
print(top/belows)
Problem p02945 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = int(input().split())
item = list()
item.append(a+b)
item.append(a-b)
item.append(a*b)
print(max(item))
Problem p02947 (python)

Fixed submission:
from operator import mul
from functools import reduce

def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n = int(input())
s = [str(input()) for _ in range(n)]
s = sorted(["".join(sorted(_)) for _ in [i for i in s]])
ans = 0
preb = str()
cnt = 1
for line in s:
  if preb == line:
    cnt += 1
  elif cnt >= 2:
    ans += cmb(cnt, 2)
    cnt = 1
  else:
    cnt = 1
  preb = line
if cnt >= 2:
    ans += cmb(cnt, 2)
print(ans)

Buggy submission (verdict: Runtime Error):
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


n = int(input())
s = [str(input()) for _ in range(n)]
s_set = set(["".join(sorted(_)) for _ in [i for i in s]])
s = ["".join(sorted(_)) for _ in [i for i in s]]
ans = 0
for word in s_set:
  cnt = 0
  for _ in s:
    if _ == word:
      cnt += 1
  if cnt >= 2:
  	ans += cmb(cnt, 2)
print(ans)

Buggy submission (verdict: Runtime Error):
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]


n = int(input())
s = [str(input()) for _ in range(n)]
s_set = set(["".join(sorted(_)) for _ in [i for i in s]])
s = ["".join(sorted(_)) for _ in [i for i in s]]
ans = 0
for word in s_set:
  cnt = 0
  for _ in s:
    if _ == word:
      cnt += 1
  ans += cmb(cnt, 2)
print(ans)
Problem p02953 (python)

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
p = h[-1]
flag = 0
for i in h[::-1]:
  if i <= p:
    p = i
    continue
  elif (i - p) == 1:
    p = i - 1
  else:
    print('No')
    exit()
print('Yes')

Buggy submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
p = 0
flag = 0an = int(input())
h = list(map(int, input().split()))
p = 0
flag = 0
for i in range(1, len(h) - 1):
  # 左チェック
  if (h[i - 1] - h[i]) > 1:
    print('No')
    exit()
  elif (h[i - 1] - h[i]) == 1:
    if flag == 1:
      print('No')
      exit()
    else:
      flag == 1
  elif (h[i - 1] - h[i]) == 0:
    flag == 1
  # 右チェック
  elif (h[i + 1] - h[i]) < 0:
    if flag == 1:
      print('No')
      exit()
    elif (h[i + 1] - h[i]) < -1:
      print('No')
      exit()
    elif (h[i + 1] - h[i]) == -1:
      if flag == 1:
        print('No')
        exit()
      else:
        flag = 1
  elif (h[i + 1] - h[i]) >= 0 and flag == 1:
    flag == 0
print('Yes')
for i in range(1, len(h) - 1):
  # 左チェック
  if (h[i - 1] - h[i]) > 1:
    print('No')
    exit()
  elif (h[i - 1] - h[i]) == 1:
    if flag == 1:
      print('No')
      exit()
    else:
      flag == 1
  elif (h[i - 1] - h[i]) == 0:
    flag == 1
  # 右チェック
  elif (h[i + 1] - h[i]) < 0:
    if flag == 1:
      print('No')
      exit()
    elif (h[i + 1] - h[i]) < -1:
      print('No')
      exit()
print('Yes')
Problem p02993 (python)

Fixed submission:
s = input()
s = [i for i in s]
p = str()
for j in range(len(s) - 1):
  if s[j] == s[j + 1]:
    print('Bad')
    exit()
print('Good')

Buggy submission (verdict: Runtime Error):
s = input()
s = [i for i in s]
p = str()
for j in range(len(s)):
  if j < len(s):
    if s[j] == s[j + 1]:
      print('Bad')
      exit()
print('Good')
Problem p03035 (python)

Fixed submission:
a, b = map(int, input().split())
if a<=5:
  print(0)
elif a>=6 and a<=12:
  print(int(b // 2))
else:
  print(b)

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if a<5:
  print(0)
elif a>=6 and a<=12:
  print(int(b // 2))
else:
  print(b)
Problem p03101 (python)

Fixed submission:
H, W = map(int, input().split(' '))
h, w = map(int, input().split(' '))

print(H*W - (h*W + w*H - h*w))

Buggy submission (verdict: Runtime Error):
H, W = map(str, input().split(' '))
h, w = map(str, input().split(' '))

print(H*W - (h*W + w*H - h*w))
Problem p03109 (python)

Fixed submission:
s = [int(i) for i in input().split('/')]

if s[0] <= 2019 and s[1] <= 4 and s[-1] <= 30:
  print('Heisei')
else:
  print('TBD')

Buggy submission (verdict: Runtime Error):
s = [int(input().split('/')) for _ in range(3)]

if s[0] <= 2019 and s[1] <= 4 and s[-1] <= 30:
  print('Heisei')
else:
  print('TBD')
Problem p02780 (python)

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

l = list(map(int, input().split()))
l = [(i+1)/2 for i in l]

ls = [0, l[0]]
for i in range(1, n):
    ls.append(ls[-1]+l[i])

if n == 1:
    print(l[0])
else:
    lans = [ls[i+k]-ls[i] for i in range(len(ls)-k)]
    print(max(lans))

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

l = list(map(int, input().split()))
l = [(i+1)/2 for i in l]

ls = [l[0]]
for i in range(1, n):
    ls.append(ls[-1]+l[i])

if n == 1:
    print((l[0]+1)/2)
else:
    lans = [ls[i+k]-ls[i] for i in range(len(ls)-k)]
    print(max(lans))

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

l = list(map(int, input().split()))
l = [(i+1)/2 for i in l]

ls = [l[0]]
for i in range(1, n):
    ls.append(ls[-1]+l[i])

lans = [ls[i+k]-ls[i] for i in range(len(ls)-k)]
print(max(lans))
Problem p02983 (python)

Fixed submission:
l, r = map(int, input().split())

if r//2019 != l//2019:
    print(0)

else:
    lm = list()
    for i in range(l, r):
        for j in range(i+1, r+1):
            lm.append((i*j)%2019)
    print(min(lm))

Buggy submission (verdict: Runtime Error):
l, r = map(int, input().split())

if r//2019 != l//2019:
    print(0)
else:
    l = list()
    for i in range(l, r):
        for j in range(i+1, r+1):
            l.append((i*j)%2019)
    print(min(l))
Problem p02995 (python)

Fixed submission:
import fractions

a,b,c,d = map(int, input().split())

m = c*d//fractions.gcd(c, d)
print(b- a + 1 - (b//c - (a-1)//c + b//d - (a-1)//d - b//m + (a-1)//m))

Buggy submission (verdict: Runtime Error):
import math

a,b,c,d = map(int, input().split())

m = c*d//math.gcd(c, d)
print(b- a + 1 - (b//c - (a-1)//c + b//d - (a-1)//d - b//m + (a-1)//m))
Problem p03086 (python)

Fixed submission:
S = input()
N = len(S)

s = list()
for i in range(N):
    if S[i] == "A" or S[i] == "T" or S[i] == "G" or S[i] == "C":
        s.append(1)
    else:
        s.append(0)
#print(s)

lz = list()
cnt = 0
for i in range(N):
    if s[i] == 1:
        if cnt == 0:
            cnt = 1
        else:
            cnt += 1
    else:
        lz.append(cnt)
        cnt = 0
lz.append(cnt)
print(max(lz))

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

la = [0]

for i in range(len(S)):
    for j in range(len(S)-i):
        ans = 0
        while S[i+j-1] == "A" or S[i+j-1] == "C" or S[i+j-1] == "G" or S[i+j-1] == "T":
            ans += 1
            j += 1
            la.append(ans)

print(max(la))
Problem p03352 (python)

Fixed submission:
import math

X = int(input())

if X == 1:
    print(1)
    exit()

for i in reversed(range(1, X+1)):
    for j in range(2, int(math.sqrt(i))+1):
        if abs(math.log(i, j) - round(math.log(i, j))) <= 0.0000001:
            print(i)
            exit()
    if i == 1:
        print(1)

Buggy submission (verdict: Runtime Error):
import math

X = int(input())

if X == 1:
    print(1)
    exit()

for i in reversed(range(1, X+1)):
    for j in range(2, int(math.sqrt(i))+1):
        if math.isclose(math.log(i, j), round(math.log(i, j)), rel_tol = 0.0000001):
            print(i)
            exit()
    if i == 1:
        print(1)

Buggy submission (verdict: Runtime Error):
import math

X = int(input())

if X == 1:
    print(1)
    exit()

for i in reversed(range(1, X+1)):
    for j in range(2, int(math.sqrt(i))+1):
        if math.isclose(math.log(i, j), round(math.log(i, j)), rel_tol = 0.0000001):
            print(i)
            exit()
    if i == 1:
        print(1)

Buggy submission (verdict: Runtime Error):
import math

X = int(input())

if X == 1:
    print(1)
    exit()

for i in reversed(range(1, X+1)):
    for j in range(2, int(math.sqrt(i))+1):
        if math.isclose(math.log(i, j), round(math.log(i, j)), rel_tol = 0.0000001):
            print(i)
            exit()
    if i == 1:
        print(1)
Problem p03419 (python)

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

if min(n, m) == 1:
    if max(n, m) == 1:
        print(1)
    else:
        print(max(n, m)-2)
elif min(n, m) == 2:
    print(0)
else:
    print((n-2)*(m-2))

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

la = [0] * (m+2)
li = [0] + [1]*m + [0]

lall = [la]
for i in range(n):
    lall.append(li)
lall.append(la)

# print(lall)
lcnt = [[0]*(m+2)]
for i in range(n+1):
    lcnt.append([0]*(m+2))
#nprint("lcnt =", lcnt)
 
for i in range(1, n+1):
    for j in range(1, m+1):
#        if lall[i-1][j-1:j+2] == [1,1,1] and lall[i][j-1] == 1 and lall[i][j+1] == 1 and lall[i+1][j-1:j+2] == [1,1,1]:
        for p in range(3):
            for q in range(3):
                lcnt[i-1+p][j-1+q] += 1
#                 print(i-1+p,j-1+q, lcnt[i-1+p][j-1+q], lcnt)

ans = 0
for i in range(1, n+1):
    for j in range(1, m+1):
        if lcnt[i][j] % 2 == 1:
            ans += 1

print(ans)
Problem p03611 (python)

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

lcnt = [0] * (max(la) + 3)

for i in range(N):
    lcnt[la[i]+2] += 1
    lcnt[la[i]+1] += 1
    lcnt[la[i]] += 1

print(max(lcnt))

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

lcnt = [0] * (max(la) + 1)

for i in range(N):
    lcnt[la[i]-2] += 1
    lcnt[la[i]-1] += 1
    lcnt[la[i]] += 1

print(max(lcnt))
Problem p03943 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a+b == c or b+c == a or c+a == b:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
w = 0
h = 0
lx = list()
ly = list()
la = list()
for i in range(1, N+1):
    X, Y, A = map(int, input().split())
    lx.append(X)
    ly.append(Y)
    la.append(A)
    if A == 1 and w < X:
        w = X
    elif A == 2 and X < W:
        W = X
    elif A == 3 and h < Y:
        h = Y
    elif A == 4 and Y < H:
        H = Y
S = (W - w)*(H - h)
if S < 0:
    S = 0
print(S)
Problem p03962 (python)

Fixed submission:
a, b, c = map(int, input().split())
d = a - b
e = b - c
f = c - a
if d != 0 and e != 0 and f != 0:
    print(3)
elif d == 0 and e != 0 and f != 0:
    print(2)
elif d != 0 and e == 0 and f != 0:
    print(2)
elif d != 0 and e != 0 and f == 0:
    print(2)
elif d == 0 and e == 0 and f == 0:
    print(1)

Buggy submission (verdict: Runtime Error):
ls = list()
lt = list()
la = list()
LS = list()
LT = list()
LA = list()
N = int(input())
for i in range(1, N+1):
    T, A = map(int, input().split())
    X = T + A
    ls.append(X)
    lt.append(T)
    la.append(A)
    LS.append(X)
    LT.append(T)
    LA.append(A)
print(lt, la, LT, LA)
for j in range(1, N):
    while ls[j] < ls[j-1]:
        ls[j] += LS[j]
    while lt[j] < lt[j-1] or la[j] < la[j-1]:
        lt[j] += LT[j]
        la[j] += LA[j]
    print(lt[j], la[j], LT[j], LA[j])
print(lt[N-1] + la[N-1])
Problem p03998 (python)

Fixed submission:
s = {i: list(input()) for i in "abc"}
x = "a"
while s[x]:
    x = s[x].pop(0)
print(x.upper())

Buggy submission (verdict: Runtime Error):
sa = str(input()) + "d"
sb = str(input()) + "d"
sc = str(input()) + "d"
s = sa
sa = sa[1:]
while s != "d":
	x = s[0]
	if x == "a":
		sa = sa[1:]
		s = sa
	elif x == "b":
		sb = sb[1:]
		s = sb
	elif x == "c":
		sc = sc[1:]
		s = sc
if sa == "d":
	print("A")
elif sb == "d":
	print("B")
elif sc == "d":
	print("C")
Problem p04043 (python)

Fixed submission:
a, b, c = map(int, input().split())
if a == 5 and b == 5 and c == 7:
    print("YES")
elif a == 5 and b == 7 and c == 5:
    print("YES")
elif a == 7 and b == 5 and c == 5:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a == 5 and b == 5 and C == 7:
    print("YES")
elif a == 5 and b == 7 and C == 5:
    print("YES")
elif a == 7 and b == 5 and c == 5:
    print("YES")
else:
    print("NO")
Problem p02748 (python)

Fixed submission:
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for _ in range(M)]

ans = min(a) + min(b)
for i, (xi, yi, ci) in enumerate(xyc):
    ans = min(ans, max(0, a[xi - 1] + b[yi - 1] - ci))

print(ans)

Buggy submission (verdict: Runtime Error):
A, B, M = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
xyc = [list(map(int, input().split())) for _ in range(M)]

ans = min(a) + min(b)
for i, (xi, yi, ci) in enumerate(xyc):
    ans = min(ans, a[xi - 1] + a[yi - 1] - ci)

print(ans)