Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1)


if __name__ == '__main__':
    main()

Fixed submission:
import heapq
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1)


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    while m > 0:
        idx = 0
        t.sort(reverse=True)
        # print(t)
        t[0] //= 2
        m -= 1
        if m != 0:
            if t[0] > t[1]:
                t[0] //= 2
            else:
                t[1] //= 2
            m -= 1

    print(sum(t))


if __name__ == '__main__':
    main()

Fixed submission:
import heapq
def main():
    n, m = list(map(int, input().split()))
    t = list(map(int, input().split()))
    t = list(map(lambda x: x*(-1), t))
    heapq.heapify(t)
    while m > 0:
        v = heapq.heappop(t) * -1
        heapq.heappush(t, (v // 2)* -1)
        m -= 1

    print(sum(t)*-1)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n = int(input())
    lis = [i for i in range(1, n + 1)]
    print(sum(lis) - len(lis))

if __name__ == '__main__':
    main()

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

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import math


def lcm(x, y):
    return (x * y) // math.gcd(x, y)



def main2():
    a, b, c, d = list(map(int, input().split()))

    sss = b//c - (a-1)//c
    ssss = b//d - (a-1)//d
    di = lcm(c,d)
    sssss = b // di - (a - 1) // di if di != 0 else 0
    print((b-a+1) - (sss+ssss-sssss))


if __name__ == '__main__':
    main2()

Fixed submission:
import fractions


def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)



def main2():
    a, b, c, d = list(map(int, input().split()))

    sss = b//c - (a-1)//c
    ssss = b//d - (a-1)//d
    di = lcm(c,d)
    sssss = b // di - (a - 1) // di if di != 0 else 0
    print((b-a+1) - (sss+ssss-sssss))


if __name__ == '__main__':
    main2()
Buggy python submission (verdict: Time Limit Exceeded):

url = "https://atcoder.jp//contests/abc113/tasks/abc113_c"

def main():
    t = list(map(int, input().split()))
    town = {k: [] for k in range(1, t[0]+1)}
    all_town = []
    for _ in range(t[1]):
        tmp = list(map(int, input().split()))
        all_town.append(tmp)
        town[tmp[0]].append(tmp[1])
    for k in town:
        town[k].sort()
    for row in all_town:
        print(str(row[0]).zfill(6) + str(town[row[0]].index(row[1])+1).zfill(6))


if __name__ == '__main__':
    main()


Fixed submission:

url = "https://atcoder.jp//contests/abc113/tasks/abc113_c"

def main():
    t = list(map(int, input().split()))
    town = {k: [] for k in range(1, t[0]+1)}
    all_town = []
    for _ in range(t[1]):
        tmp = list(map(int, input().split()))
        all_town.append(tmp)
        town[tmp[0]].append(tmp[1])
    ans = {}
    for k in town:
        town[k].sort()
        tmp_dic = {town[k][i]: str(k).zfill(6)+str(i+1).zfill(6) for i in range(len(town[k]))}
        ans.update(tmp_dic)
    for at in all_town:
        print(ans[at[1]])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):

url = "https://atcoder.jp//contests/abc113/tasks/abc113_c"

def main():
    t = list(map(int, input().split()))
    town = {k: [] for k in range(1, t[0]+1)}
    all_town = []
    for _ in range(t[1]):
        tmp = list(map(int, input().split()))
        all_town.append(tmp)
        town[tmp[0]].append(tmp[1])
    for k in town:
        town[k].sort()
    for row in all_town:
        print(str(row[0]).zfill(6) + str(town[row[0]].index(row[1])+1).zfill(6))


if __name__ == '__main__':
    main()


Fixed submission:

url = "https://atcoder.jp//contests/abc113/tasks/abc113_c"

def main():
    t = list(map(int, input().split()))
    town = {k: [] for k in range(1, t[0]+1)}
    all_town = []
    for _ in range(t[1]):
        tmp = list(map(int, input().split()))
        all_town.append(tmp)
        town[tmp[0]].append(tmp[1])
    ans = {}
    for k in town:
        town[k].sort()
        tmp_dic = {town[k][i]: str(k).zfill(6)+str(i+1).zfill(6) for i in range(len(town[k]))}
        ans.update(tmp_dic)
    for at in all_town:
        print(ans[at[1]])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):

url = "https://atcoder.jp//contests/abc094/tasks/arc095_a"

def main():
    N = int(input())
    Xs = list(map(int, input().split()))
    Xs_dic = {i: Xs[i] for i in range(len(Xs))}
    for i in range(len(Xs)):
        tmp = Xs_dic.copy()
        tmp.pop(i)
        tmp = sorted(list(tmp.values()))
        print(tmp[(len(tmp)) // 2])

if __name__ == '__main__':
    main()


Fixed submission:

url = "https://atcoder.jp//contests/abc094/tasks/arc095_a"

def main():
    N = int(input())
    Xs = list(map(int, input().split()))
    sort_Xs = sorted(Xs)
    front = len(sort_Xs) // 2 - 1
    rear = len(sort_Xs) // 2
    for X in Xs:
        if sort_Xs[rear] > X:
            print(sort_Xs[rear])
        else:
            print(sort_Xs[front])



if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):

url = "https://atcoder.jp//contests/abc094/tasks/arc095_a"

def main():
    N = int(input())
    Xs = list(map(int, input().split()))
    all_num = sum(Xs)
    for i in range(len(Xs)):
        tmp = Xs[::]
        tmp.pop(i)
        tmp.sort()
        print(tmp[(len(tmp)) // 2])

if __name__ == '__main__':
    main()


Fixed submission:

url = "https://atcoder.jp//contests/abc094/tasks/arc095_a"

def main():
    N = int(input())
    Xs = list(map(int, input().split()))
    sort_Xs = sorted(Xs)
    front = len(sort_Xs) // 2 - 1
    rear = len(sort_Xs) // 2
    for X in Xs:
        if sort_Xs[rear] > X:
            print(sort_Xs[rear])
        else:
            print(sort_Xs[front])



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
url = "https://atcoder.jp/contests/abc089/tasks/abc089_c"
import itertools
import math

def main():
    mojiretu = ('M', 'A', 'R', 'C', 'H')
    t = input()
    ttt = []
    for i in range(int(t)):
        tmp = input()
        if tmp[0] in mojiretu:
            ttt.append(tmp)
    if len(ttt) < 3:
        print(0)
        exit()
    li = list(itertools.combinations([v[0] for v in ttt], 3))
    count = 0
    for s in li:
        if len(set(s)) == 3:
            count += 1
    print(count)





if __name__ == '__main__':
    main()





Fixed submission:
url = "https://atcoder.jp/contests/abc089/tasks/abc089_c"
import itertools
import math

def main():
    mojiretu = ('M', 'A', 'R', 'C', 'H')
    dic = {'M': 0, 'A': 0, 'R': 0, 'C': 0, 'H': 0}
    t = input()
    count = 0
    for i in range(int(t)):
        tmp = input()
        if tmp[0] in mojiretu:
            dic[tmp[0]] += 1
    for l in itertools.combinations(mojiretu, 3):
        count += dic[l[0]] * dic[l[1]] * dic[l[2]]
    print(count)
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))
c = a * b
if C % 2 == 0:
  print(Odd)
else
  print(Even)

Fixed submission:
# -*- coding: utf-8 -*-
a, b = map(int, input().split())
c = a * b
if c % 2 != 0:
  print('Odd')
else:
  print('Even')
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    t = int(input())
    s = []
    for i in range(t):
        s.append(int(input()))
    print(len(set(s)))

Fixed submission:
if __name__ == '__main__':
    t = list(input())

    t[3] = '8'
    print(''.join(t))

Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    t = int(input())
    s = set()
    for i in range(t):
        s.add(int(input()))
    print(len(s))

Fixed submission:
if __name__ == '__main__':
    t = list(input())

    t[3] = '8'
    print(''.join(t))

Buggy python submission (verdict: Runtime Error):
t = int(input())
s = set()
for i in range(t):
  s.add(int(input()))
print(len(s))

Fixed submission:
if __name__ == '__main__':
    t = list(input())

    t[3] = '8'
    print(''.join(t))
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    t = (input().split(' '))
    t = [int(v) for v in t]
    for i in range(t[0]):
        for j in range(t[0] - i):
            for k in range(t[0] - j):
                if (10000 * i) + (5000 * j) + (k * 1000) == t[1]:
                    if i + j + k == t[0]:
                        print(i, j, k)
                        exit(1)

    print('-1 -1 -1')

Fixed submission:
def main2():
    t = (input().split(' '))
    t = [int(v) for v in t]
    if t[0] * 10000 < t[1]:
        print('-1 -1 -1')
        exit(0)
    for i in range(t[0] + 1):
        for j in range((t[0] + 1) - i):
            if (10000 * i) + (5000 * j) + ((t[0] - i - j) * 1000) == t[1]:
                print(i, j, (t[0] - i - j))
                exit(0)

    print('-1 -1 -1')


if __name__ == '__main__':
    main2()
Buggy python submission (verdict: Runtime Error):
def main():
    n,h = list(map(int, input().split()))
    bi = []
    max_attack = [0,0]
    for i in range(n):
        a, b = list(map(int, input().split()))
        bi.append(b)
        max_attack[0] = max(a, max_attack[0])
        max_attack[1] = max(b, max_attack[1])
    bi.sort(reverse=True)
    idx = 0
    count = 0
    while h > 0:
        damage = 0
        if max_attack[0] < bi[idx]:
            damage = bi[idx]
            idx += 1
        else:
            # count += max_attack[0] // h
            count += h // max_attack[0]
            break
        h -= damage
        count += 1
    print(count)



if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n,h = list(map(int, input().split()))
    bi = []
    max_attack = [0,0]
    for i in range(n):
        a, b = list(map(int, input().split()))
        bi.append(b)
        max_attack[0] = max(a, max_attack[0])
        max_attack[1] = max(b, max_attack[1])
    bi.sort(reverse=True)
    idx = 0
    count = 0
    while h > 0:
        damage = 0
        if idx < len(bi) and max_attack[0] < bi[idx]:
            damage = bi[idx]
            idx += 1
        else:
            count += h // max_attack[0]
            count += 0 if h % max_attack[0] == 0 else 1
            break
        h -= damage
        count += 1
    print(count)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
t = [int(v) for v in input().split(' ')]
n = t[0] + t[1]
n2 = t[2] + t[3]

if n > n2:
  print(n)
elif n < n2:
  print()n2

Fixed submission:
t = [int(v) for v in input().split(' ')]
n = t[0] + t[1]
n2 = t[2] + t[3]
 
if n > n2:
  print('Left')
elif n < n2:
  print('Right')
elif n == n2:
  print('Balanced')
Buggy python submission (verdict: Runtime Error):

def main():
    f, t = [int(v) for v in input().split(' ')]
    count = 0
    d = 1
    while True:
        tmp = f * 2
        if tmp > t:
            break
        count += 1
        print(tmp)
        d += 1
        f = tmp
    print(count + 1)
    print(read_val.get_file_value("ans"))



if __name__ == '__main__':
    main()

Fixed submission:
def main():
    f, t = [int(v) for v in input().split(' ')]
    count = 0
    d = 1
    tmp = f
    while True:
        tmp = tmp * 2
        if tmp > t:
            break
        count += 1

    print(count + 1)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
url = "https://atcoder.jp/contests/abc082/tasks/abc082_b"


def main():
    s1, s2 = [input() for i in range(2)]
    l1 = sorted(list(s1))
    l2 = sorted(list(s2), reverse=True)
    for i in range(len(l1)):
        if l1[i] < l2[i]:
            print('Yes')
            exit()
    if len(l1) < len(l2) and l1[-1] <= l2[-1]:
        print('Yes')
        exit()
    print('No')




if __name__ == '__main__':
    main()




Fixed submission:
url = "https://atcoder.jp/contests/abc082/tasks/abc082_b"


def main():
    s1, s2 = [input() for i in range(2)]
    l1 = sorted(list(s1))
    l2 = sorted(list(s2), reverse=True)
    indx = 0
    if len(l1) > len(l2):
        indx = len(l2)
    else:
        indx = len(l1)
    for i in range(indx):
        if l1[i] < l2[i]:
            print('Yes')
            exit()
    if len(l1) < len(l2) and l1[-1] <= l2[-1]:
        print('Yes')
        exit()
    print('No')




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
url = "https://atcoder.jp/contests/abc081/tasks/arc086_a"
import copy
def main():
    n, m = list(map(int, input().split()))
    li = list(map(int, input().split()))
    dic = {}

    for v in li:
        dic.setdefault(v, 0)
        dic[v] += 1

    if len(dic) <= m:
        print(0)
        exit()

    count = 0
    for i in range(len(dic) - m):
        key, val = min(dic.items(), key=lambda x: x[1])
        count += dic.pop(key)



    print(count)

if __name__ == '__main__':
    main()




Fixed submission:
url = "https://atcoder.jp/contests/abc081/tasks/arc086_a"
import copy
def main():
    n, m = list(map(int, input().split()))
    li = list(map(int, input().split()))
    dic = {}

    for v in li:
        dic.setdefault(v, 0)
        dic[v] += 1

    if len(dic) <= m:
        print(0)
        exit()

    count = 0
    vals = sorted(list(dic.values()), reverse=True)
    for i in range(len(dic) - m):
        count += vals.pop(-1)



    print(count)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
url = "https://atcoder.jp/contests/abc081/tasks/arc086_a"
import copy
def main():
    n, m = list(map(int, input().split()))
    li = list(map(int, input().split()))
    dic = {}

    for v in li:
        dic.setdefault(v, 0)
        dic[v] += 1

    if len(dic) <= m:
        print(0)
        exit()

    count = 0
    for i in range(len(dic) - m):
        key, val = min(dic.items(), key=lambda x: x[1])
        count += dic.pop(key)



    print(count)

if __name__ == '__main__':
    main()




Fixed submission:
url = "https://atcoder.jp/contests/abc081/tasks/arc086_a"
import copy
def main():
    n, m = list(map(int, input().split()))
    li = list(map(int, input().split()))
    dic = {}

    for v in li:
        dic.setdefault(v, 0)
        dic[v] += 1

    if len(dic) <= m:
        print(0)
        exit()

    count = 0
    vals = sorted(list(dic.values()), reverse=True)
    for i in range(len(dic) - m):
        count += vals.pop(-1)



    print(count)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):

tmp = list(input()).split()
val = [int(v) for v in tmp]
if val[0] * val[1] >= val[2]:
  ans = val[2]
  else:
    ans = val[0] * val[1]

Fixed submission:
tmp = input().split()
val = [int(v) for v in tmp]
if val[0] * val[1] >= val[2]:
  ans = val[2]
else:
  ans = val[0] * val[1]
print(ans)
Buggy python submission (verdict: Runtime Error):

url = "https://atcoder.jp//contests/abc073/tasks/abc073_c"

def main():
    li = [0] * (10 ** 5)
    li.append(0)

    n = int(input())
    for i in range(n):
        ind = int(input())
        if li[ind] == 0:
            li[ind] = 1
        else:
            li[ind] = 0
    print(li.count(1))
if __name__ == '__main__':
    main()


Fixed submission:

url = "https://atcoder.jp//contests/abc073/tasks/abc073_c"

def main():
    li = {}
    n = int(input())
    for i in range(n):
        ind = int(input())
        li.setdefault(ind, 0)
        if li[ind] == 0:
            li[ind] = 1
        else:
            li[ind] = 0
    print(list(li.values()).count(1))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
t = [int(v) for v in split(input())]

n = t[0] - t[1]
n2 = t[0] - t[2]
if abs(n) > abs(n2):
  print(n2)
else:
  print(n)

Fixed submission:
t = [int(v) for v in input().split(" ")]

n = t[0] - t[1]
n2 = t[0] - t[2]
if abs(n) > abs(n2):
  print('B')
else:
  print('A')
Buggy python submission (verdict: Runtime Error):
lph = [chr(i) for i in range(97, 97+26)]

s = input()
s_li = set(sorted(list(s)))

for v in alph:
    if v not in s_li:
        print(v)
        exit(0)
print('None')

Fixed submission:
alph = [chr(i) for i in range(97, 97+26)]

s = input()
s_li = set(sorted(list(s)))

for v in alph:
    if v not in s_li:
        print(v)
        exit(0)
print('None')
Buggy python submission (verdict: Time Limit Exceeded):

r = int(input())

stick = [int(v) for v in input().split()]
stick = sorted(stick, reverse=True)
s_stick = sorted(set(stick), reverse=True)

line = []
for v in s_stick:
    if stick.count(v) >= 4:
        if len(line) == 0:
            print(v * v)
            exit()
        else:
            print(line[0] * v)
            exit()
    if stick.count(v) >= 2:
        line.append(v)
        if len(line) == 2:
            print(line[0] * line[1])
            exit()
print(0)

Fixed submission:
def main2():
    r = int(input())

    stick = [int(v) for v in input().split()]
    stick = sorted(stick, reverse=True)

    line = []
    tmp = -1
    for i in range(0, len(stick), 1):
        if tmp == stick[i]:
            line.append(stick[i])
            tmp = -1
        else:
            tmp = stick[i]
        if len(line) == 2:
            print(line[0] * line[1])
            exit()
    print(0)

main2()

Buggy python submission (verdict: Time Limit Exceeded):

r = int(input())

stick = [int(v) for v in input().split()]
stick = sorted(stick, reverse=True)
s_stick = sorted(set(stick), reverse=True)

line = []
for v in s_stick:
    if stick.count(v) >= 4:
        if len(line) == 0:
            print(v * v)
            exit()
        else:
            print(line[0] * v)
            exit()
    if stick.count(v) >= 2:
        line.append(v)
        if len(line) == 2:
            print(line[0] * line[1])
            exit()
print(0)

Fixed submission:
def main2():
    r = int(input())

    stick = [int(v) for v in input().split()]
    stick = sorted(stick, reverse=True)

    line = []
    tmp = -1
    for i in range(0, len(stick), 1):
        if tmp == stick[i]:
            line.append(stick[i])
            tmp = -1
        else:
            tmp = stick[i]
        if len(line) == 2:
            print(line[0] * line[1])
            exit()
    print(0)

main2()
Buggy python submission (verdict: Runtime Error):

def main():
    n = input()
    print(f'ABC{n}')

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = input()
    print('ABC%s' % n)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):

def main():
    print(f'ABC{input()}')

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = input()
    print('ABC%s' % n)

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):

def main():
    print(f'ABC{input()}')

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = input()
    print('ABC%s' % n)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    n, m = list(map(int, input().split()))
    root_start = []
    root_goal = []
    for i in range(m):
        li = list(map(int, input().split()))
        if li[0] == 1:
            root_start.append(li[1])
        elif li[1] == n:
            root_goal.append(li[0])
    flg = False
    for ls in root_start:
        if ls in root_goal:
            flg = True

    print('POSSIBLE') if flg else print('IMPOSSIBLE')



if __name__ == '__main__':
    main()


Fixed submission:
def main():
    n, m = list(map(int, input().split()))
    root_start = []
    root_goal = []
    ans = {}
    for i in range(m):
        li = list(map(int, input().split()))
        if li[0] == 1:
            ans.setdefault(li[1], 0)
            ans[li[1]] += 1
        elif li[1] == n:
            ans.setdefault(li[0], 0)
            ans[li[0]] += 1
    flg = False
    for k in ans:
        if ans[k] >= 2:
            flg = True

    print('POSSIBLE') if flg else print('IMPOSSIBLE')



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    input()
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 3200]
    t = list(map(int, input().split()))
    ret = {399: 0, 799: 0, 1199: 0, 1599: 0, 1999: 0, 2399: 0, 2799: 0, 3199: 0, 4800: 0}
    for v in t:
        for r in rate:
            if v <= r:
                ret[r] += 1
                break
    count = 0
    for k in ret:
        if ret[k] >= 1 and k != 4800:
            count += 1
    print(count, count + ret[4800])
    # print(ret)



if __name__ == '__main__':
    main()


Fixed submission:
def main():
    input()
    rate = [399, 799, 1199, 1599, 1999, 2399, 2799, 3199, 4800]
    t = list(map(int, input().split()))
    ret = {399: 0, 799: 0, 1199: 0, 1599: 0, 1999: 0, 2399: 0, 2799: 0, 3199: 0, 4800: 0}
    for v in t:
        for r in rate:
            if v <= r:
                ret[r] += 1
                break
    count = 0
    for k in ret:
        if ret[k] >= 1 and k != 4800:
            count += 1
    if count == 0:
        print(1, count + ret[4800])
    else:
        print(count, count + ret[4800])
    # print(ret)



if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    test = [int(input()) for i in range(n)]
    score = sum(test)
    test.sort()
    if len(list(filter(lambda x:x % 10 == 0, test))) == n:
        print(0)
        exit()

    ind = 0
    while score % 10 == 0 or score > 10:
        tmp = []
        for i in range(len(test)):
            tmp.append(score - test[i])
        score = max(tmp)
        test.pop(tmp.index(max(tmp)))
    print(score)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    test = [int(input()) for i in range(n)]
    score = sum(test)
    test.sort()
    x_test = list(filter(lambda x:x % 10 != 0, test))
    if len(x_test) == 0:
        print(0)
        exit()
    elif score % 10 != 0:
        print(score)
        exit()
    x_test.sort()
    print(score - x_test[0])

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    test = [int(input()) for i in range(n)]
    score = sum(test)
    test.sort()
    if len(list(filter(lambda x:x % 10 == 0, test))) == n:
        print(0)
        exit()
    tmp = []
    ind = 0
    while score % 10 == 0:
        for i in range(len(test)):
            tmp.append(score - test[i])
        score = max(tmp)
        test.pop(tmp.index(max(tmp)))
    print(score)

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    n = int(input())
    test = [int(input()) for i in range(n)]
    score = sum(test)
    test.sort()
    x_test = list(filter(lambda x:x % 10 != 0, test))
    if len(x_test) == 0:
        print(0)
        exit()
    elif score % 10 != 0:
        print(score)
        exit()
    x_test.sort()
    print(score - x_test[0])

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main():
    a,b,c = list(map(int, input().split()))
    if a[-1] == b[0] and b[-1] == c[0]:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()


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

if __name__ == '__main__':
    main()