Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import deque
K = int(input()) - 1
todo = deque(range(1, 10))
ans = []
counter = 0
while counter <= K:
    seed = todo.pop(0)
    ans.append(seed)
    counter += 1
    last_dig = int(str(seed)[-1])
    for i in range(max(0, last_dig-1), min(10, last_dig+2)):
        todo.append(int(str(seed) + str(i)))
print(ans[-1])

Fixed submission:
from collections import deque
counter = 0
todo = deque(range(1, 10))
ans = []
while counter < 10**5 + 500:
    seed = str(todo.popleft())
    ans.append(int(seed))
    counter += 1
    seed_last = seed[-1]
    for i in range(max(0, int(seed_last)-1), min(10, int(seed_last)+2)):
        todo.append(seed + str(i))

K = int(input())
print(ans[K-1])

Buggy python submission (verdict: Time Limit Exceeded):
K = int(input()) - 1
todo = list(range(1, 10))
ans = []
counter = 0
while counter <= K:
    seed = todo.pop(0)
    ans.append(seed)
    counter += 1
    last_dig = int(str(seed)[-1])
    for i in range(max(0, last_dig-1), min(10, last_dig+2)):
        todo.append(int(str(seed) + str(i)))
print(ans[-1])

Fixed submission:
from collections import deque
counter = 0
todo = deque(range(1, 10))
ans = []
while counter < 10**5 + 500:
    seed = str(todo.popleft())
    ans.append(int(seed))
    counter += 1
    seed_last = seed[-1]
    for i in range(max(0, int(seed_last)-1), min(10, int(seed_last)+2)):
        todo.append(seed + str(i))

K = int(input())
print(ans[K-1])
Buggy python submission (verdict: Runtime Error):
from math import sqrt
a, b, c = map(int, input().split())
if a + 2*sqrt(a)*sqrt(b) + b < c:
    print("Yes")
else:
    print("No")

Fixed submission:
from math import ceil

H, W = map(int, input().split())
if H == 1 or W == 1:
    print(1)
    exit()
even = ceil(H/2)
odd = H-even
ans = H*(W//2) + even*(W%2)

print(max(ans, 1))
Buggy python submission (verdict: Runtime Error):
from decimal import Decimal, getcontext
a, b, c = map(int, input().split())
getcontext().prec = 20
if Decimal(a).sqrt() + Decimal(b).sqrt() < Decimal(c).sqrt():
    print("Yes")
else:
    print("No")

Fixed submission:
N = int(input())
seed = "a"
alpha = "abcdefghij"


def dfs(string, mx_ind):
    if len(string) == N:
        print(string)
    else:
        for i in range(mx_ind + 1):
            dfs(string + alpha[i], mx_ind + 1 if i == mx_ind else mx_ind)


dfs("", 0)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
reverse = -1
S = list(input())
Q = int(input())
for _ in range(Q):
    Query = input().split()
    if Query[0] == "1":
        reverse *= -1
    else:
        if Query[1] == "1":
            if reverse == 1:
                S.append(Query[2])
            else:
                S.insert(0, Query[2])
        else:
            if reverse == 1:
                S.insert(0, Query[2])
            else:
                S.append(Query[2])

ans = "".join(S)
if reverse == 1:
    ans = ans[::-1]
print(ans)


Fixed submission:
from collections import deque
reverse = -1
S = deque(input())
Q = int(input())
for _ in range(Q):
    Query = input().split()
    if Query[0] == "1":
        reverse *= -1
    else:
        if Query[1] == "1":
            if reverse == 1:
                S.append(Query[2])
            else:
                S.appendleft(Query[2])
        else:
            if reverse == 1:
                S.appendleft(Query[2])
            else:
                S.append(Query[2])

ans = "".join(S)
if reverse == 1:
    ans = ans[::-1]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
reverse = -1
S = list(input())
Q = int(input())
for _ in range(Q):
    Query = input().split()
    if Query[0] == "1":
        reverse *= -1
    else:
        if Query[1] == "1":
            if reverse == 1:
                S.append(Query[2])
            else:
                S.insert(0, Query[2])
        else:
            if reverse == 1:
                S.insert(0, Query[2])
            else:
                S.append(Query[2])

ans = "".join(S)
if reverse == 1:
    ans = ans[::-1]
print(ans)


Fixed submission:
from collections import deque
reverse = -1
S = deque(input())
Q = int(input())
for _ in range(Q):
    Query = input().split()
    if Query[0] == "1":
        reverse *= -1
    else:
        if Query[1] == "1":
            if reverse == 1:
                S.append(Query[2])
            else:
                S.appendleft(Query[2])
        else:
            if reverse == 1:
                S.appendleft(Query[2])
            else:
                S.append(Query[2])

ans = "".join(S)
if reverse == 1:
    ans = ans[::-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
ans = {}
flg = False
for _ in range(M):
    s, c = map(int, input().split())
    if s == 1 and c == 0:
        if N == 1:
            flg = True
            ans[s] = c
        else:
            print(-1)
            exit()
    else:
        if s in ans.keys():
            if c != ans[s]:
                print(-1)
                exit()
        else:
            ans[s] = c
if flg:
    print(0)
else:
    if N >= 2:
        num = ["1"] + ["0"]*(N-1)
        for k, v in ans.items():
            num[k-1] = str(v)
        print("".join(num))
    else:
        print(ans[1])


Fixed submission:
N, M = map(int, input().split())
ans = {}
flg = False
for _ in range(M):
    s, c = map(int, input().split())
    if s == 1 and c == 0:
        if N == 1:
            flg = True
            ans[s] = c
        else:
            print(-1)
            exit()
    else:
        if s in ans.keys():
            if c != ans[s]:
                print(-1)
                exit()
        else:
            ans[s] = c
if flg:
    print(0)
else:
    if N >= 2:
        num = ["1"] + ["0"]*(N-1)
        for k, v in ans.items():
            num[k-1] = str(v)
        print("".join(num))
    else:
        if ans.keys():
            print(ans[1])
        else:
            print(0)
Buggy python submission (verdict: Time Limit Exceeded):
def sq(a, b, mod):  # aのb乗を剰余,kは初期値#20191116-D-Knight
    if b == 0:
        return 1
    elif b % 2 == 0:
        return sq(a, b // 2, mod)**2 % mod
    else:
        return sq(a, b - 1, mod) * a % mod


def nCk(n, k, mod=10 ** 9 + 7):
    x = max(k, n - k)
    y = min(k, n - k)
    kkai = 1
    for i in range(2, y + 1):
        kkai = (kkai * i) % mod
    nkkai = 1
    for i in range(x + 1, n + 1):
        nkkai = (nkkai * i) % mod
    answer = sq(kkai, mod - 2, mod) * nkkai % mod
    return answer
ans = 0
mod = 10**9+7

n, a, b = map(int, input().split())
for i in range(1, n+1):
    if i == a or i == b:
        continue
    ans += nCk(n, i)
    ans %= mod
print(ans)

Fixed submission:
def sq(a, b, mod):  # aのb乗を剰余,kは初期値#20191116-D-Knight
    if b == 0:
        return 1
    elif b % 2 == 0:
        return sq(a, b // 2, mod)**2 % mod
    else:
        return sq(a, b - 1, mod) * a % mod


def nCk(n, k, mod=10 ** 9 + 7):
    x = max(k, n - k)
    y = min(k, n - k)
    kkai = 1
    for i in range(2, y + 1):
        kkai = (kkai * i) % mod
    nkkai = 1
    for i in range(x + 1, n + 1):
        nkkai = (nkkai * i) % mod
    answer = sq(kkai, mod - 2, mod) * nkkai % mod
    return answer

mod = 10**9+7
n, a, b = map(int, input().split())

def modpow(x, y):
    res = 1
    while y > 0:
        if y & 1:
            res = res*x % (10**9+7)
        x = x*x%(10**9+7)
        y >>= 1
        y = int(y)
    return res
ans = 0
ans -= nCk(n, b)
ans -= nCk(n, a)
ans -= 1
ans += modpow(2, n)
print((ans+10**9+7)%(10**9+7))
Buggy python submission (verdict: Runtime Error):
N = int(input())
from collections import Counter
Sc = Counter([input() for _ in range(N)])
max_count = max(Sc.values())
ans = sorted([k for k, v in Sc.items() if v == max_count)])
print(*ans, sep="\n")

Fixed submission:
from collections import Counter
N = int(input())
Sc = Counter([input() for _ in range(N)]).most_common()
# print(Sc)
max_num = Sc[0][1]
ans = []
for key, val in Sc:
    if val == max_num:
        ans.append(key)
ans.sort()
for t in ans:
    print(t)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
plist = list(map(int, input().split()))
kitaiti = [(0.5*(p+1)) for p in plist]
ans = 0
for i in range(N-K+1):
    ans = max(ans, sum(kitaiti[i:i+K]))
print(ans)

Fixed submission:
import numpy as np
N, K = map(int, input().split())
plist = list(map(int, input().split()))
kitaiti = np.array([(0.5*(p+1)) for p in plist])
ans = 0
val = sum(kitaiti[:K])
ans = max(ans, val)
for i in range(1, N-K+1):
    # print(i-1, i+K)
    val -= kitaiti[i-1]
    val += kitaiti[i+K-1]
    ans = max(ans, val)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
plist = list(map(int, input().split()))
kitaiti = [sum(range(p+1))/p for p in plist]
ans = 0
for i in range(N-K+1):
    ans = max(ans, sum(kitaiti[i:i+K]))
print(ans)

Fixed submission:
import numpy as np
N, K = map(int, input().split())
plist = list(map(int, input().split()))
kitaiti = np.array([(0.5*(p+1)) for p in plist])
ans = 0
val = sum(kitaiti[:K])
ans = max(ans, val)
for i in range(1, N-K+1):
    # print(i-1, i+K)
    val -= kitaiti[i-1]
    val += kitaiti[i+K-1]
    ans = max(ans, val)
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
alist = list(map(int, input().split()))
left = 0
for i in range(1, N + 1):
    try:
        old_left = left
        left = alist[left:].index(i)
        p = left + old_left
    except ValueError:
        print(i, p)
        if i == 1:
            print(-1)
        else:
            print(N - i + (N - p))
        break
else:
    print(0)


Fixed submission:
N = int(input())
alist = list(map(int, input().split()))
now = 1
for a in alist:
    if a == now:
        now += 1
if now == 1:
    print(-1)
else:
    print(N - now + 1)
Buggy python submission (verdict: Runtime Error):
N = int(input())
Alist = list(map(int, input().split()))
abc = [0, 0, 0]
ans = 1
for i in range(N):
    A = Alist[i]
    ans = (ans * abc.count(A)) % (10**9 + 7)
    abc[abc.index(A)] += 1

print(ans)


Fixed submission:
N = int(input())
Alist = list(map(int, input().split()))
nums = [0, 0, 0]
ans = 1
for i in range(N):
    try:
        A = Alist[i]
        ans = (ans * nums.count(A)) % (10**9 + 7)
        nums[nums.index(A)] += 1
    except:
        print(0)
        break
else:
    print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
Dlist = list(map(int, input().split()))
DCounter = Counter(Dlist)
if DCounter[0] == 1 and Dlist[0] == 0:
    num = 1
    mae = 1
    for key, value in sorted(DCounter.items()[1:]):
        num *= (mae ** value)
        mae = value
        num %= 998244353
    print(num % 998244353)
else:
    print(0)


Fixed submission:
from collections import Counter
N = int(input())
Dlist = list(map(int, input().split()))
DCounter = Counter(Dlist)
if DCounter[0] == 1 and Dlist[0] == 0:
    num = 1
    for i in range(1, max(Dlist) + 1):
        num *= DCounter[i - 1] ** DCounter[i]

    print(num % 998244353)
else:
    print(0)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
Dlist = list(map(int, input().split()))
DCounter = Counter(Dlist)
if DCounter[0] == 1 and Dlist[0] == 0:
    num = 1
    mae = 1
    for key, value in sorted(Dlist.items()):
        num *= (mae ** value)
        mae = value
        num %= 998244353
    print(num % 998244353)
else:
    print(0)


Fixed submission:
from collections import Counter
N = int(input())
Dlist = list(map(int, input().split()))
DCounter = Counter(Dlist)
if DCounter[0] == 1 and Dlist[0] == 0:
    num = 1
    for i in range(1, max(Dlist) + 1):
        num *= DCounter[i - 1] ** DCounter[i]

    print(num % 998244353)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
dlist = list(map(int, input().split()))

all = 0
for i1, d1 in enumrate(dlist):
  for i2, d2 in enumrate(dlist):
    if i1 != i2:
      all += d1*d2

print(all)

Fixed submission:
N = int(input())
dlist = list(map(int, input().split()))

all = 0
for i1, d1 in enumerate(dlist):
  for d2 in dlist[i1+1:]:
    all += d1*d2

print(all)
Buggy python submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix
inf = float("inf")
N, M, L = map(int, input().split())
graph = np.zeros((N, N))
for _ in range(M):
    A, B, C = map(int, input().split())
    graph[A-1][B-1] = C
    graph[B-1][A-1] = C
shortest_paths = shortest_path(csr_matrix(graph), directed=False, method="WF")
graph = np.full((N, N), inf)
for i in range(N):
    for j in range(N):
        if shortest_paths[i][j] <= L:
            graph[i][j] = 1

Q = int(input())
def int_(num_str):
    return int(num_str) - 1

costs = shortest_path(csr_matrix(graph), directed=False, method="WF")
for _ in range(Q):
    s, t = map(int_, input().split())
    print(int(costs[s][t])-1 if costs[s][t] != inf else -1)

Fixed submission:
import numpy as np
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix
inf = float("inf")
N, M, L = map(int, input().split())
graph = np.zeros((N, N))
for _ in range(M):
    A, B, C = map(int, input().split())
    graph[A-1][B-1] = C
    graph[B-1][A-1] = C
shortest_paths = shortest_path(csr_matrix(graph), directed=False, method="D")
graph = np.full((N, N), inf)
for i in range(N):
    for j in range(N):
        if shortest_paths[i][j] <= L:
            graph[i][j] = 1

Q = int(input())
def int_(num_str):
    return int(num_str) - 1

costs = shortest_path(csr_matrix(graph), directed=False, method="D")
for _ in range(Q):
    s, t = map(int_, input().split())
    print(int(costs[s][t])-1 if costs[s][t] != inf else -1)

Buggy python submission (verdict: Runtime Error):
import numpy as np
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix
inf = float("inf")
N, M, L = map(int, input().split())
graph = np.zeros((N, N))
for _ in range(M):
    A, B, C = map(int, input().split())
    graph[A-1][B-1] = C
    graph[B-1][A-1] = C
shortest_paths = shortest_path(csr_matrix(graph), directed=False, method="D")
graph = np.full((N, N), inf)
for i in range(N):
    for j in range(N):
        if shortest_paths[i][j] <= L:
            graph[i][j] = 1

Q = int(input())
def int_(num_str):
    return int(num_str) - 1

costs = shortest_path(csr_matrix(graph), directed=False, method="D")
for _ in range(Q):
    s, t = map(int_, input().split())
    print(int(costs[s][t])-1 if costs[s][t] != inf else -1)

Fixed submission:
import numpy as np
from scipy.sparse.csgraph import shortest_path
from scipy.sparse import csr_matrix
inf = float("inf")
N, M, L = map(int, input().split())
graph = np.zeros((N, N))
for _ in range(M):
    A, B, C = map(int, input().split())
    graph[A-1][B-1] = C
    graph[B-1][A-1] = C
shortest_paths = shortest_path(csr_matrix(graph), directed=False, method="D")
graph = np.full((N, N), inf)
for i in range(N):
    for j in range(N):
        if shortest_paths[i][j] <= L:
            graph[i][j] = 1

Q = int(input())
def int_(num_str):
    return int(num_str) - 1

costs = shortest_path(csr_matrix(graph), directed=False, method="D")
for _ in range(Q):
    s, t = map(int_, input().split())
    print(int(costs[s][t])-1 if costs[s][t] != inf else -1)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N,K,Q = map(int,input().split())
Qlist = [int(input()) for _ in range(Q)]
Alist = np.full(N,K)
for i in Qlist:
    Alist[i-1]+=1
    Alist-=1
for A in Alist:
    print("Yes" if A>0 else "No")

Fixed submission:
import sys
from collections import Counter
input = sys.stdin.readline
N,K,Q = map(int,input().split())
QCounter = Counter([int(input()) for _ in range(Q)]).most_common()
defult_over = Q-K #突破に必要な正解数

if defult_over>=0:
    s = set()
    for win in QCounter:
        if win[1]>defult_over:
            s.add(win[0]-1)
    for i in range(N):
        if i in s:
            print("Yes")
        else:
            print("No")
else:
    for _ in range(N):
        print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = map(int, input().split())
Alist = np.array(list(map(int, input().split())), dtype=np.int64)
for _ in range(M):
    Alist[np.argmax(Alist)] //= 2
print(np.sum(Alist))


Fixed submission:
import heapq


def int_and_reverse(num):
    return int(num) * -1


N, M = map(int, input().split())
Alist = list(map(int_and_reverse, input().split()))
heapq.heapify(Alist)
for _ in range(M):
    x = (heapq.heappop(Alist) * -1) // 2
    heapq.heappush(Alist, -x)
print(-sum(Alist))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N, M = map(int, input().split())
Alist = np.array(list(map(int, input().split())))
for _ in range(M):
    Alist[np.argmax(Alist)] /= 2
print(np.sum(Alist.astype(np.int64)))


Fixed submission:
import heapq


def int_and_reverse(num):
    return int(num) * -1


N, M = map(int, input().split())
Alist = list(map(int_and_reverse, input().split()))
heapq.heapify(Alist)
for _ in range(M):
    x = (heapq.heappop(Alist) * -1) // 2
    heapq.heappush(Alist, -x)
print(-sum(Alist))

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N, M = map(int, input().split())
Alist = np.array(list(map(int, input().split())))
for _ in range(M):
    Alist[np.argmax(Alist)] /= 2
print(np.sum(Alist.astype(np.int64)))


Fixed submission:
import heapq


def int_and_reverse(num):
    return int(num) * -1


N, M = map(int, input().split())
Alist = list(map(int_and_reverse, input().split()))
heapq.heapify(Alist)
for _ in range(M):
    x = (heapq.heappop(Alist) * -1) // 2
    heapq.heappush(Alist, -x)
print(-sum(Alist))
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
c = Counter([sorted(input()) for _ in range(N)])
print(sum([(v*(v+1))//2 for v in c.values()]))

Fixed submission:
from collections import Counter
N = int(input())
slist = ["".join(sorted(list(input()))) for _ in range(N)]
c = Counter(slist)
ans = 0
for v in c.values():
    ans += sum(range(v))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
slist = [Counter(input()) for _ in range(N)]
ans = 0
checked = [False] * N
for i in range(N):
    c = 0
    if checked[i]:
        continue
    s = slist[i]
    checked[i] = True
    for j in range(i + 1, N):
        if slist[j] == s:
            c += 1
            checked[j] = True
    ans += sum(range(c + 1))
print(ans)

Fixed submission:
from collections import Counter
N = int(input())
slist = ["".join(sorted(list(input()))) for _ in range(N)]
c = Counter(slist)
ans = 0
for v in c.values():
    ans += sum(range(v))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
slist = [Counter(list(input())) for _ in range(N)]
counter = 0
for j in range(N):
    js = slist[j]
    for i in range(j):
        if js==slist[i]:
            counter += 1
print(counter)

Fixed submission:
from collections import Counter
N = int(input())
slist = ["".join(sorted(list(input()))) for _ in range(N)]
c = Counter(slist)
ans = 0
for v in c.values():
    ans += sum(range(v))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
N = int(input())
slist = [Counter(list(input())) for _ in range(N)]
counter = 0
for j in range(N):
    for i in range(j):
        if slist[j]==slist[i]:
            counter += 1

print(counter)

Fixed submission:
from collections import Counter
N = int(input())
slist = ["".join(sorted(list(input()))) for _ in range(N)]
c = Counter(slist)
ans = 0
for v in c.values():
    ans += sum(range(v))
print(ans)
Buggy python submission (verdict: Runtime Error):
N = map(int, input().split())
alist = list(map(int, input().split()))
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    divisors.sort()
    return divisors

balls_multiple = [0] * N
ans = []
for num in range(N-1, -1, -1):
    if balls_multiple[num] % 2 != alist[num]:
        ans.append(num+1)
        for div in make_divisors(num+1):
            balls_multiple[div-1] += 1
if ans:
    print(len(ans))
    print(*sorted(ans))
else:
    print(0)


Fixed submission:
N = int(input())
alist = list(map(int, input().split()))
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    divisors.sort()
    return divisors

balls_multiple = [0] * N
ans = []
for num in range(N-1, -1, -1):
    if balls_multiple[num] % 2 != alist[num]:
        ans.append(num+1)
        for div in make_divisors(num+1):
            balls_multiple[div-1] += 1
if ans:
    print(len(ans))
    print(*sorted(ans))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
L, R = map(int, input().split())
mod = 2019
ans = 10**9 + 7
for i in range(L, min(L + mod, R)):
  for j in range(i + 1, min(i + mod, R)):
    ans = min((i * J) % mod, ans)
print(ans)

Fixed submission:
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, min(L + 2019, R + 1)):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, R):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)


Fixed submission:
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, min(L + 2019, R + 1)):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
input = stdin.readline
L, R = map(int, input().split())
min_mod = 2020
for i in range(L, R):
    for j in range(i + 1, R + 1):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)


Fixed submission:
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, min(L + 2019, R + 1)):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, R):
    for j in range(i + 1, R + 1):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)


Fixed submission:
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, min(L + 2019, R + 1)):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, R):
    for j in range(i + 1, R + 1):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)


Fixed submission:
L, R = map(int, input().split())
min_mod = 10**9
for i in range(L, min(L + 2019, R + 1)):
    for j in range(i + 1, min(L + 2019, R + 1)):
        min_mod = min(min_mod, (i * j) % 2019)
print(min_mod)
Buggy python submission (verdict: Runtime Error):
S = list(input())
s = set(S)
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
    print("Bad")
else:
    print("Good")

Fixed submission:
s = list(input())
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
    print("Bad")
else:
    print("Good")