alexjercan/bugnet huggingface dataset:
Problem p03069 (Python) — buggy submission, verdict: Time Limit Exceeded

N = int(input())
S = input()

res = float("inf")

# if "#" not in S or "." not in S:
#     res = 0

counts = []
counts.append((0, 0))
a, b = 0, 0
for s in S:
    if s == "#":
        a += 1
    elif s == ".":
        b += 1
    counts.append((a, b))

for i in range(N + 1):
    res = min(res, counts[i][0] + counts[-1][1] - counts[i][1])

print(res)


Error: TLE

Fixed submission:

N = int(input())
S = input()

res = float("inf")

if "." not in S or "#" not in S:
    res = 0

for i in range(N):
    res = min(res, S[:i].count("#") + S[i:].count("."))

print(res)
Problem p03069 (Python) — buggy submission, verdict: Runtime Error

N = int(input())
S = input()

W = [0] * N
W[-1] += S[-1] == "."
for i in range(N - 2, -1, -1):
    W[i] = W[i + 1] + (S[i] == ".")

B = [0] * N
B[0] += S[0] == "#"
for i in range(1, N):
    B[i] = B[i - 1] + (S[i] == "#")

T = [w + b - 1 for w, b in zip(W, B)]
T = min(T)
print(min(T, W[0], B[-1]))


Error: 0

Fixed submission:

N = int(input())
S = input()

W = [0] * N
W[-1] += S[-1] == "."
for i in range(N - 2, -1, -1):
    W[i] = W[i + 1] + (S[i] == ".")

B = [0] * N
B[0] += S[0] == "#"
for i in range(1, N):
    B[i] = B[i - 1] + (S[i] == "#")

T = [w + b for w, b in zip(W, B)]
print(min(*T, W[0], B[-1]))
Problem p03069 (Python) — buggy submission, verdict: Runtime Error

N = int(input())
S = input()

white = [0] * (N + 1)
for i in range(N):
    if S[i] == ".":
        white[i + 1] = white[i] + 1
    else:
        white[i + 1] = white[i]

ans = N
for i in range(N + 1):
    tmp = (i - white[i]) + (white[-1] - white[i])
    if tmp < ans:
        ans = tmp

print(ans)


Error: 0

Fixed submission:

N = int(input())
S = input()

for i in range(N - 1, -1, -1):
    if S[i] == ".":
        right_white = i
        break

print(min(S.count("."), S[:right_white].count("#")))
Problem p03071 (Python) — buggy submission, verdict: Runtime Error

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

total = 0

if a > b:
    total = 2 * a - 1
elif b > a:
    total = 2 * b - 1
else:
    total = 2 * a

print(total)


Error: ValueError: not enough values to unpack (expected 3, got 2)
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03071/Python/s212213791.py", line 1, in <module>
    a, b, t = map(int, input().split())
ValueError: not enough values to unpack (expected 3, got 2)


Fixed submission:

a, b, t = map(int, input().split())

print((t // a) * b)
Problem p03071 (Python) — buggy submission, verdict: Runtime Error

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

if a >= b:
    tmp1 = a
    a -= 1
else:
    tmp1 = b
    b -= 1

if a >= b:
    tmp2 = a
else:
    tmp2 = b

print(tmp1 + tmp2)


Error: 0

Fixed submission:

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

if a >= b:
    tmp1 = a
    a -= 1
else:
    tmp2 = b
    b -= 1

if a >= b:
    tmp2 = a
else:
    tmp2 = b

print(tmp1 + tmp2)
Problem p03072 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
h = list(map(int, input().split()))
total = 1
max_value = h[0]
for i in range(1, n):
    if max_value <= h[i]:
        total += 1
    max_value = max(max_value, h[i])
print(total)


Error: TypeError: 'map' object is not subscriptable
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03072/Python/s924267077.py", line 4, in <module>
    max_value = h[0]
TypeError: 'map' object is not subscriptable


Fixed submission:

n = int(input())
h = map(int, input().split())
total = 1
max_value = h[0]
for i in range(1, n):
    if max_value <= h[i]:
        total += 1
    max_value = max(max_value, h[i])
print(total)
Problem p03072 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
h = [int(x) for x in input().split()]
c = 1

for i in range(1, n):
    if h[i] >= max(h[:i]):
        c += 1
print(c)


Error: ValueError: max() arg is an empty sequence
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03072/Python/s836485359.py", line 5, in <module>
    if h[i] >= max(h[:i]):
ValueError: max() arg is an empty sequence


Fixed submission:

n = int(input())
h = [int(x) for x in input().split()]
c = 0
for i in range(n):
    if h[i] >= max(h[:i]):
        c += 1
print(c)
Problem p03072 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
h = list(map(int, input().split()))
height = h[0]
counter = 0
for i in range(n):
    if h[i] >= height:
        counter += 1
        height = h[i]

print(counter)


Error: TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03072/Python/s611455430.py", line 1, in <module>
    n = int(input().split())
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'list'


Fixed submission:

n = int(input().split())
h = list(map(int, input().split()))
height = h[0]
counter = 0
for i in h:
    if h[i] >= height:
        counter += 1
        height = h[i]

print(counter)
Problem p03072 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
h_list = list(map(int, input().split()))
highest = 0
count = 0

for i in range(n):
    if highest <= h_list[i]:
        count += 1
        highest = h_list[i]

print(count)


Error: TypeError: 'map' object is not subscriptable
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03072/Python/s767322373.py", line 7, in <module>
    if highest <= h_list[i]:
TypeError: 'map' object is not subscriptable


Fixed submission:

n = int(input())
h_list = map(int, input().split())
highest = max(h_list)
count = 1

for i in range(1, n):
    if highest <= h_list[i]:
        count += 1

print(count)
Problem p03074 (Python) — buggy submission, verdict: Time Limit Exceeded

def main():
    N, K = map(int, input().split())
    S = input()
    nums = []
    now = 1
    cnt = 0
    for s in S:
        if int(s) == now:
            cnt += 1
        else:
            nums.append(cnt)
            now ^= 1
            cnt = 1
    if cnt > 0:
        nums.append(cnt)
    if len(nums) % 2 == 0:
        nums.append(0)
    add = 2 * K + 1
    ans = 0
    left = 0
    right = 0
    tmp = 0
    for cnt in range(0, len(nums), 2):
        nleft = cnt
        nright = min(cnt + add, len(nums))
        while nleft > left:
            tmp -= nums[left]
            left += 1
        while nright > right:
            tmp += nums[right]
            right += 1
        ans = max(tmp, ans)
    print(ans)


main()


Error: TLE

Fixed submission:

def main():
    N, K = map(int, input().split())
    S = input()
    nums = []
    now = 1
    cnt = 0
    for s in S:
        if int(s) == now:
            cnt += 1
        else:
            nums.append(cnt)
            now ^= 1
            cnt = 1
    if cnt > 0:
        nums.append(cnt)
    if len(nums) % 2 == 0:
        nums.append(0)
    add = 2 * K + 1
    ans = 0
    for cnt in range(0, len(nums), 2):
        tmp = 0
        left = cnt
        right = min(cnt + add, len(nums))
        for j in range(left, right):
            tmp += nums[j]
        ans = max(tmp, ans)
    print(ans)


main()
Problem p03074 (Python) — buggy submission, verdict: Runtime Error

N, K = map(int, input().split())
S = input()
if S == "0":
    print(1)
    exit()
if S.count("0") == N:
    print(N)
    exit()
L = [0]
prev = S[0]
num = 1
for s in S[1:]:
    if s == prev:
        num += 1
    else:
        L.append(num)
        num = 1
        prev = s
L.append(num)
# print(L)
for i in range(1, len(L)):
    L[i] += L[i - 1]
# print(L)
left = 0
if S[0] == "1":
    right = min(2 * K + 1, len(L) - 1)
else:
    right = min(2 * K, len(L) - 1)
num = 0
while right < len(L):
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
    if left == 0 and S[0] == "0":
        left += 1
    else:
        left += 2
    right += 2
if S[-1] == "0":
    right -= 1
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
print(num)


Error: 0

Fixed submission:

N, K = map(int, input().split())
S = input()
L = [0]
prev = S[0]
num = 1
for s in S[1:]:
    if s == prev:
        num += 1
    else:
        L.append(num)
        num = 1
        prev = s
L.append(num)
# print(L)
for i in range(1, len(L)):
    L[i] += L[i - 1]
# print(L)
left = 0
if S[0] == "1":
    right = min(2 * K + 1, len(L) - 1)
else:
    right = min(2 * K, len(L) - 1)
num = 0
while right < len(L):
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
    if left == 0 and S[0] == "0":
        left += 1
    else:
        left += 2
    right += 2
if S[-1] == "0" and len(S) > 1:
    right -= 1
    # print("L[" + str(right) + "] - L[" + str(left) + "] = " + str(L[right] - L[left]))
    num = max(num, L[right] - L[left])
print(num)
Problem p03075 (Python) — buggy submission, verdict: Runtime Error

#!/usr/bin/env python3
import sys


def solve(a: int, b: int, c: int, d: int, e: int, k: int):
    print("Yay!" if e - a <= k else ":(")


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    a = int(next(tokens))  # type: int
    b = int(next(tokens))  # type: int
    c = int(next(tokens))  # type: int
    d = int(next(tokens))  # type: int
    e = int(next(tokens))  # type: int
    k = int(next(tokens))  # type: int
    solve(a, b, c, d, e, k)


if __name__ == "__main__":
    main()


Error: ValueError: not enough values to unpack (expected 4, got 1)
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03075/Python/s634556284.py", line 3, in <module>
    x, y, z, k = list(map(int, input().split()))
ValueError: not enough values to unpack (expected 4, got 1)


Fixed submission:

from itertools import product

x, y, z, k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ab = [ai + bi for (ai, bi) in product(a, b)]
ab.sort(reverse=True)
abc = [abi + ci for (abi, ci) in product(ab[: min(k, x * y * z)], c)]
abc.sort(reverse=True)

for abci in abc[: min(k, x * y * z)]:
    print(abci)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

times = [int(input()) for i in range(5)]
cost = 0
p_times = [time % 10 for time in times]

if (sum([i % 10 for i in p_times]) == 0) & (min(times) > 0):
    last_order = False
else:
    last_order = min([i for i in p_times if i > 0])
    last_order_idx = p_times.index(last_order)

if last_order:
    cost = times.pop(last_order_idx)

for time in times:
    if time % 10 == 0:
        cost += time
    else:
        cost += time + (10 - time % 10)

print(cost)


Error: 0

Fixed submission:

times = [int(input()) for i in range(5)]
cost = 0
p_times = [time % 10 for time in times]
if sum(p_times) == 0 and min(p_times) > 0:
    last_order = False
else:
    last_order = min([i for i in p_times if i > 0])
    last_order_idx = p_times.index(last_order)

if last_order:
    cost = times.pop(last_order_idx)

for time in times:
    if time % 10 == 0:
        cost += time
    else:
        cost += time + (10 - time % 10)

print(cost)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

dishes = [int(input()) for _ in range(5)]

dishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))
a = list()
b = list()
for d in dishes:
    if d % 10 == 0:
        a.append(d)
    else:
        b.append(d)
if len(b) > 0:
    b = [d + 10 - d % 10 for d in b[:-1]] + [b[-1]]
dishes = a + b
print(sum(dishes))


Error: WA

Fixed submission:

dishes = [int(input()) for _ in range(5)]

dishes = sorted(dishes, key=lambda x: 10 - int(str(x)[-1]))
a = list()
b = list()
for d in dishes:
    if d % 10 == 0:
        a.append(d)
    else:
        b.append(d)
b = [d + 10 - d % 10 for d in b[:-1]] + [b[-1]]
dishes = a + b
# print(sum(dishes))
#
print(1)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

menu = [int(input()) for _ in range(5)]
ans = 0
mod = []
for time in menu:
    if time % 10 == 0:
        ans += time
    else:
        ans += time
        mod.append(10 - time % 10)
try:
    mod.remove(max(mod))
    ans += sum(mod)
except:
    pass
print(ans)


Error: 0

Fixed submission:

menu = [int(input()) for _ in range(5)]
ans = 0
mod = []
for time in menu:
    if time % 10 == 0:
        ans += time
    else:
        ans += time
        mod.append(10 - time % 10)
mod.remove(max(mod))
ans += sum(mod)
print(ans)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)


# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
if len(first_digit) == 0:
    print(t)
else:
    print(t - (10 - min(first_digit)))


Error: 0

Fixed submission:

n = [int(input()) for _ in range(5)]
first_digit = []
for num in n:
    z = int(str(num)[-1])
    if z > 0:
        first_digit.append(z)

# print(first_digit)
t = 0
for i in range(len(n)):
    t += -(-n[i] // 10) * 10
print(t - (10 - min(first_digit)))
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - (10 if not m else min(m))))


Error: 0

Fixed submission:

# A = int(input())
# B = int(input())
# C = int(input())
# D = int(input())
# E = int(input())
M = [int(input()) for _ in range(5)]
m = []
T = 0
for i in range(5):
    if M[i] % 10 == 0:
        T += M[i]
    else:
        T += M[i]
        T += 10 - M[i] % 10
        m.append(M[i] % 10)
print(T - (10 - min(m)))
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

def main():
    K = [int(input()) for _ in range(5)]
    ans = []
    A = [0]
    for k in K:
        a = k % 10
        if a == 0:
            ans.append(k)
        else:
            ans.append(k + (10 - a))
            A.append(10 - a)
    print(sum(ans) - max(A))


if __name__ == "__main__":
    main()


Error: 0

Fixed submission:

def main():
    K = [int(input()) for _ in range(5)]
    ans = []
    A = []
    for k in K:
        a = k % 10
        if a == 0:
            ans.append(k)
        else:
            ans.append(k + (10 - a))
            A.append(a)
    print(sum(ans) - (10 - min(A)))


if __name__ == "__main__":
    main()
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

import math

L = [int(input()) for i in range(5)]

total = 0
sub = 0
for i in L:
    if i % 10 == 0:
        total += i
    else:
        rest = 10 - (i % 10)
        if rest > sub:
            sub = rest
        total += math.ceil(i / 10) * 10

print(total - sub)


Error: 0

Fixed submission:

L = [input() for i in range(1, 6)]

li = list(filter(lambda x: x[-1] != "0", L))
last = int(sorted(li, key=lambda x: x[-1])[0])

t = sum(map(int, L)) - last
print(t + (10 - (t % 10)) + last)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

one = []

menu = [int(input()) for i in range(5)]

for i in range(5):
    one.append(10 - menu[i] % 10)

for i in range(5):
    if one[i] == 10:
        one[i] = 0

total = 0
cnt = 0
for i in range(5):
    if cnt == 0 and one[i] == max(one):
        total += menu[i]
        cnt = 1
    else:
        total += menu[i]
        total += one[i]

print(total)


Error: 0

Fixed submission:

one = []
ten = []

menu = [int(input()) for i in range(5)]

for i in range(5):
    one.append(menu[i] % 10)
    ten.append(menu[i] // 10)

for i in range(5):
    if one[i] == 0:
        one[i] = 10

one_min = min(one)

for i in range(5):
    if one[i] == 10:
        one[i] = 0

for i in range(5):
    if one_min == one[i]:
        one_min_idx = i

total = 0

for i in range(5):
    if one_min_idx != i:
        if one[i] == 0:
            total += ten[i] * 10
        else:
            total += ten[i] * 10 + 10

total += menu[one_min_idx]

print(total)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

dish = [int(input()) for x in range(5)]
hitoketa = list(map(int, [str(x)[-1] for x in dish]))

last = 999
for i in hitoketa:
    if not i % 10 == 0:
        last = min(last, i)

if last != 999:
    last = dish[hitoketa.index(last)]
else:
    last = dish[0]

ans = last
skip = False

for i in dish:
    if i == last and not skip:
        skip = True
    elif i % 10 == 0:
        ans += i
    else:
        ans += (i // 10 + 1) * 10

print(ans)


Error: 0

Fixed submission:

dish = [int(input()) for x in range(5)]
hitoketa = list(map(int, [str(x)[-1] for x in dish]))

last = 999
for i in hitoketa:
    if not i % 10 == 0:
        last = min(last, i)

last = dish[hitoketa.index(last)]
ans = last
skip = False
for i in dish:
    if i == last and not skip:
        skip = True
    elif i % 10 == 0:
        ans += i
    else:
        ans += (i // 10 + 1) * 10

print(ans)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

orders = [int(input()) for _ in range(5)]

rest = []
time = 0
for order in orders:
    if order % 10 == 0:
        time += order
    else:
        rest.append(order)

rest_mods = list(map(lambda x: x % 10, rest))

if len(rest_mods) > 0:
    min_mods_index = rest_mods.index(min(rest_mods))
    for i in range(len(rest)):
        time += rest[i]
        if i != min_mods_index:
            time += 10 - rest[i] % 10
else:
    time += sum(rest)
print(time)


Error: 0

Fixed submission:

orders = [int(input()) for _ in range(5)]

rest = []
time = 0
for order in orders:
    if order % 10 == 0:
        time += order
    else:
        rest.append(order)

rest_mods = list(map(lambda x: x % 10, rest))
min_mods_index = rest_mods.index(min(rest_mods))
for i in range(len(rest)):
    time += rest[i]
    if i != min_mods_index:
        time += 10 - rest[i] % 10
print(time)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

orders = [A, B, C, D, E]
max_fp = 10
ans = 0
last_order = 0

for i, order in enumerate(orders):
    if order % 10 < max_fp and order % 10 != 0:
        max_fp = order % 10
        last_order = i

for i, order in enumerate(orders):
    if i == last_order or order % 10 == 0:
        ans += order
    else:
        ans += (order // 10 + 1) * 10

print(ans)


Error: 0

Fixed submission:

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

orders = [A, B, C, D, E]
max_fp = 10
ans = 0

for i, order in enumerate(orders):
    if order % 10 < max_fp and order % 10 != 0:
        max_fp = order % 10
        last_order = i

for i, order in enumerate(orders):
    if i == last_order or order % 10 == 0:
        ans += order
    else:
        ans += (order // 10 + 1) * 10

print(ans)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9
count_change = 0

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):
        last_order = order_time[i]
        count_change += 1

for i in range(0, order):
    if order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]

if count_change == 0:
    last_order = 0
else:
    time -= last_order // 10 * 10 + 10
    time += last_order

print(time)


Error: EOFError: EOF when reading a line
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03076/Python/s884853631.py", line 33, in <module>
    order_time[i] = int(input())
EOFError: EOF when reading a line


Fixed submission:

order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9
count_change = 0

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):
        last_order = order_time[i]
        count_change += 1

if count_change == 0:
    last_order = order_time[i]

for i in range(0, order):
    if order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]

time -= last_order // 10 * 10 + 10
time += last_order

print(time)
order_time = [0, 0, 0, 0, 0]
order = len(order_time)
time = 0
last_order = 9
count_change = 0

for i in range(0, order):
    order_time[i] = int(input())
    if (order_time[i] % 10 != 0) and (order_time[i] % 10 <= last_order % 10):
        last_order = order_time[i]
        count_change += 1

for i in range(0, order):
    if order_time[i] % 10 != 0:
        time += order_time[i] // 10 * 10 + 10
    else:
        time += order_time[i]

if count_change == 0:
    last_order = order_time[i]
else:
    time -= last_order // 10 * 10 + 10
    time += last_order

print(time)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

five_dish = [int(input()) for _ in range(5)]
idx = 0
maxdiff = 0
result = 0
for i in range(len(five_dish)):
    tmp = five_dish[i] % 10
    if tmp != 0:
        if 10 - tmp > maxdiff:
            maxdiff = 10 - tmp
            idx = i
for j in range(len(five_dish)):
    if j == idx:
        continue
    else:
        if five_dish[j] % 10 == 0:
            result += five_dish[j]
        else:
            result += five_dish[j] + (10 - (five_dish[j] % 10))
result += five_dish[idx]
print(result)


Error: 0

Fixed submission:

five_dish = [int(input()) for _ in range(5)]
idx = None
maxdiff = 0
result = 0
for i in range(len(five_dish)):
    tmp = five_dish[i] % 10
    if tmp == 0:
        pass
    else:
        if 10 - tmp > maxdiff:
            maxdiff = 10 - tmp
            idx = i
        else:
            pass
for j in range(len(five_dish)):
    if j == idx:
        pass
    else:
        if five_dish[j] % 10 == 0:
            result += five_dish[j]
        else:
            result += five_dish[j] + (10 - (five_dish[j] % 10))
result += five_dish[idx]
print(result)
Problem p03076 (Python) — buggy submission, verdict: Runtime Error

import math

time_list = list()

for _ in range(5):
    time_list.append(int(input()))

# 全探索
ans = 1e6
for i in range(len(time_list)):
    tmp = 0
    for j in range(len(time_list)):
        if i == j:
            tmp += time_list[i]
            continue
        tmp += math.ceil(time_list[j] / 10) * 10
    ans = min(tmp, ans)

print(ans)


Error: TypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03076/Python/s039938039.py", line 27, in <module>
    ans += math.ceil(time / 10) * 10
TypeError: unsupported operand type(s) for +=: 'builtin_function_or_method' and 'int'


Fixed submission:

import math

time_list = list()

for _ in range(5):
    time_list.append(int(input()))


def key_func(x):
    if x < 100:  # 2桁 or 1桁の場合
        if x % 10 == 0:
            return 10
        return x % 10  # ex: 19の場合は9を返す
    else:
        if x % 100 == 0:
            return 10
        return x % 100  # ex: 123の場合は3を返す


time_list.sort(key=key_func, reverse=True)

# print(time_list)

ans = sum
for i, time in enumerate(time_list):
    if i < len(time_list) - 1:
        ans += math.ceil(time / 10) * 10
    else:
        ans += time

print(ans)