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

from copy import deepcopy
from math import ceil

n, p = map(int, input().split())
ans = 1
q = deepcopy(p)
for i in range(2, int(p**0.5) + 2):
    cnt = 0
    while p % i == 0:
        p //= i
        cnt += 1
    if cnt > 0:
        ans *= i ** (cnt // n)

print(ans if p != q and n != 1 else q)


Error: TLE

Fixed submission:

n, p = map(int, input().split())
prime = set()
ans = 1
for i in range(2, p + 1):
    for x in prime:
        if i % x == 0:
            break
    else:
        prime.add(i)
        cnt = 0
        while p % i == 0:
            p //= i
            cnt += 1
        if cnt >= n:
            ans *= i * (cnt // n)

print(ans)
Problem p03196 (Python) — buggy submission, verdict: Time Limit Exceeded

n, p = map(int, input().split())

res = []
for i in range(2, int(pow(p, 0.5)) + 1):
    if p % i == 0:
        ex = 0
        while p % i == 0:
            ex += 1
            p //= i
        res.append([i, ex])
if p != 1:
    res.append([p, 1])

ans = 1
for p in res:
    k = p[1]
    while k:
        if k < n:
            k = 0
        else:
            ans *= p[0]
            k -= n
print(ans)


Error: TLE

Fixed submission:

def prime_factorization(n):
    res = []
    for i in range(2, int(pow(n, 0.5)) + 1):
        if n % i == 0:
            ex = 0
            while n % i == 0:
                ex += 1
                n //= i
            res.append([i, ex])
    if n != 1:
        res.append([n, 1])
    return res


n, p = map(int, input().split())
res = prime_factorization(p)
ans = [1 for _ in range(n)]
for p in res:
    k = p[1]
    while k:
        for i in range(n):
            if k == 0:
                break
            ans[i] *= p[0]
            k -= 1

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

def main():
    N, P = map(int, input().split())
    if N == 1:
        print(P)
        return
    if N >= 40:
        print(1)
        return

    i = 2
    retval = 1
    while P > 1 and i**N <= P:
        cnt = 0
        while P % i == 0:
            cnt += 1
            P //= i
        retval *= i ** (cnt // N)
        i += 1
    print(retval)


if __name__ == "__main__":
    main()


Error: 0

Fixed submission:

def main():
    N, P = map(int, input().split())
    if N == 1:
        print(P)
        return
    primes = []
    i = 2
    while i**N <= P:
        isprime = True
        for p in primes:
            if i % p == 0:
                isprime = False
                break
        if isprime:
            primes.append(i)
        i += 1

    F = {}
    i = 0
    while P > 1 and i < len(primes):
        factor = primes[i]
        while P % factor == 0:
            if factor not in F:
                F[factor] = 0
            F[factor] += 1
            P //= factor
        i += 1
    retval = 1
    for p in F:
        if F[p] >= N:
            retval *= p
    print(retval)


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

print("second" if all([int(input()) % 2 == 0 for i in range(int(input()))]) else "first")


Error: TypeError: 'str' object cannot be interpreted as an integer
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03197/Python/s329085131.py", line 1, in <module>
    print("second" if all([int(input()) % 2 == 0 for i in range(input())]) else "first")
TypeError: 'str' object cannot be interpreted as an integer


Fixed submission:

print("second" if all([int(input()) % 2 == 0 for i in range(input())]) else "first")
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

S = input()
S = S[::-1]
y = -1


def x():
    global y
    y += 1
    return y


c = [i - x() for i in range(len(S)) if S[i] == "B"]
print(sum(c))


Error: TLE

Fixed submission:

S = input()[::-1]
c = 0
while S.find("WB") != -1:
    S = S.replace("WB", "BW", 1)
    c += 1
print(c)
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

s = list(input())

count = 0
w_cnt = 0

for index in range(len(s))[::-1]:
    if s[index] == "W":
        w_cnt += 1
    else:
        count += w_cnt

print(count)


Error: TLE

Fixed submission:

s = input()

count = 0

while True:
    cnt = s.count("BW")
    if cnt > 0:
        s = s.replace("BW", "WB")
        count += cnt
    else:
        break

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

S = input()
ans = 0
black = 0
for c in S:
    if c == "B":
        black += 1
    else:
        ans += black
print(ans)


Error: TLE

Fixed submission:

S = input()
ans = 0
prev = None
while prev != ans:
    prev = ans
    ans += S.count("BW")
    S = S.replace("BW", "WB")
print(ans)
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

import numpy as np


def main():
    s = input()

    b = []
    cnt = 0
    for i, e in enumerate(s):
        if e == "B":
            b.append(i)
            cnt += 1

    b = np.array(b)
    b_fin = np.arange(len(s) - cnt, len(s))

    ans = int(np.sum(b_fin - b))

    print(ans)


if __name__ == "__main__":
    main()


Error: TLE

Fixed submission:

import numpy as np


def main():
    s = input()

    b = np.array([])
    cnt = 0
    for i, e in enumerate(s):
        if e == "B":
            b = np.append(b, i)
            cnt += 1

    b_fin = np.arange(len(s) - cnt, len(s))

    ans = int(np.sum(b_fin - b))

    print(ans)


if __name__ == "__main__":
    main()
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

S = input()

ans = 0
cnt = 0
for i in range(len(S)):
    if S[i] == "B":
        cnt += 1
    else:
        ans += cnt
print(ans)


Error: TLE

Fixed submission:

S = input()

cnt = 0
while "BW" in S:
    cnt += S.count("BW")
    S = S.replace("BW", "WB")

print(cnt)
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

s = list(input())
W_count = 0
ans = 0
for i in range(len(s)):
    if s[i] == "W":
        ans += i - W_count
        W_count += 1
print(ans)


Error: TLE

Fixed submission:

s = input()
reverse_count = 0
while "BW" in s:
    reverse_count += s.count("BW")
    s = s.replace("BW", "WB")
print(reverse_count)
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

s = list("BWBWBW" * 10000)

s = list(input())
ret, counter = 0, 0
for a in s:
    if a == "B":
        counter += 1
    else:
        ret += counter
print(str(ret))


Error: TLE

Fixed submission:

s = list(input())
num_list = [s[:i].count("B") if s[i] == "W" else 0 for i in range(1, len(s))]
print(str(sum(num_list)))
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

S = input()
b_cnt = 0
ans = 0
for c in S:
    if c == "B":
        b_cnt += 1
    else:
        ans += b_cnt

print(ans)


Error: TLE

Fixed submission:

S = input()
ans = 0
while "BW" in S:
    S = S.replace("BW", "WB", 1)
    ans += 1

print(ans)
Problem p03200 (Python) — buggy submission, verdict: Time Limit Exceeded

def resolve():
    s = input()
    ans = 0
    b = 0
    for i in range(len(s)):
        if s[i] == "W":
            ans += b
        else:
            b += 1
    print(ans)


if __name__ == "__main__":
    resolve()


Error: TLE

Fixed submission:

def resolve():
    s = input()
    ans = 0
    for i in range(len(s)):
        if s[i] == "W":
            ans += s[:i].count("B")
    print(ans)


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

from collections import Counter

N, *A = map(int, open(0).read().split())

C = Counter(A)
A.sort(reverse=True)

ans = 0
for a in A:
    if C[a] == 0:
        continue
    C[a] -= 1

    b = 2 ** a.bit_length() - a
    if C[b] > 0:
        C[b] -= 1
        ans += 1

print(ans)


Error: 0

Fixed submission:

N, *A = map(int, open(0).read().split())

S = set(A)

A.sort(reverse=True)

ans = 0
for a in A:
    b = 2 ** a.bit_length() - a
    if a != b and b in S:
        S.remove(a)
        S.remove(b)
        ans += 1

print(ans)
Problem p03201 (Python) — buggy submission, verdict: Time Limit Exceeded

# from math import log2
from math import log
from bisect import bisect_left


def log2(x):
    return log(x, 2)


def getComp(n):
    return (1 << (1 + int(log2(n)))) - n


N = int(input())
A = [int(s) for s in input().split()]
A.sort()
B = []
C = []
i = 0
while i < len(A):
    j = i
    count = 1
    while i + 1 < len(A) and A[j] == A[i + 1]:
        count += 1
        i += 1
    B.append(A[j])
    C.append(count)
    i += 1

count = 0
i = len(B) - 1
while i >= 0:
    comp = getComp(B[i])
    j = bisect_left(B, comp)
    if i == j and C[i] < 2:
        i -= 1
        continue
    if B[j] != comp:
        i -= 1
        continue
    if not C[i] or not C[j]:
        i -= 1
        continue
    C[i] -= 1
    C[j] -= 1
    count += 1

print(count)


Error: TLE

Fixed submission:

# from math import log2
from math import log
from bisect import bisect_left


def log2(x):
    return log(x, 2)


def getComp(n):
    return (1 << (1 + int(log2(n)))) - n


N = int(input())
A = [int(s) for s in input().split()]
A.sort()

count = 0
i = len(A)
while i > 0:
    i -= 1
    comp = getComp(A[i])
    j = bisect_left(A, comp)
    if i == j or A[j] != comp:
        continue
    if i < j:
        A.pop(j)
        A.pop(i)
    else:
        A.pop(i)
        A.pop(j)
    count += 1
    i -= 1

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

import random

input()
A = [int(_) for _ in input().split()]
A = [A[0]] + [j for i, j in zip(A, A[1:]) if i >= j]
N = len(A)


def cut(array, index):
    if index < 1:
        return []
    if index <= array[0][0]:
        return [(index, array[0][1])]
    for _ in range(len(array) - 1, 0, -1):
        if array[_ - 1][0] < index:
            return array[:_] + [(index, array[_][1])]


def is_possible(K):
    dp = [(A[0], 0)]
    for a in A[1:]:
        if a <= dp[-1][0]:
            dp = cut(dp, a)
        else:
            dp += [(a, 0)]
        is_added = False
        for j in range(len(dp) - 1, -1, -1):
            if dp[j][1] < K - 1:
                dp = cut(dp, dp[j][0] - 1) + [(dp[j][0], dp[j][1] + 1)]
                if dp[-1][0] < a:
                    dp += [(a, 0)]
                is_added = True
                break
        if not is_added:
            return False
    return True


def bis(x, y):
    if y == x + 1:
        return y
    elif is_possible((x + y) // 2):
        return bis(x, (x + y) // 2)
    else:
        return bis((x + y) // 2, y)


print(bis(0, N))


Error: TLE

Fixed submission:

input()
A = [int(_) for _ in input().split()]
A = [A[0]] + [j for i, j in zip(A, A[1:]) if i >= j]
N = len(A)


def cut(array, index):
    if index < 1:
        return []
    for _ in range(len(array)):
        if index <= array[_][0]:
            return array[:_] + [(index, array[_][1])]


def is_possible(K):
    dp = [(A[0], 0)]
    for a in A[1:]:
        if a <= dp[-1][0]:
            dp = cut(dp, a)
        else:
            dp += [(a, 0)]
        is_added = False
        for j in range(len(dp) - 1, -1, -1):
            if dp[j][1] < K - 1:
                dp = cut(dp, dp[j][0] - 1) + [(dp[j][0], dp[j][1] + 1)]
                if dp[-1][0] < a:
                    dp += [(a, 0)]
                is_added = True
                break
        if not is_added:
            return False
    return True


def bis(x, y):
    if y == x + 1:
        return y
    elif is_possible((x + y) // 2):
        return bis(x, (x + y) // 2)
    else:
        return bis((x + y) // 2, y)


print(bis(0, N))
Problem p03206 (Python) — buggy submission, verdict: Runtime Error

def solve():
    d = int(input())
    eves = 25 - d
    return "Christmas" + " Eve" * eves


if __name__ == "__main__":
    print(solve())


Error: TypeError: can only concatenate str (not "int") to str
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03206/Python/s602998179.py", line 8, in <module>
    print(solve())
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03206/Python/s602998179.py", line 4, in solve
    return "Christmas" + " Eve" + eves
TypeError: can only concatenate str (not "int") to str


Fixed submission:

def solve():
    d = int(input())
    eves = 25 - d
    return "Christmas" + " Eve" + eves


if __name__ == "__main__":
    print(solve())
Problem p03206 (Python) — buggy submission, verdict: Runtime Error

print("Christmas {}".format(" ".join(["Eve"] * (25 - int(input())))).strip())


Error: 0

Fixed submission:

print(f"Christmas {' '.join(['Eve'] * (25 - int(input())))}".strip())
Problem p03207 (Python) — buggy submission, verdict: Runtime Error

N = int(input())
p = [int(input()) for i in range(N)]
print(sum(p) - max(p) // 2)


Error: TypeError: 'str' object cannot be interpreted as an integer
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03207/Python/s736160846.py", line 2, in <module>
    p = [int(input()) for i in range(N)]
TypeError: 'str' object cannot be interpreted as an integer


Fixed submission:

N = input()
p = [int(input()) for i in range(N)]
print(sum(p) - max(p) // 2)
Problem p03207 (Python) — buggy submission, verdict: Runtime Error

N = int(input())
p = [int(input()) for _ in range(N)]
print(sum(p) - max(p) // 2)


Error: TypeError: 'int' object is not iterable
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03207/Python/s805819022.py", line 2, in <module>
    p = [int(input()) for _ in N]
TypeError: 'int' object is not iterable


Fixed submission:

N = int(input())
p = [int(input()) for _ in N]
print(sum(p) - max(p) // 2)
Problem p03207 (Python) — buggy submission, verdict: Runtime Error

n = input()
a = []
for i in range(int(n)):
    a.append(int(input()))

print(int(sum(a) - (max(a) / 2)))


Error: TypeError: '>' not supported between instances of 'str' and 'builtin_function_or_method'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03207/Python/s128564026.py", line 7, in <module>
    if i > max:
TypeError: '>' not supported between instances of 'str' and 'builtin_function_or_method'


Fixed submission:

input_ = input()

m = 0
s = 0
for i in input_.splitlines():
    n = int(i)
    if i > max:
        max = i
    sum += n

print(sum - (max / 2))
Problem p03207 (Python) — buggy submission, verdict: Runtime Error

n = int(input())

max_index = 0
max_price = 0
price_list = []

for i in range(0, n):
    p = int(input())
    price_list.append(p)
    if max_price < p:
        max_price = p
        max_index = i

p_sum = 0
for i, p in enumerate(price_list):
    if i == max_index:
        p_sum += p / 2
    else:
        p_sum += p

print(int(p_sum))


Error: EOFError: EOF when reading a line
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03207/Python/s849232280.py", line 8, in <module>
    p = int(input())
EOFError: EOF when reading a line


Fixed submission:

n = int(input())

max_index = 0
max_price = 0
price_list = []

for i in range(0, n + 1):
    p = int(input())
    price_list.append(p)
    if max_price < p:
        max_index = i

sum = 0
for i, p in enumerate(price_list):
    if i == max_index:
        sum += p / 2
    else:
        sum += p

print(sum)
Problem p03208 (Python) — buggy submission, verdict: Runtime Error

n, k = map(int, input().split())
h = sorted([int(input()) for _ in range(n)])
ans = 1000000000

for i in range(n - k + 1):
    ans = min(ans, h[i + k - 1] - h[i])

print(ans)


Error: IndexError: list index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03208/Python/s843004810.py", line 6, in <module>
    ans = min(ans, h[i + k - 11] - h[i])
IndexError: list index out of range


Fixed submission:

n, k = map(int, input().split())
h = sorted([int(input()) for _ in range(n)])
ans = 1000000000

for i in range(n - k + 1):
    ans = min(ans, h[i + k - 11] - h[i])

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

def main(n: int, k: int, h: list):
    h.sort()

    print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))


if __name__ == "__main__":
    n, k = map(int, input().split())
    h = [int(input()) for _ in range(n)]

    main(n, k, h)


Error: TypeError: unsupported operand type(s) for -: 'str' and 'str'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03208/Python/s200032587.py", line 11, in <module>
    main(n, k, h)
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03208/Python/s200032587.py", line 4, in main
    print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03208/Python/s200032587.py", line 4, in <listcomp>
    print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))
TypeError: unsupported operand type(s) for -: 'str' and 'str'


Fixed submission:

def main(n: int, k: int, h: list):
    h.sort()

    print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))


if __name__ == "__main__":
    n, k = map(int, input().split())
    h = [input() for _ in range(n)]

    main(n, k, h)
Problem p03209 (Python) — buggy submission, verdict: Runtime Error

N, X = map(int, input().split())


def f(n):
    # レベルnの総数
    if n == 0:
        return 1
    else:
        return 2 * f(n - 1) + 3


def g(n):
    # レベルnのpの数
    if n == 0:
        return 1
    else:
        return 2 * g(n - 1) + 1


def dfs(n, x):
    # 総数
    m = f(n)
    # 真ん中
    a = (m + 1) // 2

    if n == 0:
        return 1
    elif x == 1:
        return 0
    elif x < a:
        return dfs(n - 1, x - 1)
    elif x == a:
        return g(n - 1) + 1
    elif x >= a:
        return g(n - 1) + 1 + dfs(n - 1, x - a)
    elif x == m:
        return 2 * g(n - 1) + 1


ans = dfs(N, X)
print(ans)


Error: 0

Fixed submission:

N, X = map(int, input().split())


def f(n):
    # レベルnの総数
    if n == 0:
        return 1
    else:
        return 2 * f(n - 1) + 3


def g(n):
    # レベルnのpの数
    if n == 0:
        return 1
    else:
        return 2 * g(n - 1) + 1


def dfs(n, x):
    # 総数
    m = f(n)
    # 真ん中
    a = (m + 1) // 2

    if x == a:
        return g(n - 1) + 1
    elif x == 1:
        return 0
    elif x < a:
        return dfs(n - 1, x - 1)
    elif x >= a:
        return g(n - 1) + 1 + dfs(n - 1, x - a)
    elif x == m:
        return 2 * g(n - 1) + 1


ans = dfs(N, X)
print(ans)
Problem p03210 (Python) — buggy submission, verdict: Runtime Error

#!/usr/bin/env python3

x = int(input())

if x == 3 or x == 5 or x == 7:
    print("YES")
else:
    print("NO")


Error: EOFError: EOF when reading a line
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03210/Python/s739413400.py", line 4, in <module>
    a, b = list(map(int, input().split()))
EOFError: EOF when reading a line


Fixed submission:

#!/usr/bin/env python3

a = int(input())
a, b = list(map(int, input().split()))
a = list(str(input()))
Problem p03211 (Python) — buggy submission, verdict: Runtime Error

str = list(input())  # 一文字ずつ格納
ans = 1000

for i in range(len(str) - 2):
    sa = abs(int(str[i]) * 100 + int(str[i + 1]) * 10 + int(str[i + 2]) - 753)
    ans = min(ans, sa)

print(ans)


Error: 0

Fixed submission:

import math

str = list(input())  # 一文字ずつ格納
ans = math.inf

for i in range(len(str) - 1):
    sa = abs(int(str[i - 1]) * 100 + int(str[i]) * 10 + int(str[i + 1]) - 753)

    ans = min(ans, sa)

print(ans)
Problem p03215 (Python) — buggy submission, verdict: Time Limit Exceeded

from itertools import accumulate

N, K = map(int, input().split())
As = list(map(int, input().split()))

accAs = [0] + list(accumulate(As))

Bs = []
for L in range(N):
    for R in range(L, N):
        Bs.append(accAs[R + 1] - accAs[L])

ans = 0
for d in reversed(range(40)):
    num = sum([(B >> d) & 1 for B in Bs])
    if num >= K:
        ans += 1 << d
        Bs = [B for B in Bs if (B >> d) & 1]

print(ans)


Error: TLE

Fixed submission:

from itertools import accumulate

N, K = map(int, input().split())
As = list(map(int, input().split()))

accAs = [0] + list(accumulate(As))

Bs = []
for L in range(N):
    for R in range(L, N):
        Bs.append(accAs[R + 1] - accAs[L])

ans = 0
for d in reversed(range(50)):
    num = sum([(B >> d) & 1 for B in Bs])
    if num >= K:
        ans += 1 << d
        Bs = [B if (B >> d) & 1 else 0 for B in Bs]

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

x, y = map(int, input().split())

print(int(x + y / 2))


Error: EOFError: EOF when reading a line
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s372051841.py", line 4, in <module>
    x, y = map(int, input().split())
EOFError: EOF when reading a line


Fixed submission:

x, y = map(int, input().split())

print(int(x + y / 2))
x, y = map(int, input().split())

print(int(x + y / 2))
Problem p03219 (Python) — buggy submission, verdict: Runtime Error

x, y = map(int, input().split())

print(x + int(y / 2))


Error: ValueError: invalid literal for int() with base 10: '81 58'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s824577501.py", line 1, in <module>
    x, y = int(input())
ValueError: invalid literal for int() with base 10: '81 58'


Fixed submission:

x, y = int(input())

print(x + y / 2)
Problem p03219 (Python) — buggy submission, verdict: Runtime Error

def solve():
    x, y = map(int, input().split())
    return x + y // 2


if __name__ == "__main__":
    print(solve())


Error: ValueError: invalid literal for int() with base 10: ' '
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s803037603.py", line 7, in <module>
    print(solve())
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03219/Python/s803037603.py", line 2, in solve
    x, y = map(int, input())
ValueError: invalid literal for int() with base 10: ' '


Fixed submission:

def solve():
    x, y = map(int, input())
    return x + y // 2


if __name__ == "__main__":
    print(solve())
Problem p03220 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
t, a = map(int, input().split())
b = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))]
print(b.index(min(b)) + 1)


Error: ValueError: 2.0 is not in list
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03220/Python/s852227382.py", line 4, in <module>
    print(b.index(min(b) + 1))
ValueError: 2.0 is not in list


Fixed submission:

n = int(input())
t, a = map(int, input().split())
b = [abs(a - (t - i * 0.006)) for i in list(map(int, input().split()))]
print(b.index(min(b) + 1))
Problem p03220 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
t, a = map(int, input().split())
list = [int(i) for i in input().split()]

dif_list = []
answer = 0

for i in range(n):
    t_i = t - list[i] * 0.006
    t_i_dif = abs(a - t_i)
    dif_list.append(t_i_dif)
    if min(dif_list) == t_i_dif:
        answer = i + 1

print(answer)


Error: TypeError: 'list' object is not callable
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03220/Python/s862713349.py", line 9, in <module>
    t_i = t - list(i) * 0.006
TypeError: 'list' object is not callable


Fixed submission:

n = int(input())
t, a = map(int, input().split())
list = [int(i) for i in input().split()]

dif_list = []
answer = 0

for i in range(n):
    t_i = t - list(i) * 0.006
    t_i_dif = abs(a - t_i)
    dif_list.append(t_i_dif)
    if min(dif_list) == t_i_dif:
        answer = i + 1

print(answer)