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

from collections import deque


def bfs(start):
    q = deque([[start]])
    visited = set()
    while q:
        path = q.popleft()
        i, j = path[-1]
        if (i, j) == (H - 1, W - 1):
            return path
        for di, dj in [(1, 0), (-1, 0), (0, 1), (0, -1)]:
            ni, nj = i + di, j + dj
            if (
                0 <= ni < H
                and 0 <= nj < W
                and field[ni][nj] != "#"
                and (ni, nj) not in visited
            ):
                q.append(path + [(ni, nj)])
                visited.add((ni, nj))


H, W = map(int, input().split())
field = [input() for _ in range(H)]
shortest_path = bfs((0, 0))
if shortest_path is None:
    print(-1)
    exit()
ans = 0
for i in range(H):
    for j in range(W):
        if field[i][j] == "." and (i, j) not in shortest_path:
            ans += 1
print(ans)


Error: TLE

Fixed submission:

from collections import deque


def bfs(start):
    q = deque([[start]])
    visited = set()
    while q:
        path = q.popleft()
        i, j = path[-1]
        if (i, j) == (H - 1, W - 1):
            return path
        for di, dj in [(1, 0), (-1, 0), (0, 1), (0, -1)]:
            ni, nj = i + di, j + dj
            if (
                0 <= ni < H
                and 0 <= nj < W
                and field[ni][nj] != "#"
                and (ni, nj) not in visited
            ):
                new_path = list(path) + [(ni, nj)]
                q.append(new_path)
                visited.add((i, j))


H, W = map(int, input().split())
field = [input() for _ in range(H)]
shortest_path = bfs((0, 0))
if shortest_path is None:
    print(-1)
    exit()
ans = 0
for i in range(H):
    for j in range(W):
        if field[i][j] == "." and (i, j) not in shortest_path:
            ans += 1
print(ans)
Problem p03437 (Python) — buggy submission, verdict: Time Limit Exceeded

# -*- coding: utf-8 -*-

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

max_num = 10**18 // X


if X % Y == 0:
    print(-1)
else:
    for i in range(max_num + 1):
        if i == 0:
            continue
        else:
            if (i * X) % Y != 0:
                print(i * X)
                break
            else:
                continue


Error: TLE

Fixed submission:

# -*- coding: utf-8 -*-

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

max_num = 10**18 // X

for i in range(max_num + 1):
    if i == 0:
        continue
    else:
        if (i * X) % Y != 0:
            print(i * X)
            break
        else:
            if i == (max_num + 1):
                print(-1)
            else:
                continue
Problem p03437 (Python) — buggy submission, verdict: Runtime Error

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


def gcd(a, b):
    return a if b == 0 else gcd(b, a % b)


def lcm(a, b):
    return a * b // gcd(a, b)


a = lcm(x, y) - x

print(-1 if a == 0 else a)


Error: 0

Fixed submission:

from functools import reduce

from math import gcd

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


def lcm(*numbers):
    def lcm(a, b):
        return (a * b) // gcd(a, b)

    return reduce(lcm, numbers, 1)


a = lcm(x, y) - x

print(-1 if a == 0 else a)
Problem p03437 (Python) — buggy submission, verdict: Runtime Error

# 8 = 2 * 2 * 2
# 6 = 2 * 3
x, y = map(int, (input().split()))

result = 0

if x % y == 0:
    result = -1
else:
    result = x


print(result)


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


Fixed submission:

# 8 = 2 * 2 * 2
# 6 = 2 * 3
x = int(input())
y = int(input())
result = 0

if x % y == 0:
    result = -1
else:
    result = x * 2


print(result)
Problem p03437 (Python) — buggy submission, verdict: Time Limit Exceeded

X, Y = map(int, input().split())
i = 1
if X % Y == 0:
    print(-1)
else:
    print(X)


Error: TLE

Fixed submission:

X, Y = map(int, input().split())
i = 1
if X % Y == 0:
    print(-1)
else:
    while True:
        if i % X == 0 and i % Y != 0:
            print(i)
            break
        else:
            i += 1
Problem p03437 (Python) — buggy submission, verdict: Time Limit Exceeded

x, y = [int(i) for i in input().split()]
if x % y == 0:
    print(-1)
else:
    i = 2
    while True:
        if i * x % y != 0:
            print(i * x)
            break
        i += 1


Error: TLE

Fixed submission:

x, y = [int(i) for i in input().split()]
if x % y == 0:
    print(-1)
else:
    i = 2
    while True:
        if i * x % y != 0:
            print(i * x)
            break
Problem p03437 (Python) — buggy submission, verdict: Time Limit Exceeded

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

if X % Y == 0:
    print(-1)
else:
    print(X)


Error: TLE

Fixed submission:

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

if X == Y:
    print(-1)
    exit()
x = 2
while True:
    if X * x % Y != 0:
        print(X * x)
        exit()
    x += 1
Problem p03438 (Python) — buggy submission, verdict: Runtime Error

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

x, y = 0, 0
for i in range(n):
    dif = b[i] - a[i]
    if dif > 0:
        x += dif // 2
    else:
        y += -dif

print("Yes" if x >= y else "No")


Error: 0

Fixed submission:

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

cnt_a, cnt_b = sum(a), sum(b)
ans = "No"
i = 0
cnt = 0
while cnt < cnt_b - cnt_a:
    if a[i] < b[i]:
        cnt += int((b[i] - a[i]) / 2 + 0.5)
    else:
        cnt += a[i] - b[i]
    i += 1
    if i == n:
        ans = "Yes"

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

import math
from queue import PriorityQueue


N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_sum = sum(A)
B_sum = sum(B)
diff = B_sum - A_sum
if diff < 0:
    print("No")
    exit()

cnt = 0
for a, b in zip(A, B):
    if a < b:
        cnt += math.ceil((b - a) / 2)

if cnt > diff:
    print("No")
else:
    print("Yes")


Error: TLE

Fixed submission:

from queue import PriorityQueue


N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_sum = sum(A)
B_sum = sum(B)
diff = B_sum - A_sum
if diff < 0:
    print("No")
    exit()

Aq = PriorityQueue()
Bq = PriorityQueue()
for a in A:
    Aq.put((a, a))
for b in B:
    Bq.put((b, b))

cnt = 0

while cnt <= diff and (not Aq.empty()) and (not Bq.empty()):
    _, a = Aq.get()
    _, b = Bq.get()
    if a < b:
        ne_a = a + 2
        ne_b = b + 1
        Aq.put((ne_a, ne_a))
        Bq.put((ne_b, ne_b))
        cnt += 1

if Aq.empty() and Bq.empty():
    print("Yes")
else:
    print("No")
Problem p03447 (Python) — buggy submission, verdict: Runtime Error

x, a, b = [int(input()) for i in range(3)]

print((x - a) % b)


Error: EOFError: EOF when reading a line
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03447/Python/s994669644.py", line 1, in <module>
    a, b, c, x = [int(input()) for i in range(4)]
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03447/Python/s994669644.py", line 1, in <listcomp>
    a, b, c, x = [int(input()) for i in range(4)]
EOFError: EOF when reading a line


Fixed submission:

a, b, c, x = [int(input()) for i in range(4)]
counter = 0

for rep1 in range(a + 1):
    for rep2 in range(b + 1):
        for rep3 in range(c + 1):
            if rep1 * 500 + rep2 * 100 + rep3 * 50 == x:
                counter += 1

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

A, B, C, x = [int(input()) for i in range(4)]
print(
    sum(
        500 * a + 100 * b + 50 * c == x
        for a in range(A + 1)
        for b in range(B + 1)
        for c in range(C + 1)
    )
)


Error: TypeError: judge() takes 2 positional arguments but 3 were given
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03448/Python/s426003175.py", line 18, in <module>
    if judge(i, j, k):
TypeError: judge() takes 2 positional arguments but 3 were given


Fixed submission:

x500 = int(input())
x100 = int(input())
x50 = int(input())
xxx = int(input())

i = 0
j = 0
k = 0


def judge(sum, xxx):
    sum = 500 * i + 100 * j + 50 * k
    return sum == xxx and sum <= 2000


count = 0
for i in range(x500):
    if judge(i, j, k):
        count += 1
    for j in range(x100):
        if judge(i, j, k):
            count += 1
        for k in range(x50):
            if judge(i, j, k):
                count += 1
print(count)
Problem p03448 (Python) — buggy submission, verdict: Runtime Error

a, b, c, x = map(int, [input() for i in range(4)])
count = 0
for i in range(min(x // 500, a) + 1):
    for j in range(min((x - i * 500) // 100, b) + 1):
        if x - i * 500 - j * 100 <= c * 50:
            count += 1
print(count)


Error: TypeError: unsupported operand type(s) for //: 'str' and 'int'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03448/Python/s960607681.py", line 6, in <module>
    for i in range(min(x // 500, a) + 1):
TypeError: unsupported operand type(s) for //: 'str' and 'int'


Fixed submission:

a = input()
b = input()
c = input()
x = input()
count = 0
for i in range(min(x // 500, a) + 1):
    for j in range(min((x - i * 500) // 100, b) + 1):
        if (x - i * 500 - j * 100) // 50 <= c:
            count += 1
print(count)
Problem p03448 (Python) — buggy submission, verdict: Runtime Error

A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            if i * 500 + j * 100 + k * 50 == X:
                count += 1

print(count)


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


Fixed submission:

X = int(input())
A, B, C = map(int, input().split())

price = 0
count = 0
for i in range(A + 1):
    for j in range(B + 1):
        for k in range(C + 1):
            price = i * 500 + j * 100 + k * 50
            if price == X:
                count += 1
            price = 0

print(count)
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

s = input().split()
a = int(s[0])
b = int(s[1])

if a % 2 == 0 or b % 2 == 0:
    print("Even")
else:
    print("Odd")


Error: TypeError: not all arguments converted during string formatting
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03455/Python/s883692144.py", line 5, in <module>
    if a % 2 == 0 or b % 2 == 0:
TypeError: not all arguments converted during string formatting


Fixed submission:

s = input().split()
a = s[0]
b = s[1]

if a % 2 == 0 or b % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

# Product
# シカのAtCoDeerくんは二つの正整数a,bを見つけました。aとbの席が偶数か奇数か判定してください。
# 1<a,b<10000
# a.bは整数

a, b = map(int, input().split())
x = int(a * b)
# print(a,b,x)

# 積が奇数なら"Odd"、偶数なら"Even"と表示
if x % 2 == 0:
    print("Even")
else:
    print("Odd")


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


Fixed submission:

# Product
# シカのAtCoDeerくんは二つの正整数a,bを見つけました。aとbの席が偶数か奇数か判定してください。
# 1<a,b<10000
# a.bは整数

a = int(input())
b = int(input())

# print(a,b,x)

# 積が奇数なら"Odd"、偶数なら"Even"と
if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

a, b = map(int, input().split())
if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")


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


Fixed submission:

n1 = int(input())
n2 = int(input())

s = n1 * n2

if s % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

t = input().split()
for i in range(len(t)):
    t[i] = int(t[i])

a = t[0]
b = t[1]

if (a * b) % 2 == 0:
    print("Even")
else:
    print("Odd")


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


Fixed submission:

a = int(input())
b = int(input())

c = a * b

if c % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

a, b = map(int, input().split())
ans = ["Even", "Odd"]
print(ans[(a * b) % 2])


Error: TypeError: list indices must be integers or slices, not float
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03455/Python/s996994010.py", line 3, in <module>
    print(ans[(a + b) / 2])
TypeError: list indices must be integers or slices, not float


Fixed submission:

a, b = map(int, input().split())
ans = [0, 1]
print(ans[(a + b) / 2])
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

class Solution:
    def isEven(self, a: int, b: int):
        if (a * b) % 2 == 0:
            print("Even")
        else:
            print("Odd")


if __name__ == "__main__":
    a, b = map(int, input().split())
    solution = Solution()
    solution.isEven(a, b)


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


Fixed submission:

class Solution:
    def isEven(self, a, b):
        if (a * b) % 2 == 0:
            print("Even")
        else:
            print("Odd")


if __name__ == "__main__":
    a, b = input(), input()
    solution = Solution()
    solution.isEven(a, b)
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

i = input()
sp = i.split()

multid = int(sp[0]) * int(sp[1])

if multid % 2 == 0:
    print("Even")
else:
    print("Odd")


Error: AttributeError: 'str' object has no attribute 'spint'. Did you mean: 'split'?
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03455/Python/s527332902.py", line 2, in <module>
    sp = i.spint()
AttributeError: 'str' object has no attribute 'spint'. Did you mean: 'split'?


Fixed submission:

i = input()
sp = i.spint()

multid = sp[0] * sp[1]

if multid % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

# 086A
# 入力値の積が偶数か奇数か


# 入力
a, b = map(int, input().split())

# 処理
x = a * b % 2

if x == 0:
    print("Even")
else:
    print("Odd")


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


Fixed submission:

# 入力
a = int(input())
b = int(input())

# 処理
if a * b % 2 == 0:
    answer = "Even"
else:
    answer = "Odd"

print(answer)
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

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

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")


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


Fixed submission:

from sys import stdin

a = stdin.readline().rstrip()
a = int(a)

b = stdin.readline().rstrip()
b = int(b)

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

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

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")


Error: AttributeError: 'map' object has no attribute 'split'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03455/Python/s771135942.py", line 1, in <module>
    a, b = list(map(int, input()).split())
AttributeError: 'map' object has no attribute 'split'


Fixed submission:

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

if a * b % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

num = input().split(" ")


sum = int(num[0]) * int(num[1])

if sum % 2 == 0:
    print("Even")
else:
    print("Odd")


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


Fixed submission:

num1 = int(input())
num2 = int(input())

sum = num1 * num2

if sum % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03455 (Python) — buggy submission, verdict: Runtime Error

# coding: utf-8

# １行の入力データを分割
data = input().split(" ")


a = int(data[0])
b = int(data[1])

mul = int(a * b)

if mul % 2 == 0:
    print("Even")
else:
    print("Odd")


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


Fixed submission:

a = int(input())
b = int(input())

mul = a * b

if mul % 2 == 0:
    print("Even")
else:
    print("Odd")
Problem p03457 (Python) — buggy submission, verdict: Runtime Error

N = int(input())
txy = [(0, 0, 0)] + [tuple(map(int, input().split())) for _ in range(N)]


for i in range(N):
    now = txy[i]
    next = txy[i + 1]
    root = abs(next[1] - now[1]) + abs(next[2] - now[2])
    time = next[0] - now[0]
    if time < root:
        print("No")
        break
    else:
        if time == root:
            pass
        else:
            if (time - root) % 2 != 0:
                print("No")
                break
else:
    if N == 1:
        root = txy[1][1] + txy[1][2]
        time = txy[1][0]
        if time < root:
            print("No")
        else:
            if (time - root) % 2 == 0:
                print("Yes")
            else:
                print("No")
    else:
        print("Yes")


Error: IndexError: tuple index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03457/Python/s888307883.py", line 6, in <module>
    root = abs(next[1] - now[1]) + abs(next[2] - now[2])
IndexError: tuple index out of range


Fixed submission:

N = int(input())
txy = [tuple() for _ in range(N)]
for i in range(N - 1):
    now = txy[i]
    next = txy[i + 1]
    root = abs(next[1] - now[1]) + abs(next[2] - now[2])
    time = next[0] - now[0]
    if time < root:
        print("No")
        break
    else:
        if time == root:
            pass
        else:
            if (time - root) % 2 != 0:
                print("No")
                break
else:
    print("Yes")
Problem p03465 (Python) — buggy submission, verdict: Time Limit Exceeded

n, arr, dp = int(input()), list(map(int, input().split())), 1
for a in arr:
    dp |= dp << a
ofs = (sum(arr) + 1) // 2
dp >>= ofs
print((dp & -dp).bit_length() + ofs - 1)


Error: TLE

Fixed submission:

from bisect import bisect_left
from collections import defaultdict
from itertools import accumulate

n = int(input())
arr = list(map(int, input().split()))
arr.sort()
sa = sum(arr)
lim = sa // 2
dp = defaultdict(int)
dp[0] = 1

for a in arr:
    # print(a, dp)
    ndp = dp.copy()
    for i, v in dp.items():
        if i + a <= lim:
            ndp[i + a] += v
    dp = ndp
    # print(a, dp)

dpk = list(dp.keys())
dpk.sort()
dpv = [dp[k] for k in dpk]
adp = list(accumulate(dpv))
k = 2 ** (n - 1)
j = bisect_left(adp, k)

# print(adp)
# print(k)

print(sa - dpk[j])
Problem p03469 (Python) — buggy submission, verdict: Runtime Error

s = str(input())
s = "2018/01" + s[7:10]
print(s)


Error: TypeError: 'str' object does not support item assignment
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03469/Python/s849843365.py", line 2, in <module>
    s[3] = "7"
TypeError: 'str' object does not support item assignment


Fixed submission:

s = str(input())
s[3] = "7"
print(s)
Problem p03469 (Python) — buggy submission, verdict: Runtime Error

s = input()
print(s.replace("2017", "2018"))


Error: TypeError: 'str' object does not support item assignment
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03469/Python/s767798189.py", line 2, in <module>
    s[:4] = "2018"
TypeError: 'str' object does not support item assignment


Fixed submission:

s = input()
s[:4] = "2018"
print(s)
Problem p03469 (Python) — buggy submission, verdict: Runtime Error

S = input()

S = S.replace("7", "8", 1)
print(S)


Error: TypeError: 'str' object does not support item assignment
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03469/Python/s675103813.py", line 3, in <module>
    S[3] = 8
TypeError: 'str' object does not support item assignment


Fixed submission:

S = input()

S[3] = 8
print(S)
Problem p03469 (Python) — buggy submission, verdict: Runtime Error

S = input()
S = S.replace("2017", "2018")
print(S)


Error: TypeError: 'str' object does not support item assignment
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03469/Python/s998798459.py", line 2, in <module>
    S[:4] = "2018"
TypeError: 'str' object does not support item assignment


Fixed submission:

S = input()
S[:4] = "2018"
print(S)
Problem p03469 (Python) — buggy submission, verdict: Runtime Error

S = str(input())
S = S.replace("2017", "2018", 1)
print(S)


Error: TypeError: replace() argument 1 must be str, not int
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03469/Python/s315077891.py", line 2, in <module>
    S = S.replace(2017, 2018, 1)
TypeError: replace() argument 1 must be str, not int


Fixed submission:

S = str(input())
S = S.replace(2017, 2018, 1)
print(S)
Problem p03469 (Python) — buggy submission, verdict: Runtime Error

S = input().split("/")
S[0] = "2018"
print("/".join(S))


Error: AttributeError: 'list' object has no attribute 'join'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03469/Python/s679354678.py", line 3, in <module>
    print(S.join("/"))
AttributeError: 'list' object has no attribute 'join'


Fixed submission:

S = input().split("/")
S[0] = "2018"
print(S.join("/"))
Problem p03469 (Python) — buggy submission, verdict: Runtime Error

S = input()
S = S[:3] + "8" + S[4:]
print(S)


Error: TypeError: 'str' object does not support item assignment
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p03469/Python/s780711657.py", line 2, in <module>
    S[3] = 8
TypeError: 'str' object does not support item assignment


Fixed submission:

S = input()
S[3] = 8
print(S)