TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l, r = map(int, input().split())

l = l%2019
r = r%2019

list_score = []
for i in range(l+1, r+1):
    for j in range(l+1, r+1):
        list_score.append(i*j%2019)
        print(i*j%2019)

print(int(min(list_score)))


l, r = map(int, input().split())

l = l%2019
r = r%2019

if l > r:
    r += 2019

list_score = []
for i in range(l+1, r+1):
    for j in range(i, r+1):
        list_score.append(i*j%2019)

print(int(min(list_score)))

l, r = map(int, input().split())

l = l%2019
r = r%2019

if l > r:
    r += 2019

# print(l, r)

list_score = []
for i in range(l, r+1):
    for j in range(i+1, r+1):
        print(i, j)
        list_score.append(i*j%2019)
# print(list_score)
print(int(min(list_score)))

l, r = map(int, input().split())

l = l%2019
r = r%2019

list_score = []
for i in range(l+1, r+1):
    for j in range(i, r+1):
        list_score.append(i*j%2019)

print(int(min(list_score)))

l, r = map(int, input().split())

l = l%2019
r = r%2019

if l == 0 or r == 0 :
    print(0)
    exit()

if l > r:
    r += 2019

# print(l, r)

list_score = []
for i in range(l+1, r+1):
    for j in range(l, j):
        # print(i, j)
        list_score.append(i*j%2019)
# print(list_score)
print(int(min(list_score)))

l, r = map(int, input().split())

if r-l>=2019 :
    print(0)
    exit()

l = l%2019
r = r%2019

if l == 0 or r == 0 :
    print(0)
    exit()

if l > r:
    r += 2019

# print(l, r)

list_score = []
for i in range(l+1, r+1):
    for j in range(l, i):
        # print(i, j)
        list_score.append(i*j%2019)
# print(list_score)
print(int(min(list_score)))

Verdicts: Runtime Error

Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
l = L % 2019
r = R % 2019
min = 2018
if l == 0 or r == 0:
  min = 0
else:
  for i in range(l, r):
    for j in range(i+1,r+1):
      print(i,j)
      mod = (i*j) % 2019
      if mod < min:
        min = mod
print(min)

L, R = map(int, input().split())
l = L % 2019
r = R % 2019
min = 2018
if l == 0 or r == 0:
  min = 0
else:
  for i in range(l, r):
    for j in range(i+1,r+1):
      print(i,j)
      mod = (i*j) % 2019
      if mod < min:
        min = mod
print(min)

L, R = map(int, input().split())
l = L % 2019
r = R % 2019
if r < l:
  l, r = r, l
min = 2018
if R-L > 2019:
  min = 0
elif l == 0 or r == 0:
  min = 0
else:
  for i in range(l, r):
    for j in range(i+1,r+1):
      mod = (i*j) % 2019
      if mod < min:
        min = mod
print(min)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:
    ret = 2020
    for i in range(l,r+1,1):
        for j in range(l,r+1,1):
            ret = min(ret,(i*j)%2019)

print(ret)


l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:
    ret = 2020
    for i in range(l,r+1,1):
        for j in range(l,r+1,1):
            ret = min(ret,i*j%2019)

print(ret)


import itertools
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:
    ret = 2020
print(ret)


import itertools
l,r = map(int,input().split(" "))



import itertools
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:

    ret = 2020
    for i in itertools.combinations(range(l,r+1,1),2):
        ret = min(ret,(i[0]*i[1])%2019)
        print(i,ret)
print(ret)


import itertools
l,r = map(int,input().split(" "))

if r-l > 2019:
    print(0)
else:
    ret = 2020
    for i in itertools.combinations(range(l,r+1,1),2):
        ret = min(ret,(i[0]*i[1])%2019)
    print(ret)


Verdicts: Runtime Error

Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())

if R - L >= 2019:
    print(0)
else:
    mod = 2019
    for i in range(L, R+1):
        for j in range(i, R+1):
            m = i * j % 2019
            if m < mod:
                mod = m
    print(mod)

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

if R - L >= 2019:
    print(0)
else:
    mod = 2019
    for i in range(L, R+1):
        for j in range(i + 1, R+1):
            m = i * j % 2019
            if m < mod:
                mod = m
    print(mod)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
m = 2019
if R - L >= 2019:
  print(0)
else:
  m = 2019
  for i in range(R, L+1):
    m = min(m, i)
  if m == 0:
    print(0)
  else:
    if R % 2019 == m:
      print(m * (L % 2019) % 2019)
    else:
      print(m * (m+1) % 2019)
  
    

L, R = map(int, input().split())
m = 2019
if R - L >= 2019:
  print(0)
else:
  m=2019
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      m = min((i*j)%2019, m)
  print(m)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l, r = map(int, input().split())

if l%2019 >= r%2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    print((l%2019*r%2019)%2019)

l, r = map(int, input().split())

if l%2019 >= r%2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    h = []
    for i in range((r-l)%2019):
        for j in range(i, (r-l+1)%2019):
            h.append((((l+i)%2019)*((l+j)%2019))%2019)
    print(min(h))

l, r = map(int, input().split())

if l%2019 >= r%2019:
    print(0)
elif r-l >= 2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    h = []
    for i in range((r-l)%2019):
        for j in range(i, (r-l+1)%2019):
            h.append((((l+i)%2019)*((l+j)%2019))%2019)
    print(min(h))

l, r = map(int, input().split())

if l%2019 >= r%2019:
    print(0)
elif r-l >= 2019:
    print(0)
elif l%2019 == 0 or r%2019 == 0:
    print(0)
else:
    h = []
    for i in range((r-l)%2019):
        for j in range(i+1, (r-l+1)%2019):
            h.append((((l+i)%2019)*((l+j)%2019))%2019)
    print(min(h))

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())

L = 1
R = 2018

ind_s = L
ind_e = min(L + 2019, R)

choices_mod = [x%2019 for x in range(ind_s, ind_e+1)]
# choices_mod_sort = sorted(choices_mod)

if len(choices_mod) == 1:
    print(choices_mod[0])
elif 0 in choices_mod:
    print(0)
else:
    import itertools
    pairs = list(itertools.combinations(choices_mod, 2))
    
    ans_list = []
    for a, b in pairs:
        ans_list.append((a*b)%2019)
        
    print(min(ans_list))


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

ind_s = L
ind_e = min(L + 2019, R)

choices_mod = [x%2019 for x in range(ind_s, ind_e+1)]

if len(choices_mod) == 1:
    print(choices_mod[0])
elif 0 in choices_mod:
    print(0)
else:
    import itertools
    pairs = list(itertools.combinations(choices_mod, 2))
    
    ans_list = []
    for a, b in pairs:
        ans_list.append((a*b)%2019)
        
    print(min(ans_list))


Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = list(map(int, input().split()))
ans=[]
if R-L>=2019:
    print(0)
else:
    for i in range(R-L):
        ans.append(L*(L+i)%2019)
    print(min(ans))

L, R = list(map(int, input().split()))
ans=[]
if R-L>=2019:
    print(0)
else:
    for i in range(R-L):
        for j in range(R-L):
            ans.append((L+j)*(L+i+1)%2019)
    print(min(ans))

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
if L//2019 != R//2019:
    print(0
elif:
    L%2019<= 673 and R%2019 >= 673 and L-R >= 2:
    print(0)
else:
    print(min((L*(L+1))%2019,(R*(R-1)%2019)))


L, R = map(int, input().split())
if L//2019 != R//2019:
    print(0)
elif L % 2019 <= 673 and R % 2019 >= 673 and R - L >= 2:
    print(0)
else:
    ans = 2019
    for i in range(L, R):
        for j in range(i,R+1):
            ans = min(ans, (i*j)%2019)
    print(ans)


L, R = map(int, input().split())
if L//2019 != R//2019:
    print(0)
elif L % 2019 <= 673 and R % 2019 >= 673 and R - L >= 2:
    print(0)
else:
    ans = 2019
    for i in range(L, R):
        for j in range(i+1,R+1):
            ans = min(ans, (i*j)%2019)
    print(ans)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
l = L % 2019
r = R % 2019
w = R - L
if s + w >= 2019:
  print(0)
else:
  print(min((s * (s + 1))% 2019, (l * (l - 1)) % 2019)

L, R = map(int, input().split())
l = L % 2019
r = R % 2019
w = R - L
if l + w >= 2019:
  print(0)
else:
  ans = 2019
  for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
      ans = min(ans, (i * j) % 2019)
  print(ans)

Verdicts: Runtime Error

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
a, b = map(int, input().split())
c = a * b
for i in range(a, b+1):
    for j in range(a, b+1):
        if i != j:
            if c > i * j % 2019:
                print(i)
                print(j)
                c = i * j % 2019
            if c == 0:
                print(0)
                exit()
print(c)


print(2018 * 2017 % 2019)
a, b = map(int, input().split())
c = []
d = 0
for i in range(a, b + 1):
    c.append([abs(i % 2019), i])
    c.append([abs(2019 - i % 2019), i])
    d += 1
    if d > 2019 * 3:
        break
c.sort()
print((c[0][0] * c[1][0]) % 2019)


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

for i in range(a, b):
  for j in range(a + 1 , b + 1):
    c = min(c, i * j % 2019)
    if c == 0:
    	print(c)
        exit()
print(c)


a, b = map(int, input().split())
c = a * b
for i in range(a, b+1):
    for j in range(i + 1, b+1):
        if c > i * j % 2019:
            print(i)
            print(j)
            c = i * j % 2019
        if c == 0:
            print(0)
            exit()
print(c)


a, b = map(int, input().split())
c = 10 ** 9
for i in range(a, b + 1):
    for j in range(a, b + 1):
        if i != j
            c = min(c, i * j % 2019)
            if c == 0:
                print()
                exit()
print(c)


print(2019 * 2020 % 2019)
a, b = map(int, input().split())
c = 0
d = -1
for i in range(a + 1, b + 1):
    if d == -1:
        d = (i * (i-1)) % 2019
    elif d > (i * (i-1)) % 2019:
        d = (i * (i-1)) % 2019
    c += 1
    if c > 2019 * 3:
        break
print(d)


a, b = map(int, input().split())
c = a * b
for i in range(a, b+1):
    for j in range(a, b+1):
        if c > i * j % 2019:
            c = i * j % 2019
        if c == 0:
            print(0)
            exit()
print(c)


print(2018 * 2017 % 2019)
a, b = map(int, input().split())
c = 0
d = -1
for i in range(a + 1, b + 1):
    if d == -1:
        d = (i * (i-1)) % 2019
    elif d > (i * (i-1)) % 2019:
        d = (i * (i-1)) % 2019
    c += 1
    if d == 0:
        print(i)
    if c > 2019 * 3:
        break
c = 0
for i in range(b, a):
    if d > (i * (i-1)) % 2019:
        d = (i * (i-1)) % 2019
    c += 1
    if d == 0:
        print(i)
    if c > 2019 * 3:
        break
print(d)


a, b = map(int, input().split())
c = 0
for i in range(a, b+1):
    for j in range(a, b+1):
        c = i * j % 2019
        if c == 0:
            print(0)
            exit()
print(c)


a, b = map(int, input().split())
c = 10 ** 9
for i in range(a, b + 1):
    for j in range(i + 1, b + 1):
        c = min(c, (i * j) % 2019)
        if c == 0:
            print(c)
            exit()
print(c)


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l, r = [int(x) for x in input().split(' ')]

r = 2*(10**9)
l = r - 2018

if (r-l) > 2019:
  print(0)
else:
  a = [x for x in range(l, r+1)]
  res = [i*j%2019 for i in a for j in a if i!=j]
  print(min(res))


l, r = [int(x) for x in input().split(' ')]

if (r-l) > 2019:
  print(0)
else:
  a = [x for x in range(l, r+1)]
  res = [i*j%2019 for i in a for j in a if i!=j]
  print(min(res))


Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
import numpy as np
LL = L%2019
RR = R%2019
min = 2019

if R-L >= 2018 or RR <= LL:
    min= 0
elif RR*(RR-1)<2019:
    min = LL*(LL-1)
else:
    for i in range(LL, RR+1):
        for j in range(i+1, RR+1):
            if (i*j)%2019 < min:
                min= (i*j)%2019


print(min)


L, R = map(int, input().split())
import numpy as np
ans = -1
for k in range(L+1, R+1):
    if k % 2019 == 0:
        ans = 0
        break

if ans == -1:
    ans = L*(L+1)

print(ans)


L, R = map(int, input().split())
import numpy as np
LL = L%2019
RR = R%2019
min = 2019

if R-L >= 2018 or RR <= LL:
    min= 0
elif RR*(RR-1)<2019:
    min = LL*(LL-1)
else:
    for i in range(LL, RR+1):
        for j in range(i+1, RR+1):
            if (i*j)%2019 < min:
                min= (i*j)


print(min)



L, R = map(int, input().split())
import numpy as np
L = L%2019
R = R%2019
min = 2019

if R-L >= 2018 or R <= L:
    min= 0
elif R*(R-1)<2019:
    min = L*(L-1)
else:
    for i in range(L, R+1):
        for j in range(i+1, R+1):
            if (i*j)%2019 < min:
                min= (i*j)%2019


print(min)


L, R = map(int, input().split())
import numpy as np
L = L%2019
R = R%2019
min = 2019

if R-L >= 2018 or R <= L:
    min= 0
elif R*(R-1)<2019:
    min = L*(L-1)
else:
    for i in range(L, R+1):
        for j in range(i+1, R+1):
            if (i*j)%2019 < min:
                min= (i*j)


print(min)


L, R = map(int, input().split())
import numpy as np
min = 2019
for i in range(L+1, R+1):
    for j in range(L+1, R+1):
        if (i*j)%2019 < min:
            min = (i*j)%2019

print(min)

L, R = map(int, input().split())
import numpy as np
min = 2019
for i in range(L+1, R+1):
    for j in range(i+1, R+1):
        if (i*j)%2019 < min:
            min = (i*j)%2019

print(min)


L, R = map(int, input().split())
import numpy as np
LL = L%2019
RR = R%2019
min = 2019


for i in range(LL, RR+1):
	for j in range(i+1, RR+1):
    	if (i*j)%2019 == 0:
        	min = 0
        	break
        elif (i*j)%2019 < min:
            min= (i*j)%2019


print(min)


L, R = map(int, input().split())
import numpy as np
LL = L%2019
RR = R%2019
min = 2019

if R-L >= 2018 or RR < LL:
    min= 0
elif RR*(RR-1)<2019:
    min = LL*(LL-1)
else:
    for i in range(LL, RR+1):
        for j in range(i+1, RR+1):
            if (i*j)%2019 < min:
                min= (i*j)%2019


print(min)


L, R = map(int, input().split())
import numpy as np
LL = L%2019
RR = R%2019

min = 2019
if LL >= RR:
    min = 0
elif R-L >= 2018:
    min = 0
else:
    for i in range(LL, RR+1):
        for j in range(i+1, RR+1):
            if (i*j)%2019 < min:
                min = (i*j)%2019
            if (i*j)%2019 == 0:
                min = 0
                break
        else:
            continue
        break


print(min)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l, r = [int(x) for x in input().split()]
NUM = 2019
res = 0
if r // NUM - (l + NUM - 1) // NUM >= 0: 
    res = 0
elif r // 3 - (l + 3 - 1) // 3 >= 0 and r // 673 - (l + 673 - 1) // 673 >= 0:
    res = 0
else: 
    res = 2019
    for i in range(l, r + 1):
        for j in range(l, r + 1):
            res = min(res, (i * j) % NUM)
print(res)


l, r = [int(x) for x in input().split()]
NUM = 2019
if r // NUM - (l + NUM - 1) // NUM >= 0: 
    res = 0
elif r // 3 - (l + 3 - 1) // 3 >= 0 and r // 673 - (l + 673 - 1) // 673 >= 0:
    res = 0
else: 
    res = 2019
    for i in range(l, r + 1):
        for j in range(i + 1, r + 1):
            res = min(res, (i * j) % NUM)
print(res)


Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
if L + 2019 < R:
  tmp = 10**9
  for l in range(L,R):
    for r in range(l+1, R+1):
      if (l*r)%2019 < tmp:
        tmp = (l*r)%2019
  print(tmp)
else:
  print("0")

L, R = map(int, input().split())
if L + 2019 < R:
  tmp = 10**9
  for l in range(L,R):
    for r in range(l+1, R+1):
      if (l*r)%2019 < tmp:
        tmp = (l*r)%2019
  print(tmp)
else:
  print(0)


L, R = map(int, input().split())
if L + 2019 > R:
  tmp = 10**9
  for l in range(L,R):
    for r in range(l+1, R+1):
      if (l*r)%2019 < tmp:
        tmp = (l*r)%2019
  print(tmp)
else:
  print("0")



Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L,R=map(int,input().split())
l,r=L%2019,R%2019
x,y=L//2019,R//2019
if x<y:
  print(0)
else:
  ans=10**9
  for i in range(l,r):
    for j in range(i,r+1):
      ans=min(ans,(i*j)%2019)

L,R=map(int,input().split())
l,r=L%2019,R%2019
x,y=L//2019,R//2019
if x<y:
  print(0)
else:
  ans=10**9
  for i in range(l,r):
    for j in range(i+1,r+1):
      ans=min(ans,(i*j)%2019)
  print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L,R = map(int,input().split())





# (i*j) mod 2019 = (i mod 2019) * (j mod 2019)

if(R <= 2019):
    ans = (R%2019)* ((R-1)%2019)

if(L >= 2019):
    ans = min(ans,(L%2019)* ((L+1)%2019))
print(ans)

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





# (i*j) mod 2019 = (i mod 2019) * (j mod 2019) %2019

# =============================================================================

#     for j in range(i,2019):
#         a = (i*j) % 2019
#         b = (i % 2019)*(j % 2019) % 2019
#         if a != b:
#             print(i,a,b)
# =============================================================================



dist = (R - L)
if dist >= 2019:
    print("0")
else:
    ans = 999999
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans = min(ans,(i*j) % 2019)
    print(ans)


Verdicts: Runtime Error

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
import sys
import math
#L,R = map(int, input().split())
#L,R = 4,5
L,R = 2019,4037

l_mod = L % 2019
l_div = L // 2019
r_mod = R % 2019
r_div = R // 2019

if r_div - l_div >= 1:
    ans = 0
else:
    if l_mod == 0:
        ans = 0
    else:
        ans = l_mod * (l_mod + 1) % 2019
print(ans)

import sys
import math
#L,R = map(int, input().split())
#L,R = 4,5
L,R = 2019,4037

l_mod = L % 2019
l_div = L // 2019
r_mod = R % 2019
r_div = R // 2019

if r_div - l_div >= 1:
    ans = 0
else:
    if l_mod == 0:
        ans = 0
    else:
        ans = l_mod * (l_mod + 1)
print(ans)

import sys
import math
L,R = map(int, input().split())
#L,R = 2020,2040
#L,R = 4,5
#L,R = 2019,4037

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

# l_mod = L % 2019
# l_div = L // 2019
# r_mod = R % 2019
# r_div = R // 2019

# if r_div - l_div >= 1:
#     ans = 0
# else:
#     if l_mod == 0:
#         ans = 0
#     else:
#         ans = (l_mod * (l_mod + 1)) % 2019
# print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
if R-L >= 2019:
    print(0)
elif L%2019 > R%2019:
    print(0)
else:
    print((R*(R-1))%2019)


L, R = map(int, input().split())
if R-L >= 2019:
    print(0)
    exit()
elif L%2019 > R%2019:
    print(0)
    exit()
else:
    min = 2020
    for l in range(L, R):
        for r in range(L+1, R+1):
            tmp = (l * r) % 2019
            if tmp < min:
                min = tmp
print(tmp)


L, R = map(int, input().split())
if R-L >= 2019:
    print(0)
    exit()
elif L%2019 > R%2019:
    print(0)
    exit()
else:
    min = 0
    for l in range(L, R):
        for r in range(L+1, R+1):
            tmp = (l * r) % 2019
            if tmp < min:
                min = tmp
print(tmp)


L, R = map(int, input().split())
R = min(R, L+4038)
ans = 2018
for i in range(L, R+1):
    for j in range(i+1, R+1):
        x = i*j%2019
        if ans > x:
            ans = x
print(ans)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
small1 = L % 2019
small2 = R % 2019
for i in range(L, R+1):
    ans = i % 2019
    if  ans < small1:
        small2 = small1
        small1 = ans
    elif ans < small2:
        small2 = ans
    if small1 == 0:
        break
print(small1 * small2)

L, R = map(int, input().split())
if R - L > 2019:
    print(0)
else:
    ans = (L * R) % 2019
    for i in range(L, R):
        for j in range(i+1, R+1):
            if ans > (i*j)%2019:
                ans = (i*j)%2019
    print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l,r = map(int,input().split())
now = 0
for i in range(l,r):
  for j in range(i+1,r+1):
    if i*j % 2019 == 0:
      print(0)
      break
    else:
      if i*j % 2019 < now:
        now = i*j % 2019
if now != 0:
  print(now)

L,R = map(int,input().split())
ans = 1145141919810
for i in range(L,R):
  for j in range(L,R):
    if  (i*j)%2019 < ans:
      if (i*j)%2019 == 0:
        ans = 0
        break
      else:
        ans = (i*j)%2019
print(ans)

L,R = map(int,input().split())
ans = 1145141919810
if R-L>=2019:
  R = L+2019
for i in range(L,R):
  for j in range(L,R):
    if  (i*j)%2019 < ans:
      if (i*j)%2019 == 0:
        ans = 0
        break
      else:
        ans = (i*j)%2019
print(ans)


l,r = map(int,input().split())
minimum = 2019
for i in range(l,r+1):
  if minimum == 0:
    break
  for j in range(i+1,r+1):
    if (i*j)%2019 == 0:
      minimum = 0
      break
    else:
      if (i*j)%2019 < minimum:
        minimum = (i*j)%2019
print(minimum)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
n,m = map(int, input().split())
a = (n%2019) * (m%2019)
print(a%2019)

# -*- coding: utf-8 -*-
"""
Created on Sun Jul 28 20:37:55 2019

@author: avina
"""

l,r = map(int, input().split())
k = 2020

for i in range(l,r+1):
   for j in range(i+1,r+1):
       k = min(k, (i*j)%2019)
       if k == 0:
           print(k)
           exit()
print(k)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
ll, rr = map(int, input().split())
if rr - ll >= 2019:
    print(0)
    exit()

l = ll % 2019
r = rr % 2019

if l > r:
    print(0)
    exit()
print(l,r)
ans = 10**9
for i in range(l, r + 1):
    for j in range(i+1, r+1):
        x = (i * j) % 2019
        print(x)
        ans = min(x, ans)

print(ans)


l, r = map(int, input().split())
ans = 2020
for i in range(1, min(r-l+1, r+2019)):
    x = (l * (l + i)) % 2019
    print(x)
    ans = min(x, ans)
print(ans)


ll, rr = map(int, input().split())
if rr - ll >= 2019:
    print(0)
    exit()

l = ll % 2019
r = rr % 2019

if l > r:
    print(0)
    exit()

ans = 10**9
for i in range(l, r + 1):
    for j in range(i+1, r+1):
        x = (i * j) % 2019
        ans = min(x, ans)

print(ans)


Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L,R = map(int,input().split())
MOD = 2019

LENGTH = (R-L+1) / MOD
if LENGTH < 1:
    ans = float("inf")
    for i in range(L, R):
        for j in range(i+1, R+1):
            answer = min(ans, (i * j) % MOD)
    print(ans)
else:
    print(0)

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

LENGTH = (R-L+1) / MOD
if LENGTH < 1:
    ans = float("inf")
    for i in range(L, R):
        for j in range(i+1, R+1):
            ans = min(ans, (i * j) % MOD)
    print(ans)
else:
    print(0)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
def main():
    N, M = map(int, input().split())
    ans = -1
    if M >= 2019:
        ans = 0
    else:
        for n in range(M)[N:]:
            for i in range(M + 1)[n + 1:]:
                mod = n * i % 2019
                if ans < 0 or mod < ans:
                    ans = mod
    print(ans)


if __name__ == '__main__':
    main()


def main():
    N, M = map(int, input().split())
    ans = -1
    for n in range(M)[N:]:
        for i in range(M + 1)[n + 1:]:
            mod = n * i % 2019
            if ans < 0 or mod < ans:
                ans = mod
                if ans == 0:
                    break
        if ans == 0:
            break
    print(ans)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l,r = map(int,input().split())
mod = 2019

if r - l >= 2019:
    print(0)
    exit()

for i in range(l,r+1):
    for j in range(i,r+1):

        mod = min(mod,(i*j)%2019)
        if mod == 0:
            break

print(mod)


l,r = map(int,input().split())
mod = 2019

if r - l >= 2019:
    print(0)
    exit()
    
l %= 2019
r %= 2019
for i in range(l,r):
    for j in range(i,r):

        mod = min(mod,(i*j)%2019)
        if mod == 0:
            break

print(mod)


l,r = map(int,input().split())
mod = 2019

if r - l >= 2019:
    print(0)
    exit()

l %= 2019
r %= 2019
for i in range(l,r+1):
    for j in range(i,r+1):

        mod = min(mod,(i*j)%2019)
        if mod == 0:
            break

print(mod)


l,r = map(int,input().split())
mod = 2019

if r - l >= 2019:
    print(0)
    exit()

for i in range(l,r+1):
    for j in range(i+1,r+1):

        mod = min(mod,(i*j)%2019)
        if mod == 0:
            break

print(mod)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l,r = map(int,input().split())
ans=2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        print([i,j])
        ans=min((i*j)%2019,ans)
        
        
print(ans)

l,r = map(int,input().split())
ans=2019

for i in range(l,r+1):  
    if r-l>=2019:
        ans=0
        break
    for j in range(i+1,r+1):
        ans=min((i*j)%2019,ans)
                
print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
if R - L >= 2019:
    print(0)
# elif L == 0:
#     print(0)
else:
    ans = float("inf")
    for i in range(L, R+1):
        for j in range(L, R+1):
            ans = min(i * j % 2019, ans)
        
        #     print(i)
    print(ans)


L, R = map(int, input().split())
if R - L >= 2019:
    print(0)
# elif L == 0:
#     print(0)
else:
    ans = float("inf")
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            ans = min(((i % 2019) * (j % 2019)) % 2019, ans)
    print(ans)


Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l,r=[int(i) for i in input().split()]
l2,r2=l%2019,r%2019
if l2>r2:
  print(0)
elif r-l>=2019:
  print(0)
else:
  print(l*(l+1))

l,r=[int(i) for i in input().split()]
l2,r2=l%2019,r%2019
if l//2019<r//2019:
  print(0)
else:
  k=2019*2019
  for i in range(l,r):
    for j in range(i+1,r+1):
      k=min(k,i*j%2019)

l,r=[int(i) for i in input().split()]
l2,r2=l%2019,r%2019
if l//2019<r//2019:
  print(0)
else:
  k=2019*2019
  for i in range(l,r):
    for j in range(i+1,r+1):
      k=min(k,i*j%2019)
  print(k)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L,R=map(int,input().split())
l=L%2019
r=R%2019
if R-L>2018:
  print(0)
else:
  if l>r:
    print(0)
  else:
    ans=2019
    for i in range(r-l):
      for j in range(r-l-i):
        x=((l+i)*(l+j))%2019
        ans=min(ans,x)
    print(ans)
        

L,R=map(int,input().split())
l=L%2019
r=R%2019
if R-L>2018:
  print(0)
else:
  if l>r:
    print(0)
  else:
    ans=0
    for i in range(r-l):
      for j in range(r-l-i):
        x=((l+i)*(l+j))%2019
        ans=min(ans,x)
    print(ans)
        

L,R=map(int,input().split())
l=L%2019
r=R%2019
if R-L>2018:
  print(0)
else:
  if l>r:
    print(0)
  else:
    ans=2019
    for i in range(r-l):
      for j in range(r-l-i):
        x=((l+i)*(l+i+j+1))%2019
        ans=min(ans,x)
    print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = map(int, input().split())
N = 2019

while L>N:
	L -= N
while R>N:
	R -= N
ans = R*L

print(ans%2019)


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

if R-L>N:
	print(0)
elif L < N and N < R:
	print(0)
else:
	while L>N:
		R -= N
		L -= N

	i = R
	j = R-1
	ans = i*j%N
	while ans >= 0:
		Answr = ans
		if i >= j:
			ans -= i
			i -= 1
		else:
			ans -= j
			j -= 1

	print(Answr)
		

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

if R-L>N:
	print(0)
else:
	while L>N:
		R -= N
		L -= N
	Ans = N - 1
	for i in range(L, R):
		for j in range(i+1, R+1):
			ans = i*j%N
			Ans = min(Ans, ans)

	print(Ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l,r=map(int,input().split())

if r-l>=2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans=min(ans,(i*j)%2019)

print(ans)


l,r=map(int,input().split())

if r-l>=2019:
    print(0)
    exit()

ans=float('inf')
for i in range(l,r):
    for j in range(i+1,r+1):
        ans=min(ans,i*j)

print(ans)


l,r=map(int,input().split())
if r-l>=2019:
      print(0)
      exit()
ans=2019
for i in range(l,r):
      for j in range(l+1,r+1):
            ans=min(ans,(i*j)%2019)
print(ans)


Verdicts: Runtime Error

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
def make_list(L, R):
    mod_list = list()

    for i in range(L, R):
        for j in range(i + 1, i + 2020):
            mod_list.append((i * j) % 2019)

    return mod_list


def main():
    L, R = map(int, input().split())

    mod_list = make_list(L, R)

    print(min(mod_list))

    return


if __name__ == "__main__":
    main()


def make_list(L, R):
    mod_list = list()

    if R - L <= 2019:
        for i in range(L, R):
            for j in range(i + 1, R + 1):
                mod_list.append((i * j) % 2019)
    else:
        for i in range(L, L + 2020):
            for j in range(i + 1, i + 2021):
                mod_list.append((i * j) % 2019)

    return mod_list


def main():
    L, R = map(int, input().split())

    mod_list = make_list(L, R)

    print(min(mod_list))

    return


if __name__ == "__main__":
    main()


Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L,R = map(int, input().split())

ANS = 2020
if R - L <= 2019:
  for i in range(L,R):
    for j in range(i,R):
    	ANS = min(ANS, (i * j) % 2019)
else:
  ANS = 0
print(ANS)

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

ANS = 2020
if R - L <= 2019:
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      #if ANS != min(ANS, (i * j) % 2019):
      #  print(i,j)
      ANS = min(ANS, (i * j) % 2019)
        
else:
  ANS = 0
print(ANS)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
def main():

p = 2019
L, R = list(map(int, input().split()))
if (R - L) >= (p -1):
  ans = 0
  print(ans)
else:
  L, R = 
  if L < R:
    ans = L * (L+1)
  else:
    ans = 0
  print(ans)
  
main()


  


def main():

p = 2019
L, R = list(map(int, input().split()))
if (R - L) >= (p -1):
  ans = 0
  print(ans)
else:
  L, R = [x % p for x in [L, R]]
  if L < R:
    ans = L * (L+1)
  else:
    ans = 0
  print(ans)
  
main()


  

def main():
  p = 2019
  L, R = list(map(int, input().split()))
  
  if (R - L) >= p:
    ans = 0
    print(ans)
    
  else:
    L, R = L % p, R % p
    ans = 2019 ** 2
    for i in range(L, R + 1):
      for j in range(i+1, R+1):
        tmp = (i * j) % p
        if tmp < ans:
          ans = tmp
    print(ans)
    
main()

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
import math
l,r=map(int,input().split())
a=l%2019
b=r%2019
if l-r>=2018:
    print(0)
elif b-a<=0:
    print(0)
elif (a<=672)&(b>=673):
    print(0)
elif(a<=673)&(b>=675):
    print(0)
elif (a<=1345)&(b>=1346):
    print(0)
elif(a<=1346)&(b>=1348):
    print(0)
elif a<=20&b>=101:
    print(1)
else:
    ans=2018
    for i in range(a,b+1):
        for j in range(i+1,b+1):
            print(i,j)
            ans=min(ans,i*j%2019)
    print(ans)


import math
l,r=map(int,input().split())
a=l%2019
b=r%2019
if l-r>=2018:
    print(0)
elif b-a<=0:
    print(0)
elif (a<672)&(b>674):
    print(0)
elif (a<1345)&(b%3>1347):
    print(0)
elif a<=20&b>=101:
    print(1)
else:
    ans=2018
    for i in range(a,b+1):
        for j in range(i+1,b+1):
            print(i,j)
            ans=min(ans,i*j%2019)
    print(ans)

import math
l,r=map(int,input().split())
a=l%2019
b=r%2019
if r-l>=2018:
    print(0)
elif b-a<=0:
    print(0)
else:
    ans=2018
    for i in range(a,b+1):
        for j in range(i+1,b+1):
            ans=min(ans,i*j%2019)
    print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
def resolve():
    '''
    code here
    '''
    L, R = [int(item) for item in input().split()]
    aL, bL = divmod(L, 2019)
    aR, bR = divmod(R, 2019)

    if bL == 0:
        res = 0
    elif aL < aR:
        res = 0
    elif aL == aR:
        res = 2019
        for i in range(bL,bR+1):
            for j in range(bL,bR+1):
                res = min(res, i*j%2019)

    print(res)
if __name__ == "__main__":
    resolve()


def resolve():
    '''
    code here
    '''
    L, R = [int(item) for item in input().split()]
    aL, bL = divmod(L, 2019)
    aR, bR = divmod(R, 2019)

    if bL == 0:
        res = 0
    elif aL < aR:
        res = 0
    elif aL == aR:
        res = 2019
        for i in range(bL,bR):
            for j in range(bL+1,bR+1):
                res = min(res, i*j%2019)

    print(res)
if __name__ == "__main__":
    resolve()


Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
a,b = input().split(' ')
a = int(a)
b = int(b)

ans = 5000

for i in range(a, b - 1):
    for j in range(i + 1, b):
        for k in range(2, ans):
            if (i * j) % k == 2019 % k:
                print((i * j) % k, 2019 % k)
                ans = k
                break

print(ans)

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

ans = 5000
check = False

for i in range(a, b):
    if check:
        break
    for j in range(i + 1, b + 1):
        print(i, j)
        if (i * j) % 2019 < ans:
            ans = (i * j) % 2019
            check = True
            break

print(ans)

a,b = input().split(' ')
a = int(a)
b = int(b)
 
ans = 100000000000
 
for i in range(a, min(b, a + 2019)):
    for j in range(i + 1, min(b + 1, a + 2019)):
        if (i * j) % 2019 < ans:
            ans = (i * j) % 2019
 
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
import itertools
L,R = map(int,input().split())
if 2019 <= (R - L) + 1:
  print(0)
  exit()
  
lst = list(range(L,R+1))
md = [x * y % 2019 for x,y in itertools.combination(lst,2)]
md.sort()
print(md[0])

import itertools
L,R = map(int,input().split())
if 2019 <= (R - L) + 1:
  print(0)
  exit()
  
lst = list(range(L,R+1))
md = [x * y % 2019 for x,y in itertools.combinations(lst,2)]
md.sort()
print(md[0])


Verdicts: Runtime Error

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
def solve():
    L,R = map(int, input().split())
    if R-L >= 2019:
        multiple = [0]
    else:
        L,R = L%2019, R%2019
        L,R = min(L,R),max(L,R)
        multiple = [i*j for i in range(L,R) for j in range(i,R+1)]
        
    print(min(multiple))

solve()

def solve():
    L,R = map(int, input().split())
    if R-L >= 2019:
        multiple = [0]
    else:
        L,R = L%2019, R%2019
        L,R = min(L,R),max(L,R)
        multiple = [i*j%2019 for i in range(L,R) for j in range(i+1,R+1)]
        
    print(min(multiple))

solve()

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l, r = map(int, input().split())
%print(l,r)

best = 2019
for i in range(l, r):
	for j in range(l+1,r+1):
		if i*j % 2019 < best:
			best = i*j % 2019

print(best)

l, r = map(int, input().split())
#print(l,r)

best = 2019
for i in range(l, min(r,l+2019)):
	for j in range(l+1,min(r+1,l+2019+1)):
		if i*j % 2019 < best:
			best = i*j % 2019

print(best)

Verdicts: Runtime Error

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l, r = map(int, input().split())
m = 2019
if r - l < 673:
    print(0)
else:
    ans = 2018
    l = l%m
    r = r%m
    for i in range(l, r):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j)%m)
    print(ans)

l, r = map(int, input().split())
m = 2019
if r - l >= 673:
    print(0)
else:
    ans = 2018
    for i in range(l, r):
        for j in range(i+1, r+1):
            ans = min(ans, (i*j)%m)
        if ans <= 2:
            break
    print(ans)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
l,r=map(int,input().split())
ll=l%2019
rr=r%2019+2019

ans=float('inf')
for i in range(ll,rr):
    for j in range(i+1,rr+1):
        ans=min(ans,i*j%2019)
        if ans==0:
          break
print(ans)

l,r=map(int,input().split())
ll=l%2019
rr=r%2019+2019

ans=float('inf')
for i in range(ll,rr):
    for j in range(i+1,rr+1):
        ans=min(ans,i*j%2019)
print(ans)

l,r=map(int,input().split())

ans=2020
if r-l>=2019:
    ans=0
else:
    for i in range(l,r+1):
        for j in range(i+1,r+1):
            ans = min(ans,i*j%2019)
print(ans)

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L,R = map(int,input().split(' '))
if R-L>=2019:
    print(0)
else:
    f = True
    for i in range(L,R+1):
        t = i % 2019
        if t==0:
            f = False
            break
    if f:
        ans = 2019
        for i in range(L,R+1):
            for j in range(i,R+1):
                ans = min(ans,i*j%2019)
                if ans==0:
                    break
        print(ans)
    else:
        print(0)

L,R = map(int,input().split(' '))
if R-L>=2019:
    print(0)
else:
    f = True
    for i in range(L,R+1):
        t = i % 2019
        if t==0:
            f = False
            break
    if f:
        ans = 2019
        for i in range(L,R+1):
            for j in range(i+1,R+1):
                ans = min(ans,i*j%2019)
                if ans==0:
                    break
        print(ans)
    else:
        print(0)

Verdicts: Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
L, R = list(map(int,input().split()))

minimum = L * R
for i in range(L, min(R, L+2020)):
    for j in range(i+1, min(R+1, i+2021)):
        
        minimum = min(minimum, i * j // 2019)
        

print(minimum)

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

minimum = L * R
for i in range(L, L + 2019):
    for j in range(i+1, i + 2020):
        minimum = min(minimum, i * j // 2019)

print(minimum)

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

minimum = L * R
for i in range(L, min(R, L+2020)):
    for j in range(i+1, min(R+1, i+2020)):
        
        minimum = min(minimum, i * j // 2019)
        

print(minimum)

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

minimum = L * R
for i in range(L, min(R, L+2020)):
    for j in range(i+1, min(R+1, i+2020):
        
        minimum = min(minimum, i * j // 2019)
        

print(minimum)

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

minimum = L * R
for i in range(L, R):
    for j in range(i+1, R+1):
        for k in range(i, i+2019):
            minimum = min(minimum, k * j // 2019)
        

print(minimum)

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

minimum = L * R
for i in range(L, R):
    for j in range(i+1, R+1):
        minimum = min(minimum, i * j // 2019)

print(minimum)

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

MOD = 2019
L, R = lr()
if (R-L) > 2019 * 2:
    R = L + (R-L)%MOD + 2019

answer = 2019
for i in range(L, R):
    for j in range(i+1, R+1):
        temp = i * j % MOD
        if temp < answer:
            answer = temp

print(answer)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

Accepted
Problem: You are given two non-negative integers L and R. We will choose two integers i and j such that L \leq i < j \leq R. Find the minimum possible value of (i \times j) \mbox{ mod } 2019.

Submission attempts (in order):
import heapq
L,R = map(int, input().split())
if R - L >= 672:
    print(0)
    exit()
else:
    hq3 = []
    hq673 = []
    hq2019 = []
    for i in range(L, R+1):
        heapq.heappush(hq2019, i%2019)
        heapq.heappush(hq673, i%673)
        heapq.heappush(hq3, i%3)
    a = heapq.heappop(hq2019)
    b = heapq.heappop(hq673)
    c = heapq.heappop(hq3)
    if a == 0:
        print(0)
        exit()
    elif b == 0 and c == 0:
        print(0)
        exit()
    else:
        print(heapq.heappop(hq) * a % 2019)

L,R = map(int, input().split())
if R - L >= 2018:
    print(0)
    exit()
else:
    ans = 2019**2
    for i in range(L, R):
        for j in range(i+1, R+1):
            i %= 2019
            j %= 2019
            k = (i*j) % 2019
            ans = min(ans, k)
    print(ans)

Verdicts: Runtime Error

Accepted