alexjercan/bugnet huggingface dataset:
Problem p02913 (Python) — buggy submission, verdict: Runtime Error

from sys import stdin

N = int(stdin.readline().rstrip())
S = stdin.readline().rstrip()
dp = [[0] * (N + 1) for _ in range(N + 1)]
res = 0

for i in range(N - 1, -1, -1):
    for j in range(N - 1, i, -1):
        if S[i] == S[j]:
            dp[i][j] = dp[i + 1][j + 1] + 1
        res = max(res, min(j - i, dp[i][j]))

print(res)


Error: TypeError: '<' not supported between instances of 'tuple' and 'int'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02913/Python/s512048354.py", line 12, in <module>
    res = max(res, min(j - i, dp[i][j]))
TypeError: '<' not supported between instances of 'tuple' and 'int'


Fixed submission:

from sys import stdin

N = int(stdin.readline().rstrip())
S = stdin.readline().rstrip()
dp = [[0] * (N + 1) for _ in range(N + 1)]
res = 0

for i in range(N - 1, -1, -1):
    for j in range(N - 1, i, -1):
        if S[i] == S[j]:
            dp[i][j] = dp[i + 1][j + 1] + 1, dp[i][j]
        res = max(res, min(j - i, dp[i][j]))

print(res)
Problem p02913 (Python) — buggy submission, verdict: Time Limit Exceeded

n = int(input())
s = input()

dp = [[0] * (n + 1) for _ in range(n + 1)]

res = 0
for i in range(n - 1, -1, -1):
    for j in range(n - 1, i, -1):
        if s[i] == s[j]:
            dp[i][j] = dp[i + 1][j + 1] + 1
            # dp[i][j] = max(dp[i][j], dp[i + 1][j + 1] + 1)
        res = max(res, min(dp[i][j], j - i))
print(res)


Error: TLE

Fixed submission:

n = int(input())
s = input()

dp = [[0] * (n + 1) for _ in range(n + 1)]

res = 0
for i in range(n - 1, -1, -1):
    for j in range(n - 1, i, -1):
        if s[i] == s[j]:
            dp[i][j] = max(dp[i][j], dp[i + 1][j + 1] + 1)
        res = max(res, min(dp[i][j], j - i))
print(res)
Problem p02913 (Python) — buggy submission, verdict: Time Limit Exceeded

def Z_algorithm(s):
    n = len(s)
    Z = [0] * n  # z[i] = sum(s[0::n - i], s[i::n])
    Z[0] = n
    i, j = 1, 0
    while i < n:
        # 共通部分を見つけるパート
        while i + j < n and s[j] == s[i + j]:
            j += 1
        Z[i] = j

        if j == 0:
            i += 1
            continue
        # 計算の再利用パート
        # k + Z[k] < j なら再利用できる
        k = 1
        while k < j and k + Z[k] < j:
            Z[i + k] = Z[k]
            k += 1
        # k個先まで見たのでk個先にバトンを渡す
        i += k
        j -= k
    return Z


def solve(k):
    a = Z_algorithm(s[k:])
    ans = 0
    for i in range(n - k):
        ans = max(ans, min(i, a[i]))
    return ans


n, s = int(input()), input()
print(max(solve(i) for i in range(n)))


Error: TLE

Fixed submission:

import numpy as np


def Z_algorithm(s):
    n = len(s)
    Z = [0] * n  # z[i] = sum(s[0::n - i], s[i::n])
    Z[0] = n
    i, j = 1, 0
    while i < n:
        # 共通部分を見つけるパート
        while i + j < n and s[j] == s[i + j]:
            j += 1
        Z[i] = j

        if j == 0:
            i += 1
            continue
        # 計算の再利用パート
        # k + Z[k] < j なら再利用できる
        k = 1
        while k < j and k + Z[k] < j:
            Z[i + k] = Z[k]
            k += 1
        # k個先まで見たのでk個先にバトンを渡す
        i += k
        j -= k
    return Z


n, s = int(input()), input()
print(max((np.minimum(Z_algorithm(s[i:]), range(n - i))).max() for i in range(n)))
Problem p02913 (Python) — buggy submission, verdict: Time Limit Exceeded

def solve(n, s, d, MOD):
    ttt = [ord(c) - 97 for c in s]

    ttx = []
    c = 1
    for t in ttt[::-1]:
        ttx.append(t * c % MOD)
        c = c * d % MOD
    ttx.reverse()
    ttc = [0]
    for t in ttx:
        ttc.append((ttc[-1] + t) % MOD)

    l, r = 0, n
    while l < r:
        m = (l + r + 1) // 2
        if search(m, d, ttc, MOD):
            l = m
        else:
            r = m - 1

    return l


def search(w, d, ttc, MOD):
    appeared = []
    comparing = set()
    w2 = w * 2
    p = 1

    for i in range(w, n + 1):
        t = (ttc[i] - ttc[i - w]) * p % MOD
        if i >= w2:
            comparing.add(appeared[i - w2])
            if t in comparing:
                return True
        appeared.append(t)
        p = p * d % MOD

    return False


n = int(input())
s = input()
MOD = 10**9 + 7
print(min(solve(n, s, d, MOD) for d in (26, 29, 31)))


Error: TLE

Fixed submission:

def z_algorithm(s):
    n = len(s)
    prefix = [0] * n
    j = 0
    ret = 0
    for i in range(1, n):
        if i + prefix[i - j] < j + prefix[j]:
            prefix[i] = prefix[i - j]
        else:
            k = max(0, j + prefix[j] - i)
            while i + k < n and s[k] == s[i + k]:
                k += 1
            prefix[i] = k
            ret = max(ret, min(i, k))
            j = i
    return ret


n = int(input())
s = input()
print(max(z_algorithm(s[i:]) for i in range(n - 1)))
Problem p02915 (Python) — buggy submission, verdict: Runtime Error

# -*- coding: utf-8 -*-
import itertools

n = int(input())
print(len(list(itertools.product(range(1, n + 1), repeat=3))))


Error: ImportError: cannot import name 'combination_with_replacement' from 'itertools' (unknown location)
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02915/Python/s250145116.py", line 2, in <module>
    from itertools import combination_with_replacement
ImportError: cannot import name 'combination_with_replacement' from 'itertools' (unknown location)


Fixed submission:

# -*- coding: utf-8 -*-
from itertools import combination_with_replacement

n = int(input())
print(len(list(combination_with_replacement(n, 3))))
Problem p02915 (Python) — buggy submission, verdict: Runtime Error

N = int(input())

print(N * N * N)


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/p02915/Python/s074412118.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())

print(N * N * N)
Problem p02915 (Python) — buggy submission, verdict: Runtime Error

N = int(input())
print(N**3)


Error: TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02915/Python/s203905734.py", line 2, in <module>
    print(N**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Fixed submission:

N = input(int())
print(N**3)
Problem p02915 (Python) — buggy submission, verdict: Runtime Error

len = int(input())
print(len**3)


Error: TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02915/Python/s357662058.py", line 2, in <module>
    print(len**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Fixed submission:

len = input()
print(len**3)
Problem p02915 (Python) — buggy submission, verdict: Runtime Error

a = int(input())
print(a**3)


Error: TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02915/Python/s464353610.py", line 2, in <module>
    print(a**3)
TypeError: unsupported operand type(s) for ** or pow(): 'str' and 'int'


Fixed submission:

a = input()
print(a**3)
Problem p02916 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
ans = b[a[0] - 1]
for i in range(1, n):
    ans += b[a[i] - 1]
    if a[i] == a[i - 1] + 1:
        ans += c[a[i - 1] - 1]
print(ans)


Error: 0

Fixed submission:

n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
c = [int(i) for i in input().split()]
if len(c) == 1:
    print(sum(b) + sum(c))
else:
    print(sum(b) + sum(c) - c[a[n - 1] - 1])
Problem p02917 (Python) — buggy submission, verdict: Runtime Error

n = int(input())
B = list(map(int, input().split()))
ans = 0
ans += B[0]
for i in range(n - 2):
    if B[i] > B[i + 1]:
        ans += B[i + 1]
    else:
        ans += B[i]
ans += B[-1]
print(ans)


Error: 0

Fixed submission:

n = int(input())
B = list(map(int, input().split()))
ans = 0
ans += B[0]
for i in range(n - 2):
    if B[i] > B[i + 1]:
        ans += B[i + i]
    else:
        ans += B[i]
ans += B[-1]
print(ans)
Problem p02917 (Python) — buggy submission, verdict: Runtime Error

N = int(input())
B = [int(i) for i in input().split()][::-1]
ret = B[0] + B[N - 2]
for i in range(1, N - 1):
    ret += min(B[i - 1], B[i])
print(ret)


Error: WA

Fixed submission:

N = int(input())
B = [int(i) for i in input().split()][::-1]
#  N = 6
#  B = [0, 153, 10, 10, 23]
#  N = 3
#  B = [2, 5]
ans = 0
ans += B[1]  # A[1]
for i in range(0, N - 1):
    ans += min(B[i - 1], B[i])
print(ans)
Problem p02918 (Python) — buggy submission, verdict: Runtime Error

N, K = map(int, input().split())
S = input()
T = []

g = S[0]
cnt = 0
for s in S:
    if s == g:
        cnt += 1
    else:
        T.append(cnt)
        cnt = 1
        g = s
else:
    T.append(cnt)


t = len(T)
for k in range(K):
    t -= 2

if t <= 1:
    print(N - 1)
else:
    print(N - t)


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


Fixed submission:

N = int(input())

B = list(map(int, input().split()))
B.append(max(B[0], B[-1]))

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

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

class SegmentTree:
    """
    update, get を提供するSegmentTree

    Attributes
    ----------
    __n : int
        葉の数。2 ^ i - 1
    __dot :
        Segment function
    __e: int
        単位元
    __node: list
        Segment Tree
    """

    def __init__(self, A, dot, e):
        """
        Parameters
        ----------
        A : list
            対象の配列
        dot :
            Segment function
        e : int
            単位元
        """
        n = 2 ** (len(A) - 1).bit_length()
        self.__n = n
        self.__dot = dot
        self.__e = e
        self.__node = [e] * (2 * n)
        # for i in range(len(A)):
        #     self.__node[i + n] = A[i]
        # for i in range(n - 1, 0, -1):
        #     self.__node[i] = self.__dot(self.__node[2 * i], self.__node[2 * i + 1])

    def update(self, i, c):
        i += self.__n
        node = self.__node
        node[i] = c
        while i > 0:
            i //= 2
            node[i] = self.__dot(node[2 * i], node[2 * i + 1])

    def get(self, l, r):
        vl, vr = self.__e, self.__e
        l += self.__n
        r += self.__n
        while l < r:
            if l & 1:
                vl = self.__dot(vl, self.__node[l])
                l += 1
            l //= 2
            if r & 1:
                r -= 1
                vr = self.__dot(vr, self.__node[r])
            r //= 2
        return self.__dot(vl, vr)


def solve():
    N = int(input())
    P = map(int, input().split())
    plist = []
    for i, p in enumerate(P):
        plist.append((p, i))
    plist.sort(reverse=True)

    maxSeg = SegmentTree([-1] * N, max, -1)
    minSeg = SegmentTree([N] * N, min, N)

    cnt = 0
    for p, c in plist:
        l2 = maxSeg.get(0, c)
        l1 = -1 if l2 <= 0 else maxSeg.get(0, l2)

        r1 = minSeg.get(c + 1, N)
        r2 = N if r1 >= N - 1 else minSeg.get(r1 + 1, N)

        a = (l2 - l1) * (r1 - c)
        b = (r2 - r1) * (c - l2)
        cnt += p * (a + b)

        maxSeg.update(c, c)
        minSeg.update(c, c)

    print(cnt)


solve()


Error: TLE

Fixed submission:

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

leftMax = [0] * N
rightMax = [0] * N
leftMax[0] = P[0]
rightMax[-1] = P[-1]
for i in range(N - 1):
    leftMax[i + 1] = max(leftMax[i], P[i + 1])
    rightMax[N - 1 - (i + 1)] = max(rightMax[N - 1 - i], P[N - 1 - i])

ans = 0
for i in range(N):
    a, b, c, d = -1, -1, N, N
    p = P[i]
    if leftMax[i] != p:
        for L in range(i - 1, -1, -1):
            if P[L] > p:
                if b == -1:
                    b = L
                elif a == -1:
                    a = L
                else:
                    break
    if rightMax[i] != p:
        for R in range(i + 1, N):
            if P[R] > p:
                if c == N:
                    c = R
                elif d == N:
                    d = R
                else:
                    break
    left = (b - a) * (c - i)
    right = (d - c) * (i - b)
    ans += p * (left + right)

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

# https://atcoder.jp/contests/abc140/submissions/7411285
# 写経


def main():
    N = int(input())
    (*p,) = map(int, input().split())

    xtoi = [-1] * (N + 1)
    for i, x in enumerate(p):
        xtoi[x] = i

    L = [-1] * (N + 2)
    R = [N] * (N + 2)
    for i in range(N):
        L[i] = i - 1
        R[i] = i + 1

    iter_inds = iter(xtoi)
    next(iter_inds)

    ans = 0
    for x, ind in enumerate(iter_inds, start=1):
        # l2, ..., l1, ..., x, ..., r1, ..., r2
        # (l2,r1) or (l1,r2)
        l1 = L[ind]
        l2 = L[l1]
        r1 = R[ind]
        r2 = R[r1]
        ans += x * ((l1 - l2) * (r1 - ind) + (r2 - r1) * (ind - l1))
        L[r1] = l1
        R[l1] = r1
    print(ans)


if __name__ == "__main__":
    main()


Error: TLE

Fixed submission:

from bisect import bisect_left
import sys

input = sys.stdin.readline

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

pos = [[] for _ in range(n + 1)]
for ind, pp in enumerate(p):
    for j in range(pp + 1):
        pos[j].append(ind)

ans = 0
for i, pp in enumerate(p):
    ind = bisect_left(pos[pp], i)

    left = 1
    if ind - 1 >= 0:
        left = i - pos[pp][ind - 1]
    else:
        left = i + 1
    right = 0
    if ind + 1 < len(pos[pp]):
        i_right = pos[pp][ind + 1]
        right = 1
        if ind + 2 < len(pos[pp]):
            right = pos[pp][ind + 2] - i_right
        else:
            right = n - i_right

    # print(i, pp, left * right, left, right)
    ans += left * right * pp

    left = 0
    if ind - 1 >= 0:
        i_left = pos[pp][ind - 1]
        left = 1
        if ind - 2 >= 0:
            left = i_left - pos[pp][ind - 2]
        else:
            left = i_left + 1
    right = 1
    if ind + 1 < len(pos[pp]):
        right = pos[pp][ind + 1] - i
    else:
        right = n - i

    # print(i, pp, left * right, left, right)
    ans += left * right * pp

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

from heapq import heappush, heappop
from copy import deepcopy

n = int(input())
s = list(map(int, input().split()))

left = []
for e in s:
    heappush(left, -e)
mx = heappop(left)

made = []
heappush(made, mx)

for _ in range(n):
    made_nxt = deepcopy(made)
    tmp = []

    while made:
        made_val = heappop(made)
        while left and left[0] <= made_val:
            pp = heappop(left)
            tmp.append(pp)

        if not left:
            print("No")
            exit()

        left_val = heappop(left)
        heappush(made_nxt, left_val)

    made = made_nxt

    for e in tmp:
        heappush(left, e)

print("Yes")


Error: TLE

Fixed submission:

from bisect import bisect_left

n = int(input())
s = list(map(int, input().split()))

first = max(s)
made = [first]
s.remove(first)
s.append(0)
s.sort()

for _ in range(n):
    made_now = []
    for e in made:
        i = bisect_left(s, e)
        make = s.pop(i - 1)
        if make == 0:
            print("No")
            exit()
        made_now.append(make)

    made += made_now

print("Yes")
Problem p02920 (Python) — buggy submission, verdict: Time Limit Exceeded

from heapq import heappush, heappop
from copy import deepcopy


def main():
    n = int(input())
    s = list(map(int, input().split()))

    left = []
    for e in s:
        heappush(left, -e)
    mx = heappop(left)

    made = []
    heappush(made, mx)

    for _ in range(n):
        made_prev = deepcopy(made)
        tmp = []

        while made_prev:
            made_val = heappop(made_prev)
            while left and left[0] <= made_val:
                pp = heappop(left)
                tmp.append(pp)

            if not left:
                print("No")
                exit()

            left_val = heappop(left)
            heappush(made, left_val)

        for e in tmp:
            heappush(left, e)

    print("Yes")


if __name__ == "__main__":
    main()


Error: TLE

Fixed submission:

from heapq import heappush, heappop
from copy import deepcopy

n = int(input())
s = list(map(int, input().split()))

left = []
for e in s:
    heappush(left, -e)
mx = heappop(left)

made = []
heappush(made, mx)

for _ in range(n):
    made_prev = deepcopy(made)
    tmp = []

    while made_prev:
        made_val = heappop(made_prev)
        while left and left[0] <= made_val:
            pp = heappop(left)
            tmp.append(pp)

        if not left:
            print("No")
            exit()

        left_val = heappop(left)
        heappush(made, left_val)

    for e in tmp:
        heappush(left, e)

print("Yes")
Problem p02921 (Python) — buggy submission, verdict: Runtime Error

def main(S, T):
    count = 0

    for i in range(len(S)):
        if T[i] == S[i]:
            count += 1

    return count


if __name__ == "__main__":
    S = input()
    T = input()
    print(main(S, T))


Error: ValueError: not enough values to unpack (expected 2, got 1)
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s746445364.py", line 12, in <module>
    S, T = map(str, input().split())
ValueError: not enough values to unpack (expected 2, got 1)


Fixed submission:

def main(S, T):
    count = 0

    for i in range(len(S)):
        if T[i] == S[i]:
            count += 1

    return count


if __name__ == "__main__":
    S, T = map(str, input().split())
    print(main(S, T))
Problem p02921 (Python) — buggy submission, verdict: Runtime Error

S = list(input())
T = list(input())

i = 0
ans_cnt = 0

while i < len(S):
    if S[i] == T[i]:
        ans_cnt += 1
    i += 1

print(ans_cnt)


Error: IndexError: list index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s479288383.py", line 9, in <module>
    if S[i] == T[i]:
IndexError: list index out of range


Fixed submission:

S = list(input())
T = list(input())

i = 0
ans_cnt = 0

while i < len(S):
    i += 1
    if S[i] == T[i]:
        ans_cnt += 1

print(ans_cnt)
Problem p02921 (Python) — buggy submission, verdict: Runtime Error

def main():
    s = list(input())
    t = list(input())
    assert len(s) == len(t)
    res = 0
    for i, ss in enumerate(s):
        if ss == t[i]:
            res += 1
    print(res)


if __name__ == "__main__":
    main()


Error: TypeError: main() missing 2 required positional arguments: 's' and 't'
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s322260042.py", line 13, in <module>
    main()
TypeError: main() missing 2 required positional arguments: 's' and 't'


Fixed submission:

def main(s, t):
    s = list(input())
    t = list(input())
    assert len(s) == len(t)
    res = 0
    for i, ss in enumerate(s):
        if ss == t[i]:
            res += 1
    return res


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

s = list(input())
t = list(input())

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1

print(ans)


Error: IndexError: list index out of range
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s694576581.py", line 6, in <module>
    if s[i] == t[i]:
IndexError: list index out of range


Fixed submission:

s = input().split()
t = input().split()

ans = 0
for i in range(3):
    if s[i] == t[i]:
        ans += 1

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

s = input()
t = input()
print(sum(s[i] == t[i] for i in range(3)))


Error: ValueError: too many values to unpack (expected 2)
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02921/Python/s393555435.py", line 1, in <module>
    s, t = input()
ValueError: too many values to unpack (expected 2)


Fixed submission:

s, t = input()
print(sum(s[i] == t[i] for i in range(3)))
Problem p02922 (Python) — buggy submission, verdict: Runtime Error

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

if B == 1:
    print(0)
else:
    C = A
    cnt = 1
    while C < B:
        C += A - 1
        cnt += 1
    print(cnt)


Error: 0

Fixed submission:

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

if B == 1:
    print(0)
else:
    C = A
    cnt = 1
    while C < B:
        C += A - 1
        cnt += 1

print(cnt)
Problem p02922 (Python) — buggy submission, verdict: Runtime Error

lst = [int(x) for x in input().split()]
A = lst[0]
B = lst[1]

if B >= 2:
    m = 0
    while (A - 1) * m + 1 < B:
        m += 1
    print(m)

if B == 1:
    print(0)


Error: EOFError: EOF when reading a line
Traceback (most recent call last):
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02922/Python/s688512487.py", line 2, in <module>
    List = [input() for i in range(1)]
  File "/home/alex/Documents/bug-detection/input/Project_CodeNet/data/p02922/Python/s688512487.py", line 2, in <listcomp>
    List = [input() for i in range(1)]
EOFError: EOF when reading a line


Fixed submission:

S = input()
List = [input() for i in range(1)]
T = List[0]

Slst = list(S)
Tlst = list(T)
M = 0

for x in range(3):
    if Slst[x] == Tlst[x]:
        M += 1
print(M)
Problem p02922 (Python) — buggy submission, verdict: Runtime Error

A = input().split()
count = 1
a = int(A[0])
b = int(A[1])
c = a

if b == 1:
    print(0)
else:
    while a < b:
        a += c - 1
        count += 1
        if a > b:
            break
    print(count)


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


Fixed submission:

A = int(input())
B = int(input())
count = 1

while A < B:
    A += A
    count += 1
    if A > B:
        break

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

def main():
    N = int(input())
    H = [int(x) for x in input().split()]
    ans = 0
    count = 0

    if N == 2:
        if H[0] >= H[1]:
            ans = 1
    elif N > 2:
        for i in range(1, N):
            j = i + 1
            if H[-i] <= H[-j]:
                count += 1
                if j == N:
                    if ans <= count:
                        ans = count
            else:
                if ans <= count:
                    ans = count
                count = 0
    print(ans)


if __name__ == "__main__":
    main()


Error: 0

Fixed submission:

def main():
    N = int(input())
    H = [int(x) for x in input().split()]
    ans = []
    count = 0
    if N > 2:
        for i in range(1, N):
            j = i + 1
            if H[-i] <= H[-j]:
                count += 1
            else:
                ans.append(count)
                count = 0
    elif N == 2:
        if H[0] >= H[1]:
            ans.append(1)
    elif N == 1:
        ans.append(1)

    print(max(ans))


if __name__ == "__main__":
    main()