Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import math
import collections

N, M = input().strip().split(' ')
N, M = [int(N), int(M)]

#階乗
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

#素因数分解
def prime_factors(n):
    i = 2
    factors = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            factors.append(i)
    if n > 1:
        factors.append(n)
    return factors

C = collections.Counter(prime_factors(M))

res = 1
for c in C.items():
    #print(c[0], c[1])
    res *= combinations_count((c[1] + N - 1), c[1])

print(res % (1000000007))

Fixed submission:
N, M = [int(_) for _ in input().split()]

mod = 10 ** 9 + 7
MAX_N = 10 ** 5 + 100

#階乗
def calc_factorial(max_i):
    factorial = [1] * max_i
    for i in range(1, max_i):
        factorial[i] = (i * factorial[i - 1]) % mod
    return factorial

#素因数分解
def calc_factorization(n):
    factorization = {}
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            factorization[i] = 1
            n = n // i
            while n % i == 0:
                factorization[i] += 1
                n = n // i
    if n > 1:
        factorization[n] = 1
    return factorization

#組み合わせ
def comb(factorial, n, k, mod):
    a = factorial[n] % mod
    b = (factorial[k] * factorial[n - k]) % mod
    b_ = pow(b, mod - 2, mod)
    return (a * b_) % mod

C = calc_factorization(M)
#階乗を計算しておく
factorial = calc_factorial(MAX_N)

res = 1
for c in C.items():
    res *= comb(factorial, (c[1] + N - 1), c[1], mod) #combinations_count(factorial, (c[1] + N - 1), c[1], mod)

print(res % mod)
Buggy python submission (verdict: Runtime Error):
def main():
	H, W = map(int, input().split())
	S = [list(input()) for _ in range(H)]

	D = [[0]*H for j in range(W)]

	D[0][0] = 1
	L = [(0,0)]

	for k in range(2,H*W):
		L_next = []
		for l in L:
			w = l[0]
			h = l[1]
			#上
			if (0 < h):
				if ((0 == D[h-1][w]) and ('.'==S[h-1][w])):
					D[h-1][w] = k
					L_next.append((w,h-1))
			#左
			if (0 < w):
				if ((0 == D[h][w-1]) and ('.'==S[h][w-1])):
					D[h][w-1] = k
					L_next.append((w-1,h))
			#下
			if (h < (H - 1)):
				if ((0 == D[h+1][w]) and ('.'==S[h+1][w])):
					D[h+1][w] = k
					L_next.append((w,h+1))
			#右
			if (w < (W - 1)):
				if ((0 == D[h][w+1]) and ('.'==S[h][w+1])):
					D[h][w+1] = k
					L_next.append((w+1,h))
		L = L_next
		if (0 != D[H-1][W-1]):
			break
		if (not L):	#リストが空
			return -1

	return W*H - D[H-1][W-1] - 2

print(main())


Fixed submission:
def main():
	H, W = map(int, input().split())
	S = [list(input()) for _ in range(H)]

	D = [[0]*W for j in range(H)]

	D[0][0] = 1
	L = [(0,0)]

	#黒の数をカウント
	sum_black = 0
	for h in range(H):
		for w in range(W):
			if ('#'==S[h][w]):
				sum_black += 1

	for k in range(2,H*W):
		L_next = []
		for l in L:
			w = l[0]
			h = l[1]
			#上
			if (0 < h):
				if ((0 == D[h-1][w]) and ('.'==S[h-1][w])):
					D[h-1][w] = k
					L_next.append((w,h-1))
			#左
			if (0 < w):
				if ((0 == D[h][w-1]) and ('.'==S[h][w-1])):
					D[h][w-1] = k
					L_next.append((w-1,h))
			#下
			if (h < (H - 1)):
				if ((0 == D[h+1][w]) and ('.'==S[h+1][w])):
					D[h+1][w] = k
					L_next.append((w,h+1))
			#右
			if (w < (W - 1)):
				if ((0 == D[h][w+1]) and ('.'==S[h][w+1])):
					D[h][w+1] = k
					L_next.append((w+1,h))
		L = L_next
		if (0 != D[H-1][W-1]):
			break
		if (not L):	#リストが空
			return -1

	return W*H - D[H-1][W-1] - sum_black

print(main())
Buggy python submission (verdict: Runtime Error):
a=list(map(int, input()))

print(a.count(1))


Fixed submission:
a, b=map(int,input().split())
if a*b%2==0:
  print("Even")
else:
  print("Odd")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
q = (B＋A-3)//(A-1)
print(q)
  


Fixed submission:
A, B = map(int, input().split())
q = -((-B+1)//(A-1))
 
print(q)

Buggy python submission (verdict: Runtime Error):
 B = map(int, input().split())
q = (B-1)//(A-1)

print(q)

Fixed submission:
A, B = map(int, input().split())
q = -((-B+1)//(A-1))
 
print(q)
Buggy python submission (verdict: Runtime Error):
from sys import (stdin, stout)

CORR_TAB = {
  'A': 'T',
  'T': 'A',
  'G': 'C',
  'C': 'G'',
}

for line in stdin:
  stdout.write(CORR_TAB[line.strip()] + '\n')

Fixed submission:
from sys import (stdin, stdout)

CORR_TAB = {
  'A': 'T',
  'T': 'A',
  'G': 'C',
  'C': 'G',
}

for line in stdin:
  stdout.write(CORR_TAB[line.strip()] + '\n')
Buggy python submission (verdict: Runtime Error):
N = int(input())
num_list = [int(x) for x in input().split()]
max_x = 0
max_list = []
for i in range(N-1):
  n = num_list[i]
  n_next = num_list[i+1]

  if n >= n_next:
    max_x += 1
    if i == N-2:
      max_list.append(max_x)
  else:
    max_list.append(max_x)
    max_x = 0

print(max(max_list))

Fixed submission:
import sys
N = int(input())
num_list = [int(x) for x in input().split()]
max_x = 0
max_list = [0]
for i in range(N-1):
  n = num_list[i]
  n_next = num_list[i+1]

  if n >= n_next:
    max_x += 1
    if i == N-2:
      max_list.append(max_x)
  else:
    max_list.append(max_x)
    max_x = 0
print(max(max_list))
Buggy python submission (verdict: Runtime Error):
n = int(input())

else:
  print(int(n*(n-1)//2))

Fixed submission:
n = int(input())

print(int(n*(n-1)//2))

Buggy python submission (verdict: Runtime Error):
n = int(input)

print(n*(n-1)/2)

Fixed submission:
n = int(input())

print(int(n*(n-1)//2))
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int, input().split())
av = num =  a
n = 1
if num < b:
  n+=1
  num = num+av-1
elif num > b:
  pass
print(n)

Fixed submission:
a = str(input())#入力S
b = str(input())#入力T
#print(a[n])
#print(b[n])
x=0
for n in range(3):
  if a[n] == b[n]:
    x+=1
print(x)

Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int, input().split())
av = num =  a
n = 1
while num =< b:
  n+=1
  num = num+av-1
print(n)

Fixed submission:
a = str(input())#入力S
b = str(input())#入力T
#print(a[n])
#print(b[n])
x=0
for n in range(3):
  if a[n] == b[n]:
    x+=1
print(x)
Buggy python submission (verdict: Runtime Error):
import math

a,b = map(int, input().split())
av = num =  a
n = 1
while num =< b:
  n+=1
  num = num+av-1
print(n)

Fixed submission:
import math

a,b = map(int, input().split())
av = a
n = 0
num = 1
while num < b:
  n += 1
  num += av-1
print(n)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())

n_list = [input() for _ in range(n)]
m_list = [input() for _ in range(m)]

for i in n_list:
    for j in m_list:
        if j not in i:
            print("No")
            quit()
print("Yes")

Fixed submission:
a, b = map(int, input().split())

if a == b:
    print("Draw")
elif a == 1:
    print("Alice")
elif b == 1:
    print("Bob")
elif a > b:
    print("Alice")
else:
    print("Bob")
Buggy python submission (verdict: Time Limit Exceeded):
k, s = map(int, input().split())

count = 0

for x in range(k+1):
    for y in range(k+1):
        for z in range(k+1):
            if x + y + z == s:
                count += 1

print(count)


Fixed submission:
k, s = map(int, input().split())

count = 0

for x in range(k+1):
    for y in range(k+1):
        z = s - x - y
        if 0 <= z <= k:
            count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
numbers = input().split()
if(numbers[0]*numbers[1] < numbers[2]):
  ans = numbers[0]*numbers[1]
else:
  ans = number[2]

print(ans)

Fixed submission:
numbers = input().split()
if(int(numbers[0])*int(numbers[1]) < int(numbers[2])):
  ans = int(numbers[0])*int(numbers[1]) 
else:
  ans = int(numbers[2])
 
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = 0
for i in range(N):
    A = A + 1 / input()
return A

print(1 / A)


Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ph = []
p =  1
for i in range(N):
    p *= A[i]
for i in range(N):
    ph.append(p / A[i])
ph_sum = sum(ph)
print(p / ph_sum)
Buggy python submission (verdict: Runtime Error):
"""#自分で考えたやつ
N, M = map(int, input().split())
AB = []
for i in range(N):
    a, b =  (int(x) for x in input().split())
    AB.append([a, b])
AB.sort(key=lambda x: x[1])

dic = {}
for i in range(M):
"""

import heapq

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

# 仕事の制約が厳しい順にリストに格納する
Blist = [[] for _ in range(M)]
for i in range(N):
    A, B = map(int, input().split())
    if A <= M: # AがMより大きいといつやっても間に合わない
        Blist[A-1].append(-B) # heapdを使うことを考慮して-倍しておく

ans = 0
q = [] # heapd.heapify(q)でリストのヒープ化ができるがここではlen(q)を使いたいためにしないでおく

# 可能な仕事をqに入れて扱う。その中でもBが最大(「-」倍しているのでここでは最小)のものを優先して取り出す。
for i in range(M):
    for b in Blist[i]: # ヒープ化されたリストqに2次元のBlistのi番目のリストの要素を全て入れる
        heapq.heappush(q, b)
    if len(q) > 0: # qに要素があるならば、qから最小の要素を取り出して(「-」倍してあるので)それを引き算する
        ans -= heapq.heappop(q)

print(ans)


Fixed submission:
A, B = map(int, input().split())

X = []
X.append(A+B)
X.append(A-B)
X.append(A*B)

X.sort()

print(X[2])

Buggy python submission (verdict: Runtime Error):
"""#自分で考えたやつ
N, M = map(int, input().split())
AB = []
for i in range(N):
    a, b =  (int(x) for x in input().split())
    AB.append([a, b])
AB.sort(key=lambda x: x[1])

dic = {}
for i in range(M):
"""

import heapd

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

# 仕事の制約が厳しい順にリストに格納する
Blist = [[] for _ in range(M)]
for i in range(N):
    A, B = map(int, input().split())
    if A <= M: # AがMより大きいといつやっても間に合わない
        Blist[A-1].append(-B) # heapdを使うことを考慮して-倍しておく

ans = 0
q = [] # heapd.heapify(q)でリストのヒープ化ができるがここではlen(q)を使いたいためにしないでおく

# 可能な仕事をqに入れて扱う。その中でもBが最大(「-」倍しているのでここでは最小)のものを優先して取り出す。
for  i in range(M):
    for b in Blist[i]: # ヒープ化されたリストqに2次元のBlistのi番目のリストの要素を全て入れる
        heapd.heappush(q, b)
    if len(q) > 0: # qに要素があるならば、qから最小の要素を取り出して(「-」倍してあるので)それを引き算する
        ans -= heapd.heappop(q)

print(ans)


Fixed submission:
A, B = map(int, input().split())

X = []
X.append(A+B)
X.append(A-B)
X.append(A*B)

X.sort()

print(X[2])

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
for i in range(N):
    s = str(input())
    s = ''.join(sorted(s))
    S.append(s)

count = 0
for i in range(N):
    Si = S[i]
    for k in range(N):
        if i==k:
            None
        else:
            Sk = S[k]
            if Sk == Si:
                count += 1

print(count / 2)


Fixed submission:
A, B = map(int, input().split())

X = []
X.append(A+B)
X.append(A-B)
X.append(A*B)

X.sort()

print(X[2])

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
for i in range(N):
    s = str(input())
    s = ''.join(sorted(a))
    S.append(s)

count = 0
for i in range(N):
    Si = S[i]
    for k in range(N):
        if i==k:
            None
        else:
            Sk = S[k]
            if Sk == Si:
                count += 1

print(count / 2)


Fixed submission:
A, B = map(int, input().split())

X = []
X.append(A+B)
X.append(A-B)
X.append(A*B)

X.sort()

print(X[2])
Buggy python submission (verdict: Runtime Error):
k, x = map(int, input().split())

a = list(range(x-(k-1), x+k)
print(*a)


Fixed submission:
k, x = map(int, input().split())

a = list(range(x-(k-1), x+k))
print(*a)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = []
for i in range(N):
    s = str(input())
    s = ''.join(sorted(a))
    S.append(s)

count = 0
for i in range(N):
    Si = S[i]
    for k in range(N):
        if i==k:
            None
        Sk = S[k]
        if Sk == Si:
            count += 1

print(count / 2)


Fixed submission:
"""自分で考えたやつ

N = int(input())
S = []
for i in range(N):
    s = str(input())
    s = ''.join(sorted(s))
    S.append(s)

count = 0
for i in range(N):
    Si = S[i]
    for k in range(N):
        if i==k:
            None
        else:
            Sk = S[k]
            if Sk == Si:
                count += 1

print(count / 2)
"""

N = int(input())
dic = {}
ans = 0

for i in range(N):
    s = ''.join(sorted(input()))
    if s in dic:
        ans += dic[s]
        dic[s] += 1
    else:
        dic[s] = 1
print(ans)
Buggy python submission (verdict: Runtime Error):
num = list(range(1, (int(input()-1))))

count = 0
for i in num:
    if len(str(i)) % 2 == 1:
        count += 1

print(count)


Fixed submission:
num = list(range(1, (int(input())+1)))

count = 0
for i in num:
    if len(str(i)) % 2 == 1:
        count += 1

print(count)

Buggy python submission (verdict: Runtime Error):
num = list(range(1, (int(input()-1))))

count = 0
for i in num:
    if len(str(i)) % 2 == 1:
        count += 1

print(count)


Fixed submission:
num = list(range(1, (int(input())+1)))

count = 0
for i in num:
    if len(str(i)) % 2 == 1:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(max(a+b,a-b,a*b))


Fixed submission:
l=list(map(int,input().split()))
a=l[0]
b=l[1]
print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Runtime Error):
b=input()
if b==A:
  print(T)
elif b==T:
  print(A)
elif b==G:
  print(C)
elif b==C:
  print(G)
  

Fixed submission:
b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
elif b=="C":
  print("G")

Buggy python submission (verdict: Runtime Error):
b=input()
if b==A:
  print(T)
elif b==T:
  print(A)
elif b==G:
  print(C)
else:
  print(G)
  

Fixed submission:
b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
elif b=="C":
  print("G")

Buggy python submission (verdict: Runtime Error):
b=input()
if b==A:
  print(T)
elif b==T:
  print(A)
elif b==G:
  print(C)
else b==C:
  print(G)
  

Fixed submission:
b=input()
if b=="A":
  print("T")
elif b=="T":
  print("A")
elif b=="G":
  print("C")
elif b=="C":
  print("G")
Buggy python submission (verdict: Runtime Error):
s=input():str
s=s.split(" ")
A,B=s[0],s[1]
kuti=1
c=0
while kuti<B:
    kuti+=(A-1)
    c+=1

Fixed submission:
hare="S"
kumori="C"
ame="R"
S=input()
T=input()
c=0
for i,s in enumerate(S):
    if s==T[i]:
        c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
import math

inputs = [int(i) for i in input().split()]

counter = 0

a = inputs[0]
b = inputs[1]
c = inputs[2]
d = inputs[3]

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

l = lcm(c, d)

c1 = b // c
c2 = (a-1) // c
c3 = c1 - c2

d1 = b // d
d2 = (a-1) // d
d3 = d1 - d2

l1 = b // l

ans = (b-a+1) - (c3 + d3 - l1)
print(ans)

Fixed submission:
import fractions

inputs = [int(i) for i in input().split()]

a = inputs[0]
b = inputs[1]
c = inputs[2]
d = inputs[3]

def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)

l = lcm(c, d)

c1 = b // c
c2 = (a-1) // c
c3 = c1 - c2

d1 = b // d
d2 = (a-1) // d
d3 = d1 - d2

l1 = b // l
l2 = (a-1) // l
l3 = l1 - l2

ans = (b-a+1) - (c3 + d3 - l3)
print(ans)
Buggy python submission (verdict: Runtime Error):
il = list(map(int,input().split()))

k = il[0]
x = il[1]

minusLimit = x - k + 1
plusLimit = x + k - 1

i = minusLimit

while minusLimit <= i <= pulusLimit :
  str = i + " "
str[:-1]
print(str)

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

k = il[0]
x = il[1]

minusLimit = x - k + 1
plusLimit = x + k - 1

i = minusLimit

s = ""

while minusLimit <= i <= plusLimit :
  s =  s + str(i) + " "
  i = i + 1
s[:-1]
print(s)
Buggy python submission (verdict: Runtime Error):
s = input().split()
t = input().split()
count = 0

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

Fixed submission:
s = list(input())
t = list(input())
count = 0

for i in range (0,3):
    if s[i] == t[i]:
        count = count + 1
print (count)
Buggy python submission (verdict: Runtime Error):
import collections
from scipy.special import comb
N = int(input())
S = [input() for i in range(N)]
# print(S)
S_new = []
for s in S:
    S_new.append(''.join(sorted(s)))
# print(S_new)
c = collections.Counter(S_new)
# print(c)
cnt = 0
for num in c.values():
    if num > 1:
        if num == 2:
            cnt += 1
        else:
            cnt += comb(num, 2, exact=True)# a = comb(n, r)
print(cnt)

Fixed submission:
import collections
from operator import mul
from functools import reduce

def comb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N = int(input())
S = [input() for i in range(N)]
# print(S)
S_new = []
for s in S:
    S_new.append(''.join(sorted(s)))
# print(S_new)
c = collections.Counter(S_new)
# print(c)
cnt = 0
for num in c.values():
    if num > 1:
        if num == 2:
            cnt += 1
        else:
            cnt += comb(num, 2)# a = comb(n, r)
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]

a = np.array(a)
max_a = np.max(a)
max_idx = np.where(a == max_a)[0]

if len(max_idx) != 1:
    for i in range(N):
        print(max_a)
else:
    premax_a = np.max(np.hstack((a[0:max_idx[0]], a[max_idx[0]+1:])))
    for i in range(N):
        if i == max_idx:
            print(premax_a)
        else:
            print(max_a)

Fixed submission:
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]

# a = np.array(a)
max_a = np.max(a)
premax_a = np.sort(a)[::-1][1]

for i in range(N):
    if a[i] == max_a:
        print(premax_a)
    else:
        print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]

a = np.array(a)
max_a = np.max(a)
max_idx = np.where(a == max_a)[0]
if len(max_idx) > 1:
    for i in range(N):
        print(max_a)
else:
    premax_a = np.max(np.hstack((a[0:max_idx[0]], a[max_idx[0]+1:])))
    for i in range(N):
        if i == max_idx:
            print(premax_a)
        else:
            print(max_a)

Fixed submission:
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]

# a = np.array(a)
max_a = np.max(a)
premax_a = np.sort(a)[::-1][1]

for i in range(N):
    if a[i] == max_a:
        print(premax_a)
    else:
        print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]

a = np.array(a)
max_a = np.max(a)
max_idx = np.where(a == max_a)[0]
if len(max_idx) > 1:
    for i in range(N):
        print(max_a)
else:
    premax_a = np.max(a[a<max_a])
    for i in range(N):
        if i == max_idx:
            print(premax_a)
        else:
            print(max_a)



Fixed submission:
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]

# a = np.array(a)
max_a = np.max(a)
premax_a = np.sort(a)[::-1][1]

for i in range(N):
    if a[i] == max_a:
        print(premax_a)
    else:
        print(max_a)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]
max_a = np.max(a)
for i in range(N):
    if a[i] != max_a:
        print(max_a)
    else:
#         print(i)
#         print(a[0:i]+a[i+1:])
        premax_a = np.max(a[0:i]+a[i+1:]) 
        print(premax_a)

Fixed submission:
import numpy as np
N = int(input())
a = [int(input()) for i in range(N)]

# a = np.array(a)
max_a = np.max(a)
premax_a = np.sort(a)[::-1][1]

for i in range(N):
    if a[i] == max_a:
        print(premax_a)
    else:
        print(max_a)
Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

if L <= 2019 and 2019 <= R:
    ans = 0

else:
    ans = 2019
    for i in range(L, R):
        for j in range(L+1, R+1):
            if (i % 2019 == 0) or (j % 2019 == 0):
                ans = 0
                break
            tmp = (i*j) % 2019
            if tmp <= ans:
                ans = tmp

print(ans)

Fixed submission:
import sys

L, R = map(int, input().split())

if L <= 2019 and 2019 <= R:
    ans = 0

else:
    ans = 2019
    for i in range(L, R):
        for j in range(L+1, R+1):
            if (i % 2019 == 0) or (j % 2019 == 0):
                ans = 0
                print(ans)
                sys.exit()
            tmp = (i*j) % 2019
            if tmp <= ans:
                ans = tmp
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

if L <= 2019 and 2019 <= R:
    ans = 0

else:
    ans = 2019
    for i in range(L, R):
        for j in range(L+1, R+1):
#             print(i, j)
            tmp = (i*j) % 2019
            if tmp <= ans:
                ans = tmp
                if ans == 0:
                    break

print(ans)

Fixed submission:
import sys

L, R = map(int, input().split())

if L <= 2019 and 2019 <= R:
    ans = 0

else:
    ans = 2019
    for i in range(L, R):
        for j in range(L+1, R+1):
            if (i % 2019 == 0) or (j % 2019 == 0):
                ans = 0
                print(ans)
                sys.exit()
            tmp = (i*j) % 2019
            if tmp <= ans:
                ans = tmp
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L, R = map(int, input().split())

if L <= 2019 and 2019 <= R:
    ans = 0

else:
    ans = 2019
    for i in range(L, R):
        for j in range(L+1, R+1):
#             print(i, j)
            tmp = (i*j) % 2019
            if tmp <= ans:
                ans = tmp

print(ans)

Fixed submission:
import sys

L, R = map(int, input().split())

if L <= 2019 and 2019 <= R:
    ans = 0

else:
    ans = 2019
    for i in range(L, R):
        for j in range(L+1, R+1):
            if (i % 2019 == 0) or (j % 2019 == 0):
                ans = 0
                print(ans)
                sys.exit()
            tmp = (i*j) % 2019
            if tmp <= ans:
                ans = tmp
print(ans)
Buggy python submission (verdict: Runtime Error):
S = list(input())

if len(S) == 0:
    print('No')
else:
    c1 = (len(set(S)) == 2)

    m = list(set(S))[0]
    n = list(set(S))[1]

    m_c, n_c = 0, 0

    c2 = False

    if c1:
        for i in range(len(S)):
            if S[i] == m:
                m_c += 1
            else:
                n_c += 1
        if m_c == n_c:
            c2 = True

    if c1 and c2:
        print('Yes')
    else:
        print('No')

Fixed submission:
S = input()
S = list(S)

if len(set(S)) == 2:
    
    m = list(set(S))[0]
    n = list(set(S))[1]

    m_c, n_c = 0, 0
    c = False
    
    for i in range(len(S)):
        if S[i] == m:
            m_c += 1
        else:
            n_c += 1
            
    if m_c == n_c:
        c = True

    if c:
        print('Yes')
    else:
        print('No')

else:
    print('No')

Buggy python submission (verdict: Runtime Error):
S = list(input())

c1 = (len(set(S)) == 2)

m = list(set(S))[0]
n = list(set(S))[1]

m_c, n_c = 0, 0

c2 = False

if c1:
    for i in range(len(S)):
        if S[i] == m:
            m_c += 1
        else:
            n_c += 1
    if m_c == n_c:
        c2 = True
else:
    print('No')

if c1 and c2:
    print('Yes')
else:
    print('No')

Fixed submission:
S = input()
S = list(S)

if len(set(S)) == 2:
    
    m = list(set(S))[0]
    n = list(set(S))[1]

    m_c, n_c = 0, 0
    c = False
    
    for i in range(len(S)):
        if S[i] == m:
            m_c += 1
        else:
            n_c += 1
            
    if m_c == n_c:
        c = True

    if c:
        print('Yes')
    else:
        print('No')

else:
    print('No')

Buggy python submission (verdict: Runtime Error):
S = list(input())
c1 = (len(set(S)) == 2)
m = list(set(S))[0]
n = list(set(S))[1]
m_c, n_c = 0, 0
c2 = False
if c1:
    for i in range(len(S)):
        if S[i] == m:
            m_c += 1
        else:
            n_c += 1
    if m_c == n_c:
        c2 = True

if c1 and c2:
    print('Yes')
else:
    print('No')

Fixed submission:
S = input()
S = list(S)

if len(set(S)) == 2:
    
    m = list(set(S))[0]
    n = list(set(S))[1]

    m_c, n_c = 0, 0
    c = False
    
    for i in range(len(S)):
        if S[i] == m:
            m_c += 1
        else:
            n_c += 1
            
    if m_c == n_c:
        c = True

    if c:
        print('Yes')
    else:
        print('No')

else:
    print('No')