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

Fixed submission:
n = int(input())

for _ in range(n):
    if int(input())%2 == 1:
        print("first")
        exit()
else:
    print("second")

Buggy submission (verdict: Runtime Error):
n = int(input())
a = [input() for _ in range(n)]

if max(a)%2 == 0:
    print("second")
else:
    print("first")
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
list_original = list(map(int, input().split()))

list = []

for i in range(n):
    temperature = t - list_original[i]*0.006
    list.append(abs(a - temperature))

point = list.index(min(list)) + 1

print(point)

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

count = t
result = 0

for i in range(n):
    test = t - list[i]*0.006
    if test >= a:
        if test-a <= count:
            count = test - a
            result = i+1
        else:
            pass
    else:
        if a-test <= count:
            count = a - test
            result = i+1
        else:
            pass
          
print(result

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

count = t
result = 0

for i in range(n):
    test = t - list[i]*0.006
    if test >= a:
        if test-a <= count:
            count = test - a
            result = i
        else:
            pass
    else:
        if a-test <= count:
            count = a - test
            result = i
        else:
            pass
          
print(result)
Problem p03231 (python)

Fixed submission:
from fractions import gcd

N, M = map(int, input().split())
s = input()
t = input()
g = gcd(N, M)
n, m = N//g, M//g

for i in range(g):
    if s[n*i] != t[m*i]:
        print(-1)
        exit()
print(N*M//g)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

lcm = lambda x, y: x*y//gcd(x, y)

N, M = map(int, input().split())
s = input(
t = input()
l = lcm(N, M)
n, m = N//l, M//l

for i in range(l):
    if s[m*i] != t[n*i]:
        print(-1)
        exit()
print(l)

Buggy submission (verdict: Runtime Error):
from fractions import gcd

lcm = lambda x, y: x*y//gcd(x, y)

n, m = map(int, input().split())
s = input()
t = input()

L = lcm(n, m)
ans = ["0"]*L

for i in range(n):
    p = i*L//n
    ans[p] = s[i]

for j in range(m):
    q = j*L//m
    if ans[q] != "0" and ans[q] != t[j]:
        print(-1)
        exit()

print(L)
Problem p03239 (python)

Fixed submission:
n, time = map(int, input().split())
list = []
list_ok = []

for i in range(n):
    c, t = map(int, input().split())
    object = [c, t]
    list.append(object)
    
count = 0

for j in range(n):
    if list[j][1] > time:
        continue
    else:
        list_ok.append(list[j][0])
        count += 1

if count == 0:
    print("TLE")
else:
    ans = min(list_ok)
    print(ans)

Buggy submission (verdict: Runtime Error):
n, time = map(int, input().split())
list = []
list_ok = []
for i in range(n):
    c, t = map(int, input().split())
    object = [c, t]
    list.append(object)

for j in range(n):
    if list[j][1] > time:
        continue
    else:
        list_ok.append(list[j][0])

ans = min(list_ok)

print(ans)

Buggy submission (verdict: Runtime Error):
n, time = map(int, input().split())
list = []
list_ok = []
for i in range(n):
    c, t = map(int, input().split())
    object = [c, t]
    list.append(object)
    
print(list)

for j in range(n):
    if list[j][1] > time:
        continue
    else:
        list_ok.append(list[j][0])

ans = min(list_ok)

print(ans)
Problem p03251 (python)

Fixed submission:
n, m, x, y = map(int, input().split())
areaX = list(map(int, input().split()))
areaY = list(map(int, input().split()))

areaX.append(x)
areaY.append(y)

if max(areaX) < min(areaY):
    print("No War")
else:
    print("War")

Buggy submission (verdict: Runtime Error):
n, m, x, y = map(int, input().split())
areaX = list(map(int, input().split()))
areaY = list(map(int, input().split()))

areaX.append(x)
areaY.append(y)

if maxX < minY:
    print("No War")
else:
    print("War")
Problem p03254 (python)

Fixed submission:
from bisect import bisect_right

n, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
SUM = [a[0]]

for i in range(1, n):
    SUM.append(SUM[-1]+a[i])

if SUM[-1] < x:
    print(n-1)
else:
    print(bisect_right(SUM, x))

Buggy submission (verdict: Runtime Error):
from bisect import bisect_right

n, x = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
SUM = [a[0]]

for i in range(1, n):
    SUM.append(SUM[-1]+a[i])

if SUM[-1] < x:
    print(n-1)
else:
    print(bisect_right(x, SUM))
Problem p03274 (python)

Fixed submission:
n, k = map(int, input().split())
x = list(map(int, input().split()))
ans = []

for i in range(n-k+1):
    if x[i+k-1] < 0:
        ans.append(abs(x[i]))
    elif x[i] > 0:
        ans.append(abs(x[i+k-1]))
    else:
        ans.append(min(abs(x[i])*2+abs(x[i+k-1]), abs(x[i])+abs(x[i+k-1])*2))

print(min(ans))

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

list_original.append(0)
list = sorted(list_original)
point = list.index(0)

if k <= point and point <= n-k+1:
    if abs(list[point-k]) <= list[point+k]:
        print(abs(list[point-k]))
    else:
        print(list[point])
elif point < k:
    print(list[point+k])
else:
    print(abs(list[point-k]))
Problem p03281 (python)

Fixed submission:
N = int(input())
if N < 105:
    print("0")
elif N < 135:
    print("1")
elif N < 165:
    print("2")
elif N < 189:
    print("3")
elif N < 195:
    print("4")
else:
    print("5")

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

if N <= 104:
  print(0)
else:
  print(1)
Problem p03316 (python)

Fixed submission:
n = input()
num = int(n)
len = len(n)
sn = 0

for i in range(len):
    sn += int(n[i])

if num % sn == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = input()
num = int(input())
len = len(n)
sn = 0

for i in range(len):
    sn += n[i]

if n % sn == 0:
    print("Yes")
else:
    print("No")
Problem p03331 (python)

Fixed submission:
n = int(input())
half_n = int(n//2)
ans = []

if n == 2:
    print(2)
    exit()
else:
    for i in range(1, half_n):
        a = str(i)
        b = str(n-i)
        count_a = 0
        count_b = 0
        for ai in a:
            count_a += int(ai)
        for bi in b:
            count_b += int(bi)
        ans.append(count_a + count_b)

print(min(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
half_n = int(n//2)
ans = []

for i in range(1, half_n):
    a = str(i)
    b = str(n-i)
    count_a = 0
    count_b = 0
    for ai in a:
        count_a += int(ai)
    for bi in b:
        count_b += int(bi)
    ans.append(count_a + count_b)

print(min(ans))
Problem p03338 (python)

Fixed submission:
n = int(input())
s = input()
S = []

if n == 2:
    if s[0] == s[1]:
        print(1)
        exit()
    else:
        print(0)
        exit()

for i in s:
    S.append(i)

ans = []

for j in range(1, n-1):
    count = 0
    l, r = set(S[:j]), set(S[j:])
    for k in l:
        if k in r:
            count += 1
    ans.append(count)

print(max(ans))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
S = []

for i in s:
    S.append(i)

ans = []

for j in range(1, n-1):
    count = 0
    l, r = set(S[:j]), set(S[j:])
    for k in l:
        if k in r:
            count += 1
    ans.append(count)

print(max(ans))
Problem p03339 (python)

Fixed submission:
n = int(input())
s = input()
list = []
E = s.count("E")
L = 0
check = 0 # 直前がWだったかの記憶装置

for i in s:
    if i == "E":
        E -= 1
        if check == 0:
            list.append(E+L) # E+Lが答えの候補
        elif check == 1:
            check = 0
            L += 1
            list.append(E+L)
    elif i == "W":
        if check == 0: # 一つ前がEのとき
            check = 1
            list.append(E+L)
        elif check == 1: # 一つ前がWのとき
            L += 1
            list.append(E+L)

print(min(list))

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

for i in s:
    L = s[:i]
    R = s[i+1:]
    turn = L.count("W") + R.count("E")
    if turn < ans:
        ans = turn

print(ans)
Problem p03353 (python)

Fixed submission:
s = input()
k = int(input())
n = len(s)

sub = set()

for i in range(n):
  for j in range(5):
    sub.add(s[i:i+j+1])
print(sorted(sub)[k-1])

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

sub = set()

for i in range(n+1):
    for j in range(5):
        sub.add(s[i:i+j])

sub = sorted(sub)

print(sub[k])
Problem p03359 (python)

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

if a <= b:
    print(a)
else:
    print(a-1)

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

if a < b:
    print(a)
else:
    print(a-1)
Problem p03360 (python)

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

print(max(list)*(2**k)+sum(list)-max(list))

Buggy submission (verdict: Runtime Error):
list = list(map(int, input()))
k = int(input())

print(max(list)*(2*k))
Problem p03361 (python)

Fixed submission:
def search(X, Y, MAP, H, W):
    if X < 0 or X >= H or Y < 0 or Y >= W:
        return False
    elif MAP[X][Y] == '.':
        return False
    else: 
        return True

def each(X, Y, MAP, H, W):
    right = search(X, Y+1, MAP, H, W)
    down = search(X+1, Y, MAP, H, W)
    left = search(X, Y-1, MAP, H, W)
    up = search(X-1, Y, MAP, H, W)
    return (right or down or left or up)

def main():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if s[i][j] == '#':
                if not each(i, j, s, h, w):
                    print("No")
                    exit()
    print("Yes")

main()

Buggy submission (verdict: Runtime Error):
def search(X, Y, MAP, H, W):
    if X < 0 or X >= W or Y < 0 or Y >= H:
        return False
    elif MAP[X][Y] == '.':
        return False
    else: 
        return True

def each(X, Y, MAP, H, W):
    right = search(X+1, Y, MAP, H, W)
    down = search(X, Y-1, MAP, H, W)
    left = search(X-1, Y, MAP, H, W)
    up = search(X, Y+1, MAP, H, W)
    return (right or down or left or up)

def main():
    h, w = map(int, input().split())
    s = [input() for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if s[i][j] == '#':
                if not each(i, j, s, h, w):
                    print("No")
                    exit()
    print("Yes")

main()
Problem p03370 (python)

Fixed submission:
n, x = map(int, input().split())
list = []
for i in range(n):
    list.append(int(input()))

print(n+(x-sum(list))//min(list))

Buggy submission (verdict: Runtime Error):
n, x = map(int, input().split())
list = []
for i in range(n):
    list.append(input())

print(n+(x-sum(list))//min(list))
Problem p03386 (python)

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

if b-a+1 <= k*2:
    for h in range(a, b+1):
        print(h)

else:
    for i in range(a, a+k):
        print(i)
    for j in range(b-k+1, b+1):
        print(j)

Buggy submission (verdict: Runtime Error):
2 10 3

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

if b-a+1 <=2k:
    for h in range(a, b+1):
        print(h)
else:
    for i in range(a, a+k):
        print(i)
    for j in range(b-k+1, b+1):
        print(j)

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

if b-a+1 <=2k:
    for h in range(a, b+1)
    print(h)
else:
    for i in range(a, a+k):
        print(i)
    for j in range(b-k+1, b+1):
        print(j)
Problem p03416 (python)

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

for i in range(a, b+1):
    i_str = str(i)
    length= len(i_str)
    list1 = []
    list2 = []
    for j in range(length):
        list1.append(i_str[j])
    for k in range(length):
        list2.append(i_str[-k-1])
    if list1 == list2:
        count += 1

print(count)

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

for i in range(a, b+1):
    i_str = str(i)
    length= len(i_str)
    list1 = []
    list2 = []
    for j in length:
        list1.append(i_str[i])
    for k in length:
        list2.append(i_str[-i])
    if list1 == list2:
        count += 1

print(count)
Problem p03424 (python)

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

if "Y" in list:
    print("Four")
else:
    print("Three")

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

if "Y" in list:
    print("Four")
else:
    print("Three")
Problem p03449 (python)

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

ans = a[0] + sum(b)
c = ans

for i in range(n-1) :
    c = c - b[i] + a[i+1]
    ans = max(ans, c)

print(ans)

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

if n == 1:
    print(a[0] + b[0])
    exit()

for i in range(1, n-1):
    candy = []
    candy.append(sum(a[:i]) + sum(b[i-1:]))

print(max(candy))

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

for i in range(1, n):
    candy = []
    candy.append(sum(a[:i]) + sum(b[i-1:]))

print(max(candy))

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

for i in range(1, n):
    print(a[:i], b[i-1:])
    candy = []
    candy.append(sum(a[:i]) + sum(b[i-1:]))

print(max(candy))
Problem p03456 (python)

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

if (int(x**0.5))**2 == x:
    print("Yes")
else:
    print("No")

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

if (int(x**0.5))**2 == x:
    print("Yes")
else:
    print("No")

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

if (int(a**0.5))**2 == a:
    print("Yes")
else:
    print("No")
Problem p03457 (python)

Fixed submission:
n = int(input())
x, y, t = 0, 0, 0
schd = []

for _ in range(n):
    schd.append(list(map(int, input().split())))

for k in range(n):
    t1, x1, y1 = schd[k][0], schd[k][1], schd[k][2]
    dist = abs(x1-x) + abs(y1-y)
    if dist <= t1-t and (t1-t-dist)%2 == 0:
        t, x, y = t1, x1, y1
    else:
        print("No")
        exit()
else:
    print("Yes")

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

for _ in range(n):
    schd.append(list(map(int, input().split())))

def travel(t, x, y, k):
    t1, x1, y1 = schd[k][0], schd[k][1], schd[k][2]
    dist = abs(x1-x) + abs(y1-y)
    time_dist = t1-t
    
    if dist <= time_dist and dist%2 == time_dist%2:
        if k+1 == n:
            return "Yes"
        else:
            return travel(t1, x1, y1, k+1)
    else:
        return "No"

print(travel(0, 0, 0, 0))

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

for _ in range(n):
    schd.append(list(map(int, input().split())))

def travel(x, y, t, k):
    x1, y1 = schd[k][1], schd[k][2]
    dist = abs(x1-x) + abs(y1-y)
    
    if dist <= schd[k][0]-t and (schd[k][0]-t-dist)%2 == 0:
        if k+1 == n:
            return "Yes"
        else:
            return travel(x1, y1, schd[k][0], k+1)
    else:
        return "No"

print(travel(0, 0, 0, 0))
Problem p03470 (python)

Fixed submission:
n = int(input())
list_original = [int(input()) for i in range(n)]
check = 101
count = 0

list_mid = sorted(list_original)
list = []

for j in range(1, n+1):
    list.append(list_mid[-j])

for k in list:
    if k < check:
        count += 1
        check = k

print(count)

Buggy submission (verdict: Runtime Error):
n = int(input())
list = [int(input()) for i in range(n)]
check = 101
count = 0

list.sorted(reverse=True)

for k in list:
    if k < check:
        count += 1
        check = k

print(count)
Problem p03475 (python)

Fixed submission:
n = int(input())
csf = [list(map(int, input().split())) for _ in range(n-1)]

for i in range(n):
    point = i
    ans = 0
    while point < n-1:
        c, s, f = csf[point][0], csf[point][1], csf[point][2]
        if ans < s:
            ans += s-ans+c
        else:
            if ans%f != 0:
                ans += f-(ans%f)
            ans += c
        point += 1
    print(ans)

Buggy submission (verdict: Runtime Error):
n = (input())
csf = [list(map(int, input().split())) for _ in range(n-1)]

for i in range(n):
    point = i
    ans = 0
    while point < n-1:
        c, s, f = csf[point][0], csf[point][1], csf[point][2]
        if ans < s:
            ans += s-ans+c
        else:
            if ans%f != 0:
                ans += f-(ans%f)
            ans += c
        point += 1
    print(ans)
Problem p03502 (python)

Fixed submission:
n = int(input())
x = 0

for i in str(n):
    x += int(i)

if n%x == 0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
n = int(input())
length = len(n)
x = 0

for i in str(n):
    x += int(i)

if n%x == 0:
    print("Yes")
else:
    print("No")
Problem p03544 (python)

Fixed submission:
n = int(input())
l = [2,1]

for i in range(2,87):
    x = l[i-2] + l[i-1]
    l.append(x)

print(l[n])

Buggy submission (verdict: Runtime Error):
n = int(input())
LUKAS = [0, 2, 1, 3, 4, 7, 11, 18, 29, 47, 76, 123, 199, 322, 521, 843, 1364, 2207, 3571, 5778, 9349, 15127, 24476, 39603, 64079, 103682, 167761, 271443, 439204, 710647, 1149851, 1860498, 3010349, 4870847, 7881196, 12752043, 20633239, 33385282, 54018521, 87403803, 141422324, 228826127, 370248451, 599074578, 969323029, 1568397607, 2537720636, 4106118243, 6643838879, 10749957122, 17393796001, 28143753123, 45537549124, 73681302247, 119218851371, 192900153618, 312119004989, 505019158607, 817138163596, 1322157322203, 2139295485799, 3461452808002, 5600748293801, 9062201101803, 14662949395604, 23725150497407, 38388099893011, 62113250390418, 100501350283429, 162614600673847, 263115950957276, (71)425730551631123, 688846502588399, 1114577054219522, 1803423556807921, 2918000611027443, 4721424167835364, 7639424778862807, 12360848946632171, 20000273725560978, 32361122672259149, 52361396397820127, 84722519070079276, 137083915467899403, 221806434537978679, 358890350005878082, 580696784543856761, 939587134549734843]

print(LUKAS[n])
Problem p03573 (python)

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

if a == b:
    print(c)
elif b == c:
    print(a)
else:
    print(b)

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

if a == b:
    print(c)
elif b == c:
    print(a)
else:
    print(b)
Problem p03606 (python)

Fixed submission:
n = int(input())
ans = []

for i in range(n):
    l, r = map(int, input().split())
    ans.append(abs(l-r)+1)

print(sum(ans))

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

for i in range(n):
    l, r = map(int, input().split())
    ans.append(abs(l, r)+1)

print(sum(ans))
Problem p03607 (python)

Fixed submission:
n = int(input())
a = sorted([int(input()) for _ in range(n)])
ans = 0
count = 0
pre = a[0]

for i in range(n):
    if a[i] == pre:
        count+=1
    else:
        pre = a[i]
        if count%2 == 1:
            ans += 1
        count = 1
if count%2 == 1:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = sorted([int(input()) for _ in range(n)])
ans = 0
count = 0
pre = a[0]

for i in range(n):
    if a[i] == memo:
        count+=1
    else:
        pre = a[i]
        if count%2 == 1:
            ans += 1
        count = 1
if count%2 == 1:
    ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
s = int(input())
num = [int(input()) for _ in range(n)]
ans = 0

for i in set(num):
    if num.count(i)%2 == 1:
        ans += 1

print(ans)
Problem p03624 (python)

Fixed submission:
tester = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
s = input()

for i in tester:
    if i not in s:
        print(i)
        exit()

print("None")

Buggy submission (verdict: Runtime Error):
string = abcdefghijklmnopqrstuvwxyz
s = input()

for i in range(27):
    if string[i] not in s:
        print(string[i])
        exit()

print("None")
Problem p03625 (python)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
s = set()
cands = []

for i in a:
    if i in s:
        cands.append(i)
        s.remove(i)
    else:
        s.add(i)

x = sorted(cands, reverse=True)
if len(x) < 2:
    print(0)
else:
    print(x[0]*x[1])

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a_set = set(a)
sides = []

for i in a_set:
    if a.count(i) > 1:
        sides.append(i)

if len(sides) <= 1:
    print(0)

sides = sorted(sides)
print(sides[-1]*sides[-2])
Problem p03636 (python)

Fixed submission:
s = input()
length = len(s)

print(s[0] + str(length - 2) + s[-1])

Buggy submission (verdict: Runtime Error):
s = input()
length = len(s)

print(s[0] + str(n-2) + s[-1])
Problem p03644 (python)

Fixed submission:
n = int(input())

if n == 1:
    print("1")
    exit()

for i in range(n):
    if 2**i > n:
        ans = 2**(i-1)
        break

print(ans)

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

for i in range(n):
    if 2**i > n:
        ans = 2**(i-1)
        break

print(ans)
Problem p03658 (python)

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

print(sum(l[n-k:]))

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

print(sum(:l[k-1]))
Problem p03661 (python)

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

x = 0
y = sum(a)
ans = []

for i in range(n-1):
    x += a[i]
    y -= a[i]
    ans.append(abs(x-y))

print(min(ans))

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

x = 0
y = sum(a)
ans = []

if i in range(n-1):
    x += a[i]
    y -= a[i]
    ans.append(abs(x-y))

print(min(ans))
Problem p03699 (python)

Fixed submission:
n = int(input())
s_original = [int(input()) for _ in range(n)]

S = sorted(s_original)
SUM = sum(S)
ANS = []

if SUM%10 != 0:
    ANS.append(SUM)

for i in range(n):
    ans = SUM - S[i]
    if ans%10 != 0:
        ANS.append(SUM - S[i])

if ANS == []:
    print(0)
else:
    print(max(ANS))

Buggy submission (verdict: Runtime Error):
n = int(input())
s_original = [int(input()) for _ in range(n)]

S = sorted(s_original)
SUM = sum(S)
ANS = []

if SUM%10 != 0:
    ANS.append(SUM)

for i in range(n):
    ans = SUM - S[i]
    if ans%10 != 0:
        ANS.append(SUM - S[i])

print(max(ANS))
Problem p03711 (python)

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

a, b, c = (4, 6, 9, 11), (1, 3, 5, 7, 8, 10, 12), (2)

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
elif x == 2 and y == 2:
    print("Yes")
else:
    print("No")

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

a, b, c = (4, 6, 9, 11), (1, 3, 5, 7, 8, 10, 12), (2)

if x in a and y in a:
    print("Yes")
elif x in b and y in b:
    print("Yes")
elif x in c and y in c:
    print("Yes")
else:
    print("No")
Problem p03719 (python)

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

if a <= c and c <= b:
    print("Yes")
else:
    print("No")

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

if a <= c and c <= b:
    print("Yes")
else:
    print("No")

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

if a <= c amd c <= b:
    print("Yes")
else:
    print("No")
Problem p03721 (python)

Fixed submission:
n, k = map(int, input().split())
ab = sorted([list(map(int, input().split())) for _ in range(n)])

count = 0
for x in ab:
    count += x[1]
    if k <= count:
        print(x[0])
        break

Buggy submission (verdict: Runtime Error):
n  k = map(int, input().split())
ab = [[map(int, input().split())] for _ in range(n)]

count = 0
for x in ab:
    count += x[1]
    if k <= count:
        print(x[0])
        break