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

def iter_bit(k, LIMIT):
    v = (1 << k) - 1

    while v < LIMIT:
        yield v
        x = v & -v
        y = v + x
        v = (v & ~y) // x >> 1 | y


def solve(n, cards):
    dp = [{} for _ in range(1 << n)]
    dp[-1][0] = 0
    LIMIT = 1 << n

    for d in range(n):
        for state in iter_bit(n - d, LIMIT):
            scores = dp[state]
            k = state
            curr = 0
            while k:
                b = k & -k
                i = b.bit_length() - 1
                num = cards[i][(d - i) % 2]
                next_dp = dp[state ^ b]
                for left_num, score in scores.items():
                    if left_num > num:
                        continue
                    ns = score + curr
                    if num not in next_dp or next_dp[num] > ns:
                        next_dp[num] = ns
                k ^= b
                curr += 1

    if len(dp[0]) > 0:
        return min(dp[0].values())
    else:
        return -1


n = int(input())
aaa = list(map(int, input().split()))
bbb = list(map(int, input().split()))
cards = list(zip(aaa, bbb))
print(solve(n, cards))


Error: TLE

Fixed submission:

def iter_bit(k, LIMIT):
    v = (1 << k) - 1

    while v < LIMIT:
        yield v
        x = v & -v
        y = v + x
        v = (v & ~y) // x >> 1 | y


def solve(n, cards):
    dp = [{} for _ in range(1 << n)]
    dp[-1][0] = 0
    LIMIT = 1 << n

    for d in range(n):
        for state in iter_bit(n - d, LIMIT):
            scores = dp[state]
            k = state
            curr = 0
            while k:
                b = k & -k
                i = b.bit_length() - 1
                num = cards[i][(d - i) % 2]
                next_dp = dp[state ^ b]
                for score, left_num in scores.items():
                    if left_num > num:
                        continue
                    ns = score + curr
                    if ns not in next_dp or next_dp[ns] > num:
                        next_dp[ns] = num
                k ^= b
                curr += 1

    if len(dp[0]) > 0:
        return min(dp[0].keys())
    else:
        return -1


n = int(input())
aaa = list(map(int, input().split()))
bbb = list(map(int, input().split()))
cards = list(zip(aaa, bbb))
print(solve(n, cards))
Problem p02801 (Python) — buggy submission, verdict: Runtime Error

import sys

args = sys.argv

a = "abcdefghijklmnopqrstuvwxyz"

c = input()
idx = a.index(c)
print(a[idx + 1])


Error: IndexError: list index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s556171083.py", line 7, in <module>
    c = args[1]
IndexError: list index out of range


Fixed submission:

import sys

args = sys.argv

a = "abcdefghijklmnopqrstuvwxyz"

c = args[1]
idx = a.index(c)
print(a[idx + 1])
Problem p02801 (Python) — buggy submission, verdict: Runtime Error

import string

AL = string.ascii_lowercase

C = input()
idx = AL.find(C)
idy = (idx + 1) % 26
print(AL[idy])


Error: AttributeError: module 'string' has no attribute 'lowercase'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s068085135.py", line 3, in <module>
    AL = string.lowercase
AttributeError: module 'string' has no attribute 'lowercase'


Fixed submission:

import string

AL = string.lowercase

C = input()
idx = AL.find(C)
idy = (idx + 1) % 26
print(AL[idy])
Problem p02801 (Python) — buggy submission, verdict: Runtime Error

c = input()
s = "abcdefghijklmnopqrstuvwxyz"
flg = True
for i in range(len(s) + 1):
    if c == s[i] and c != "z":
        print(s[i + 1])
        break
    elif c == "z":
        print("a")
        break


Error: IndexError: string index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s621913033.py", line 5, in <module>
    if c == s[i] and c != "z":
IndexError: string index out of range


Fixed submission:

c = input()
s = "abcdefghijklmnopqrstuvwxyz"
flg = True
for i in range(len(s) + 1):
    if c == s[i] and c != "z":
        print(s[i + 1])
        flg = False
    elif c == "z":
        print("a")
        flg = False
Problem p02801 (Python) — buggy submission, verdict: Runtime Error

#!/usr/bin/env python
# -*- coding: utf-8 -*-


def resolve():
    c = input()

    print(chr(ord(c) + 1))


if __name__ == "__main__":
    resolve()


Error: ValueError: invalid literal for int() with base 10: 'a'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s953923794.py", line 15, in <module>
    resolve()
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02801/Python/s953923794.py", line 6, in resolve
    n, m = map(int, input().split())
ValueError: invalid literal for int() with base 10: 'a'


Fixed submission:

#!/usr/bin/env python
# -*- coding: utf-8 -*-


def resolve():
    n, m = map(int, input().split())

    if n == m:
        print("Yes")
    else:
        print("No")


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

N, M = map(int, input().split())
correct = [0 for _ in range(N)]
missed = [0 for _ in range(N)]
penalty = 0
ans = 0
for _ in range(M):
    p, s = input().split()
    p = int(p)

    if s == "AC" and correct[p - 1] == 0:
        correct[p - 1] = 1
        penalty += missed[p - 1]
    elif s == "WA" and correct[p - 1] == 0:
        missed[p - 1] += 1

print(sum(correct), penalty)


Error: TLE

Fixed submission:

N, M = map(int, input().split())
correct = []
missed = [0 for _ in range(N)]
penalty = 0

for _ in range(M):
    p, s = input().split()
    p = int(p)

    if s == "AC" and p not in correct:
        correct.append(p)
        penalty += missed[p - 1]
    elif s == "WA" and p not in correct:
        missed[p - 1] += 1

print(len(correct), penalty)
Problem p02802 (Python) — buggy submission, verdict: Runtime Error

n, m = map(int, input().split())
table = {}
ac = 0
pena = 0
pena_arr = [0 for _ in range(n + 1)]
for _ in range(m):
    a, b = input().split()
    a = int(a)
    if a in table:
        continue
    if b == "AC":
        ac += 1
        table[a] = True
    elif b == "WA":
        pena_arr[a] += 1
pena = 0
for i in range(1, n + 1):
    if pena_arr[i] > 0 and i in table:
        pena += pena_arr[i]
print(ac, pena)


Error: WA

Fixed submission:

n, m = map(int, input().split())
table = {}
ac = 0
pena_arr = [0 for _ in range(m + 1)]
for _ in range(n):
    a, b = input().split()
    a = int(a)
    if a not in table and b == "AC":
        ac += 1
        table[a] = True
    elif a not in table and b == "WA":
        pena_arr[a] += 1
pena = 0
for i in range(1, m + 1):
    if pena_arr[i] > 0 and i in table:
        pena += pena_arr[i]
print(ac, pena)
Problem p02802 (Python) — buggy submission, verdict: Runtime Error

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

scores = [[0, False] for _ in range(n + 1)]

for _ in range(m):
    p, S = input().split()
    p = int(p)

    if scores[p][1]:
        continue

    if S == "AC":
        scores[p][1] = True
        continue

    if S == "WA":
        scores[p][0] += 1

score = pena = 0
for count, ac in scores:
    if ac:
        score += 1
        pena += count

print(score, pena)


Error: IndexError: list index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02802/Python/s650750562.py", line 9, in <module>
    if scores[p][1]:
IndexError: list index out of range


Fixed submission:

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

scores = [[0, False] for _ in range(n)]

for _ in range(m):
    p, S = input().split()
    p = int(p)

    if scores[p][1]:
        continue

    if S == "AC":
        scores[p][1] = True
        continue

    if S == "WA":
        scores[p][0] += 1

score = pena = 0
for count, ac in scores:
    if ac:
        score += 1
        pena += count

print(score, pena)
Problem p02802 (Python) — buggy submission, verdict: Runtime Error

N, M = map(int, input().split())
accepted = [0] * N
penalties = [0] * N
for _ in range(M):
    p, ac = input().split()
    p, ac = int(p) - 1, ac == "AC"
    accepted[p] |= ac
    penalties[p] += not accepted[p]
print(sum(accepted), sum(p for ac, p in zip(accepted, penalties) if ac))


Error: IndexError: list index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02802/Python/s182965476.py", line 7, in <module>
    accepted[p] |= ac
IndexError: list index out of range


Fixed submission:

N, M = map(int, input().split())
accepted = [0] * N
penalties = [0] * N
for _ in range(M):
    p, ac = input().split()
    p, ac = int(p), ac == "AC"
    accepted[p] |= ac
    penalties[p] += not accepted[p]
print(sum(accepted), sum(p for ac, p in zip(accepted, penalties) if ac))
Problem p02802 (Python) — buggy submission, verdict: Runtime Error

import numpy as np

n, m = map(int, input().split())
is_ac = np.zeros(n, dtype=bool)
wc_count = np.zeros(n, dtype=int)

for _ in range(m):
    p, s = input().split()
    p = int(p)
    if not is_ac[p - 1]:
        if s == "WA":
            wc_count[p - 1] += 1
        else:
            is_ac[p - 1] = True
print(is_ac.sum(), wc_count[is_ac].sum())


Error: TLE

Fixed submission:

import numpy as np

n, m = map(int, input().split())
is_ac = np.zeros(n, dtype=int)
wc_count = np.zeros(n, dtype=int)

for _ in range(m):
    p, s = input().split()
    p = int(p)
    if is_ac[p - 1] == 0:
        if s == "WA":
            wc_count[p - 1] += 1
        else:
            is_ac[p - 1] = 1
print(is_ac.sum(), wc_count[is_ac].sum())
Problem p02802 (Python) — buggy submission, verdict: Runtime Error

def main(n: int, m: int, p_s: list):
    bool_ac = [False for _ in range(n)]
    count_wa = [0 for _ in range(n)]
    ac, wa = 0, 0

    for p, s in p_s:
        p = int(p)

        if bool_ac[p - 1]:
            continue

        if s == "AC":
            bool_ac[p - 1] = True
            wa += count_wa[p - 1]
            ac += 1
        elif s == "WA":
            count_wa[p - 1] += 1

    print(ac, wa)


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

    main(n, m, p_s)


Error: ValueError: invalid literal for int() with base 10: 'WA'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02802/Python/s345841239.py", line 20, in <module>
    p_s = [list(map(int, input().split())) for _ in range(m)]
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02802/Python/s345841239.py", line 20, in <listcomp>
    p_s = [list(map(int, input().split())) for _ in range(m)]
ValueError: invalid literal for int() with base 10: 'WA'


Fixed submission:

def main(n, m, p_s):
    st = [False for _ in range(n)]
    ac, wa = 0, 0

    for p, s in p_s:
        if st[p - 1]:
            continue

        if s == "AC":
            ac += 1
            st[p - 1] = True
        if s == "WA":
            wa += 1

    print(ac, wa)


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

    main(n, m, p_s)
Problem p02803 (Python) — buggy submission, verdict: Runtime Error

from collections import deque

H, W = map(int, input().split())

H += 2
W += 2

grid = "#" * W
for _ in range(H - 2):
    grid += "#" + input() + "#"
grid += "#" * W


def bfs(start):
    INF = 10**9
    dist = [INF] * (H * W)
    dist[start] = 0
    q = deque([start])
    while q:
        v = q.popleft()
        dv = dist[v]
        for move in (-1, 1, W, -W):
            # next place
            w = v + move
            # wall or not
            if grid[w] == "#":
                continue

            dw = dv + 1
            if dw >= dist[w]:
                continue
            dist[w] = dw
            q.append(w)

    return max(x for x in dist if x < INF)


answer = max(bfs(v) for v in range(H * W) if grid[v] != "#")
print(answer)


Error: TypeError: can only concatenate str (not "list") to str
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02803/Python/s560031032.py", line 10, in <module>
    grid += "#" + input().split()
TypeError: can only concatenate str (not "list") to str


Fixed submission:

from collections import deque

H, W = map(int, input().split())

H += 2
W += 2

grid = "#" * W
for _ in range(H - 2):
    grid += "#" + input().split()
grid += "#" * W


def bfs(start):
    INF = 10 * 9
    dist = [INF] * (H * W)
    dist[start] = 0
    q = deque([start])
    while q:
        v = q.popleft()
        dv = dist[v]
        for move in (-1, 1, W, -W):
            # next place
            w = v + move
            # wall or not
            if grid[w] == "#":
                continue

            dw = dv + 1
            if dw >= dist[w]:
                continue
            dist[w] = dw
            q.append(w)

    return max(x for x in dist if x < INF)


answer = max(bfs(v) for v in range(H * W) if grid[v] != "#")
print(answer)
Problem p02803 (Python) — buggy submission, verdict: Time Limit Exceeded

from collections import deque
import copy


H, W = map(int, input().split())
S = [list(input()) for i in range(H)]


def bfs(maze, start):
    q = deque()
    q.append((start, 0))

    max_depth = 0

    while len(q) > 0:
        p, depth = q.popleft()

        if p[0] < 0 or H <= p[0]:
            continue
        if p[1] < 0 or W <= p[1]:
            continue
        if maze[p[0]][p[1]] == "#":
            continue

        maze[p[0]][p[1]] = "#"
        max_depth = depth

        next_pos = [
            (p[0] - 1, p[1]),
            (p[0] + 1, p[1]),
            (p[0], p[1] - 1),
            (p[0], p[1] + 1),
        ]

        for pos in next_pos:
            q.append((pos, depth + 1))

    return max_depth


depth = 0
for h in range(H):
    for w in range(W):
        maze = copy.deepcopy(S)
        depth = max(depth, bfs(maze, (h, w)))

print(depth)


Error: TLE

Fixed submission:

from collections import deque
import itertools
import copy

H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]


def bfs(maze, s, g):
    q = deque()
    q.append((s, 0))

    maze[s[0]][s[1]] = "#"

    while len(q) > 0:
        p, depth = q.popleft()

        if p == g:
            return depth

        # ikerutoko
        next_pos = []
        if 0 <= p[0] - 1 < H and maze[p[0] - 1][p[1]] != "#":
            next_pos.append((p[0] - 1, p[1]))
        if 0 <= p[0] + 1 < H and maze[p[0] + 1][p[1]] != "#":
            next_pos.append((p[0] + 1, p[1]))
        if 0 <= p[1] - 1 < W and maze[p[0]][p[1] - 1] != "#":
            next_pos.append((p[0], p[1] - 1))
        if 0 <= p[1] + 1 < W and maze[p[0]][p[1] + 1] != "#":
            next_pos.append((p[0], p[1] + 1))

        # print(next_pos, q)

        for pos in next_pos:
            maze[pos[0]][pos[1]] = "#"
            q.append((pos, depth + 1))

    return -1


kaisuu = 0
for s in itertools.product(range(H), range(W)):
    for g in itertools.product(range(H), range(W)):
        if s == g or S[s[0]][s[1]] == "#" or S[g[0]][g[1]] == "#":
            continue

        maze = copy.deepcopy(S)
        k = bfs(maze, s, g)
        kaisuu = max(kaisuu, k)

print(kaisuu)
Problem p02803 (Python) — buggy submission, verdict: Runtime Error

from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
import numpy as np

H, W = map(int, input().split())
S = [input() for _ in range(H)]

v_id_dict = {}
dista = np.ones((400, 400)) * np.inf

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            v_id_dict[i, j] = len(v_id_dict)

            if (i > 0) and (S[i - 1][j] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i - 1, j)]] = 1

            if (j > 0) and (S[i][j - 1] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i, j - 1)]] = 1

dist_mat = dijkstra(
    csgraph_from_dense(dista[: len(v_id_dict), : len(v_id_dict)]),
    directed=False,
    unweighted=False,
)

print(int(dist_mat.max()))


Error: ModuleNotFoundError: No module named 'scipy'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02803/Python/s307435936.py", line 1, in <module>
    from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
ModuleNotFoundError: No module named 'scipy'


Fixed submission:

from scipy.sparse.csgraph import dijkstra, csgraph_from_dense
import numpy as np

H, W = map(int, input().split())
S = [input() for _ in range(H)]

v_id_dict = {}
dista = np.ones((20, 20)) * np.inf

for i in range(H):
    for j in range(W):
        if S[i][j] == ".":
            v_id_dict[i, j] = len(v_id_dict)

            if (i > 0) and (S[i - 1][j] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i - 1, j)]] = 1

            if (j > 0) and (S[i][j - 1] == "."):
                dista[v_id_dict[(i, j)], v_id_dict[(i, j - 1)]] = 1

dist_mat = dijkstra(
    csgraph_from_dense(dista[: len(v_id_dict), : len(v_id_dict)]),
    directed=False,
    unweighted=False,
)

print(int(dist_mat.max()))
Problem p02803 (Python) — buggy submission, verdict: Time Limit Exceeded

from copy import deepcopy
from collections import deque

# 最短にする
# 0回以上でたどり着けるのでスタート=ゴールのことがある ふざけんな
h, w = map(int, input().split())
table = [[] for _ in range(h)]
for i in range(h):
    table[i] = list(input())


def bfs(y, x, t):
    steps = [0, 1, 0, -1, 0]
    queue = deque([[y, x]])
    ret = 0
    while len(queue) > 0:
        cur_y, cur_x = queue.popleft()
        for i in range(4):
            next_y, next_x = cur_y + steps[i], cur_x + steps[i + 1]
            if 0 <= next_y < h and 0 <= next_x < w:
                if t[next_y][next_x] == ".":
                    t[next_y][next_x] = t[cur_y][cur_x] + 1
                    ret = max(ret, t[next_y][next_x])
                    queue.append([next_y, next_x])

    return ret


ans = 0
for sy in range(h):
    for sx in range(w):
        # table[sy][sx]をスタート地点とする
        if table[sy][sx] != ".":
            continue
        mytable = deepcopy(table)
        mytable[sy][sx] = 0
        ret = bfs(sy, sx, mytable)
        ans = max(ans, ret)

print(ans)


Error: TLE

Fixed submission:

from copy import deepcopy
from collections import deque

# 最短にする
# 0回以上でたどり着けるのでスタート=ゴールのことがある ふざけんな
h, w = map(int, input().split())
table = [[] for _ in range(h)]
for i in range(h):
    table[i] = list(input())


def bfs(y, x, t):
    steps = [0, 1, 0, -1, 0]
    queue = deque([[y, x]])
    arr = []
    while len(queue) > 0:
        cur_y, cur_x = queue.popleft()
        for i in range(4):
            next_y, next_x = cur_y + steps[i], cur_x + steps[i + 1]
            if 0 <= next_y < h and 0 <= next_x < w:
                if t[next_y][next_x] == "G":
                    arr.append(t[cur_y][cur_x])
                    continue
                if t[next_y][next_x] == ".":
                    t[next_y][next_x] = t[cur_y][cur_x] + 1
                    queue.append([next_y, next_x])

    return 0 if len(arr) == 0 else min(arr) + 1


ans = 0
for sy in range(h):
    for sx in range(w):
        # table[sy][sx]をスタート地点とする
        if table[sy][sx] != ".":
            continue
        for gy in range(h):
            for gx in range(w):
                if sy == gy and sx == gx:
                    continue
                if table[gy][gx] == ".":
                    mytable = deepcopy(table)
                    mytable[sy][sx] = 0
                    mytable[gy][gx] = "G"
                    # ans = min(ans, bfs(sy, sx, mytable))
                    ret = bfs(sy, sx, mytable)
                    ans = max(ans, ret)

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

N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
A.sort()
MOD = 10**9 + 7


def combination(mod=MOD):
    fact = [1] * (N + 1)
    inv_fact = [1] * (N + 1)
    r = 1
    for i in range(1, N + 1):
        fact[i] = r = r * i % mod
    inv_fact[N] = r = pow(fact[N], mod - 2, mod)
    for i in range(N, 0, -1):
        inv_fact[i - 1] = r = r * i % mod

    def _wrapper(n, k):
        nonlocal fact, inv_fact, mod
        if n == 0 or k == 0:
            return 1
        return fact[n] * inv_fact[k] * inv_fact[n - k] % mod

    return _wrapper


def main():
    if K == 1:
        print(0)
        exit()
    comb = combination()
    sum_max = 0
    sum_min = 0
    for i, A_i in enumerate(A):
        if i >= K - 1:
            sum_max += comb(i, K - 1) * A_i % MOD
        if N - i >= K:
            sum_min += comb(N - i - 1, K - 1) * A_i % MOD
    ans = (sum_max - sum_min) % MOD
    print(ans)


if __name__ == "__main__":
    main()


Error: 0

Fixed submission:

MOD = 10**9 + 7

N, K = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
A.sort()
A_r = list(reversed(A))
factorial = {0: 1, 1: 1}
for i in range(2, N + 1):
    factorial[i] = factorial[i - 1] * i

ans = 0
for i, j in zip(A, A_r):
    if N < K:
        break
    C = (factorial[N - 1] / factorial[K - 1]) / factorial[N - K]
    ans += (j - i) * C
    ans %= MOD
    N -= 1
ans = int(ans % MOD)
print(ans)
Problem p02807 (Python) — buggy submission, verdict: Time Limit Exceeded

# https://atcoder.jp/contests/dwacon6th-prelims/submissions/9426910


def solve():
    MOD = 10**9 + 7

    N = int(input())
    xs = list(map(int, input().split()))

    ds = []
    for i in range(N - 1):
        d = xs[i + 1] - xs[i]
        ds.append(d)

    nums = [1, 1]
    num = 1
    for i in range(2, N - 1):
        num *= i
        num %= MOD
        nums.append(num)

    ms = [N - 1]
    m = N - 1
    for i in reversed(range(2, N - 1)):
        m *= i
        m %= MOD
        ms.append(m)
    ms.reverse()
    ms.append(1)

    ks = []
    k = 0
    for num, m in zip(nums, ms):
        k += num * m % MOD
        k %= MOD
        ks.append(k)

    ans = 0
    for d, k in zip(ds, ks):
        ans += d * k % MOD
        ans %= MOD

    print(ans)


solve()


Error: TLE

Fixed submission:

n = int(input())
x = list(map(int, input().split()))
mod = 10**9 + 7
X = []
for i in range(n - 1):
    X.append(x[i + 1] - x[i])
l, left = 1, [1]
for i in range(1, n - 1):
    l *= i
    l %= mod
    left.append(l)
r, right = 1, [1]
for i in range(n - 1, 1, -1):
    r *= i % mod
    right.append(r)
right.reverse()
f, flst = 0, []

for i, j in zip(left, right):
    f += i * j % mod
    f %= mod
    flst.append(f)
s = 0
for i, j in zip(X, flst):
    s += i * j % mod
print(s % mod)
Problem p02811 (Python) — buggy submission, verdict: Runtime Error

K, X = map(int, input().split())
print("Yes" if K * 500 >= X else "No")


Error: ValueError: invalid literal for int() with base 10: '2 900'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02811/Python/s360744826.py", line 3, in <module>
    N = int(input())
ValueError: invalid literal for int() with base 10: '2 900'


Fixed submission:

import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
permutation = list(itertools.permutations([x for x in range(1, N + 1)]))

a = permutation.index(P) + 1
b = permutation.index(Q) + 1
print(abs(a - b))
Problem p02811 (Python) — buggy submission, verdict: Runtime Error

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

if K * 500 >= X:
    print("Yes")
else:
    print("No")


Error: ValueError: invalid literal for int() with base 10: '2 900'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02811/Python/s761507450.py", line 1, in <module>
    K = int(input("Enter k: "))
ValueError: invalid literal for int() with base 10: '2 900'


Fixed submission:

K = int(input("Enter k: "))
X = int(input("Enter x: "))

if K * 500 >= X:
    print("Yes")
else:
    print("No")