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())

diff = R//2019 - L//2019

if L % 2019 == 0:
    answer = 0
elif diff > 0:
    answer = 0
else:
    L = L % 2019
    R = R % 2019
    _min = 2019
    for i in range(L, R+1):
        for j in range(i, R+1):
            _min = min(_min, (i * j) % 2019)
    answer = _min

print(answer)


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

diff = R//2019 - L//2019

if L % 2019 == 0:
  answer = 0
elif diff == 0:
  answer = L * (L+1)
else:
  answer = 0

print(answer)

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

diff = R//2019 - L//2019

if L % 2019 == 0:
    answer = 0
elif diff > 0:
    answer = 0
else:
    _min = 2019
    for i in range(L, R+1):
        for j in range(i, R+1):
            _min = min(_min, (i * j) % 2019)
    answer = _min

print(answer)


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

diff = R//2019 - L//2019

if L % 2019 == 0:
    answer = 0
elif diff > 0:
    answer = 0
else:
    _min = 2019
    for i in range(L, R+1):
        for j in range(i+1, R+1):
            _min = min(_min, (i * j) % 2019)
    answer = _min

print(answer)


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):
import math
N, D = map(int, input().split())
x = [list(map(int,input().split())) for i in range(N)]
tmp = 0
ans = 0
for i in range(N):
    for j in range(i + 1,N):
        for d in range(D):
            tmp += (x[i][d] - x[j][d])**2
        tmp = math.sqrt(tmp)
        if tmp.is_integer():
            ans += 1
        tmp = 0
print(ans)

L, R = map(int, input().split())
ans = 2019
if R - L >= 2019:
    print(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: 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())
ans=float('inf')
for i in range(L,R+1):
  for j in range(L,R+1):
    s=(i*j)%2019
    if s==0:
      print(0)
      exit()
    else:
      ans=min(s,ans)
      
print(ans)
    

L,R=map(int,input().split())
ans=float('inf')
for i in range(L,R):
  for j in range(L+1,R+1):
    s=(i*j)%2019
    
    if s==0:
      print(0)
      exit()
    else:
      ans=min(s,ans)
      
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):
#C
l,r = map(int,input().split())
tmp = []
if r*(r-1) < 2019:
    print(r*(r-1))
    
else:
    if r - l > 2019 or l <= (r//2019) * 2019 <= r :
        print(0)       
    else:
        for i in range(l,r+1):
            for j in range(i,r+1):
                m = (i*j) % 2019
                tmp.append(m)
        print(min(tmp))
            

#C
l,r = map(int,input().split())
tmp = []
if r*(r-1) < 2019:
    print(r*(r-1))
    
else:
    if r - l >= 2019 or l <= (r//2019) * 2019 <= r :
        print(0)       
    else:
        for i in range(l,r+1):
            for j in range(i+1,r+1):
                m = (i*j) % 2019
                tmp.append(m)
        print(min(tmp))
            

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())
mini = 2018
minib = 2018

if R-L >= 2019:
    print('0')
else:
    for i in range(L, R+1):
        if (i % 2019) < mini:
            mini = i % 2019
            ans = i
            if i % 2019 == 0:
                ans = 0
                print('0')
                break

        for j in range(L, R+1):
            if j == ans:
                continue
            if (j % 2019) < minib:
                minib = j % 2019
                sansb = j

    calc = ((ans%2019) * (ansb%2019)) % 2019
    print(calc)

L, R = map(int, input().split())
mini = 100000000000000
minib = 100000000000000

if R-L > 2019:
    print('0')
elif R - L == 1:
    print((R*L)%2019)
else:
    for i in range(L, R):
        if (i % 2019) < mini:
            mini = i % 2019
            ans = i

    for j in range(L, R):
        if j == ans:
            continue
        if (j % 2019) < minib:
            print(j)
            minib = j % 2019
            ansb = j

    calc = ((ans%2019) * (ansb%2019)) % 2019
    print(calc)

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

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

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 = [int(x) for x in input().split()]
 
L = L%2019
R = L%2019
 
min_ans = 10**18
for i in range(L,R):
    for j in range(i+1,R+1):
        ans = (i*j)%2019
        
        if ans < min_ans:
            min_ans = ans
        if min_ans == 0:
            break
print(min_ans)


input_arr = [int(x) for x in input().split()]
 
L = input_arr[0]
R = input_arr[1]
 
min_ans = 10**18
for i in range(L,R):
    for j in range(i+1,R+1):
      	ans = (i*j)%2019
        if ans < min_ans:
            min_ans = ans
        if min_ans == 0:
          break
print(min_ans)

L,R = [int(x) for x in input().split()]
 
#L = input_arr[0]
#R = input_arr[1]
 
min_ans = 10**18
for i in range(L+1,R+1):
  if ans < min_ans:
    min_ans = ans
  if min_ans == 0:
    break

print(min_ans)


input_arr = [int(x) for x in input().split()]
 
L = input_arr[0]
R = input_arr[1]
 
min_ans = 10**18
for i in range(L,R):
    for j in range(i+1,R+1):
        if (i*j)%2019 < min_ans:
            min_ans = ans
print(min_ans)


L,R = [int(x) for x in input().split()]
 
min_ans = 10**18
R = R%2019
for i in range(L,R):
    for j in range(i+1,R+1):
        ans = (i*j)%2019
        
        if ans < min_ans:
            min_ans = ans
        if min_ans == 0:
            break
print(min_ans)


L,R = [int(x) for x in input().split()]
 
min_ans = 10**18

if R-L>=2019:
  min_ans=0
else:
  for i in range(L,R):
      for j in range(i+1,R+1):
          ans = (i*j)%2019

          if ans < min_ans:
              min_ans = ans
          if min_ans == 0:
              break
print(min_ans)


Verdicts: Wrong Answer

Runtime Error

Runtime Error

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())

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


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

if R-L+1>=2019:
    print(0)
else:
    L %= 2019
    R %= 2019
    if L<R:
        k=L*L(+1)
        print(k)
    else:
        print(0)


l, r = map(int, input().split())
k1 = 2019
a = l %2019
b = r % 2019
if r - l > 2018:
    k1 = 0

elif b < a:
    k1 = 0

else:
    k = a * b
    k1 = k % 2019

print(k1)

l, r = map(int, input().split())
k1 = 2019
a = l % 2019
b = r % 2019
if r - l > 2018:
    k1 = 0

elif b < a:
    k1 = 0

else:
    k = a * b
    k1 = k % 2019

print(k1)

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

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


Verdicts: Runtime Error

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):
from itertools import combinations

mod = 2019

for i, j in combinations(range(L, R+1), 2):
    i, j = i%mod, j%mod
    mini = min(mini, i*j % mod)
    if mini == 0:
        break
print(mini)

from itertools import combinations

mod = 2019
l, r = L % mod, R % mod
if l > r:
    l, r = r, l

mini = l*r % mod
for i in range(l, r):
  for j in range(i+1, r+1):
    mini = min(mini, i*j % mod)
    if mini == 0:
        break
print(mini)

L, R = map(int, input().split())
from itertools import combinations

mod = 2019

for i, j in combinations(range(L, R+1), 2):
    mini = min(mini, i*j % mod)
    if mini == 0:
        break
print(mini)

L, R = map(int, input().split())
from itertools import combinations

mod = 2019

for i, j in combinations(range(L, R+1), 2):
    i, j = i%mod, j%mod
    mini = min(mini, i*j % mod)
    if mini == 0:
        break
print(mini)

L, R = map(int, input().split())
from itertools import combinations

mod = 2019

if R - L >= mod:
    print(0)
else:
    mini = mod - 1
    for i, j in combinations(range(L, R+1), 2):
        mini = min(mini, i*j % mod)
        if mini == 0:
            break
    print(mini)

Verdicts: Runtime Error

Runtime Error

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())
s=set()
for i in range(l+1, r):
    s.add(i%2019)
s=list(s)

ans=math.inf
for i in range(len(s)):
    for j in range(i+1, len(s)):
        ans=min(ans, (s[i]*s[j])%2019)

print(ans)


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

if r-l > 2019:
    s=list(range(0, 2019))
else:
    s=set()
    for i in range(l, r+1):
        s.add(i%2019)
    s=list(s)

ans=float('inf')
for i in range(len(s)):
    for j in range(i+1, len(s)):
        ans=min(ans, (s[i]*s[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):
L, R=map(int, input().split())
mod=2019
A=[0]*(R-L+1)
for i in range(L, R+1):
  A[i]=i%mod
  
A=sorted(A)
print((A[0]*A[1])%mod)

L, R=map(int, input().split())
mod=2019
A=[0]*(R-L+1)
for i in range(L. R+1):
  A[i]=i%mod
  
A=sorted(A)
print((A[0]*A[1])%mod)

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(i+1,R+1):
        ans=min(ans, (i*j)%2019)
print(ans)

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):
x,y = map(int,input().split())


gap = y-x
F = 0
t = x%2019
e = y%2019

tq = x%673
eq = y%673

m = min(t,e)
M = max(t,e)

mq = min(tq,eq)
Mq = max(tq,eq)

t2 = 2200
t1 = (m*(m+1))%2019
if gap > 672:
    t2 = 0
if gap > 2 and (eq < tq):
    t2 = 0

k = 1 
if gap <= 2:
    for i in range(x,y+1):
        k*=i
k = k%2019

print(min(t1,t2,k))

l,r = list(map(int,input().split()))
a = 201900000
if r-l > 2018:
    a= 0

l %= 2019
r %= 2019

L = min(l,r)
R = max(l,r)

# print(L,R)
for i in range(L,R+1):
    for j in range(i+1,R+1):
        a = min(a,(i*j)%2019)

print(a)


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)
else:
    i_l=[]
    for i in range(l,r):
        for j in (i+1,r+1):
        i_l.append((i%2019*j%2019)%2019)
    print(min(i_l))
           

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

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

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())
r = r % 2019
l = l % 2019
if r<l:
    r = r+2019
print(l, r)
mod = 2019
for i in range(l, r):
    for j in range(i+1, r+1):
        mod = min(mod, (i * j) % 2019)

print(mod)

l,r=map(int,input().split())
mod=2019
if r - l >= 2019:
    print("0")
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            mod = min(mod, (i*j)%2019)
    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 = [int(x) for x in input().split()]

l_mod = l % 2019
r_mod = l_mod + (r - l + 1) % 2019 - 1

for i in range(l_mod, r_mod):
    for j in range(i + 1, r_mod + 1):
        tmp = (i * j) % 2019
        if (i = l_mod and j = i + 1) or tmp < ans:
            ans = tmp

print(ans)

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

l_mod = l % 2019
if r - l >= 2019:
    r_mod = l_mod + (r - l - 2019) % 2019 + 2019
else:
    r_mod = l_mod + (r - l) % 2019

ans = 2019
for i in range(l_mod, r_mod):
    for j in range(i + 1, r_mod + 1):
        tmp = (i * j) % 2019
        if tmp < ans:
            ans = tmp

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):
L, R = map(int, input().split())
MOD = 2019

def f(i, j):
    if j - i >= MOD:
        return 0
    i %= MOD
    j %= MOD
    if i > j:
        return 0
    ans = 2018
    for a in range(i, j):
        for b in range(a+1, j+1):
            ans = min(ans, a*b%MOD)

print(f(L,R))



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

def f(i, j):
    if j - i >= MOD:
        return 0
    i %= MOD
    j %= MOD
    if i > j:
        return 0
    ans = 2018
    for a in range(i, j):
        for b in range(a+1, j+1):
            ans = min(ans, a*b%MOD)
    return ans

print(f(L,R))



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-R > 2018:
    print(0)
else:
    minMod = 100000000
    for i in range(L,R):

        for j in range(i+1,R+1):
   
            if tmp == 0:
      			minMod = tmp
        		break
    		elif minMod > (i*j)%2019:
                minMod = (i*j)%2019
        	
    print(minMod)


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

if L-R > 672:
    print(0)
else:
    minMod = 100000000
    for i in range(L,R):
        for j in range(i+1,R+1):
            tmp = (i*j)%2019
            if minMod > tmp:
                minMod = tmp
            elif tmp == 0:
                minMod = 0 
                break
    print(minMod)


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

if R-L > 672:
    print(0)
else:
    minMod = 2019
    for i in range(L,R):
        for j in range(i+1,R+1):
            tmp = (i*j)%2019
            if tmp == 0:
                minMod = 0
                break
            minMod = min(tmp,minMod)
    print(minMod)
    


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):
l,r = map(int,input().split())
mod = 2019
min_2019 = min(2019,r-l)
min = 10**9
for i in range(l,min_2019+l):
    j = i+1
    print(i,j)
    if min > (i*j)%mod:
        min = (i*j)%mod

print(min)

l,r = map(int,input().split())
mod = 2019
min = 10**9
c = 0
for i in range(l,r):
    for j in range(l+1,r+1):
        if (i*j)%mod < min:
            min = (i*j)%mod
    
        if min == 0:
            break
    if min == 0:
        break

print(min)

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):
# coding: utf-8
# Your code here!
import heapq
 
L,R=map(int,input().split())
 
ans=2018*2017
if (R-L)>=2019:
    print("0")
else:
    l=list(range(L,R+1))
    for i in range(len(l)):
        for j in range(i+1,len(l)):
            print(l[i],l[j])
            ans=min(ans,(l[i]*l[j])%2019)
            

print(ans)
    

# coding: utf-8
# Your code here!
import heapq
 
L,R=map(int,input().split())
 
ans=2018*2017
if (R-L)>=2019:
    print("0")
else:
    l=list(range(L,R+1))
    for i in range(len(l)):
        for j in range(i,len(l)):
            ans=min(ans,(l[i]*l[j])%2019)

print(ans)
    

# coding: utf-8
# Your code here!
import heapq
 
L,R=map(int,input().split())
 
ans=2018*2017
if (R-L)>=2018:
    print("0")
else:
    l=list(range(L,R+1))
    for i in range(len(l)):
        for j in range(i+1,len(l)):
            #print(l[i],l[j],(l[i]*l[j])%2019)
            ans=min(ans,(l[i]*l[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())
ans=0
if l%2019>r%2019 or r-l>=2018:
    ans=0
else:
    if l%673>r%673 or r-l>=672:
        ans=0
    else:
        ll=l%2019
        rr=r%2019
        ans=min((rr*((r-1)%2019))%2019,(ll*((l+1)%2019)%2019)
print(ans)

l,r=map(int,input().split())
ans=l*r%2019
for i in range(l,r):
    for j in range(i+1,r+1):
        ans=min(ans,i*j%2019)
        if ans==0:
            break
    if ans==0:
        break
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):
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    for i in list(map(lambda x: x%2019,range(l,r))):
        for j in list(map(lambda x: x%2019, range(i,r+1))):
            min = minfunc((i*j)%2019,min)
    print(min)


lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    for i in list(map(lambda x: x%2019,range(l,r)):
        for j in list(map(lambda x: x%2019, range(i,r+1))):
            min = minfunc(minfunc(i,j),min)
    print(min)


lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    for i in list(map(lambda x: x%2019,range(l,r))):
        for j in list(map(lambda x: x%2019, range(i,r+1))):
            min = minfunc(minfunc(i,j),min)
    print(min)


lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:ß
    print((lmod * (lmod + 1)) % 2019)


lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    for i in list(map(lambda x: x%2019,range(l,r)):
        for j in list(map(lambda x: x%2019, range(i,r+1))):
            min = minfunc(minfunc(i,j),min)


import sys
lr = list(map(int, input().split()))
l = lr[0]
r = lr[1]
lmod = l%2019

def minfunc(x, y):
    if x > y:
        return y
    else:
        return x

if r - l >= 2019:
    print(0)
elif 2019 <= r - l + lmod:
    print(0)
else:
    min = 9999999
    modlist = list(map(lambda x: x%2019,range(l,r+1)))
    for i in range(r-l):
        for j in range(i+1, r-l+1):
            min = minfunc((modlist[i]*modlist[j])%2019,min)
    print(min)


Verdicts: Wrong Answer

Runtime Error

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 = list(map(int, input().split()))

if R - L > 2019:
    print("0")
else:
    A =[]
    for i in range(L ,R):
            for j in range(L+1,R+1):
                b = i*j % 2019
                A.append(b)
                ans = min(A) 
                print(ans)

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

A =[]
for i in range(L ,R):
    for j in range(L+1,R+1):
        print(i,j)
        b = i*j % 2019
        A.append(b)
ans = min(A) 
print(ans)

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

if R - L > 2019:
    print("0")
else:
    A =[]
    for i in range(L ,R):
            for j in range(L+1,R+1):
                b = i*j % 2019
                A.append(b)
    ans = min(A) 
    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 abs(L-R)>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 abs(L-R)>2019:
    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

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())
R = min(R, L+2019)
print(min([i * j % 2019 for i in range(L, R+1) for jj in range(i+1, R+1)]))


L, R = map(int, input().split())
R = min(R, L+2019)
print(min([i * j % 2019 for i in range(L, R+1) for j in range(i+1, R+1)]))


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())
if L*(L+1)<2019:
  print(L*(L+1))
  
else:
  if R == L+1:
    print(R*L%2019)
  else:
    r =673 - L % 673
    if L+r <= R:
      print("0")
    else:
      print(L*L+1%2019)
    
    

L,R=map(int,input().split())
if L*(L+1)<2019:
  print(L*(L+1))
  
else:
  if R == L+1:
    print(R*L%2019)
  else:
    r =673 - L % 673
    if L+r <= R:
      print("0")
    else:
      print(L*L+1)
    
    

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

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

if R*(R-1)<2019:
  print(R*(R-1))
  exit(0)
else:
  if R == L+1:
    print((R*L)%2019)
    exit(0)
  else:
    r =673 - L % 673
    if L+r <= R:
      print("0")
      exit(0)
    else:
      for i in range(L,R+1):
        for j in range(i+1,R+1):
          if (i*j)%2019 < ans:
            ans = (i*j) % 2019
            if ans == 0:
              break
print(ans)

Verdicts: Wrong Answer

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):
def LI():
    return list(map(int, input().split()))


L, R = LI()
ans = 2020
for i in range(L, min(R, L+L)):
    x = (i*i) % 2019
    for j in range(i, R+1):
        y = (i*j) % 2019
        ans = min(ans, x)
        if x == y:
            break
    if ans == 0:
        break
print(ans)


def LI():
    return list(map(int, input().split()))


L, R = LI()
ans = 2020
for i in range(L, R+1):
    x = (i*i) % 2019
    for j in range(i, R+1):
        y = (i*j) % 2019
        ans = min(ans, x)
        if x == y:
            break
    if ans == 0:
        break
print(ans)


def LI():
    return list(map(int, input().split()))


L, R = LI()
ans = 2020
for i in range(L, R+1):
    x = (i*i) % 2019
    for j in range(i, R+1):
        y = (i*j) % 2019
        ans = min(ans, y)
        if x == y:
            break
    if ans == 0:
        break
print(ans)


def LI():
    return list(map(int, input().split()))


L, R = LI()
ans = 2020
for i in range(L, R+1):
    x = (i*i) % 2019
    for j in range(i, R+1):
        y = (i*j) % 2019
        ans = min(ans, y)
        if ans == 0:
            break
print(ans)


def LI():
    return list(map(int, input().split()))


L, R = LI()
ans = 2020
for i in range(L, R+1):
    for j in range(i+1, R+1):
        y = (i*j) % 2019
        ans = min(ans, y)
        if ans == 0:
            break
    if ans == 0:
        break
print(ans)


Verdicts: 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=map(int,input().split())
MOD=2019
l,r=L%MOD,R%MOD
if R>=L+2018:print(0)
elif l>=r:print(0)
else:
    ans=MOD
    for i in range(l,r-1):
        for j in range(i+1,r):ans=min(ans,((i+1)*(j+1)%MOD))
    print(ans)

L,R=map(int,input().split())
MOD=2019
l,r=L%MOD,R%MOD
if R>=L+2018:print(0)
elif l>=r:print(0)
else:
    ans=MOD
    for i in range(l,r):
        for j in range(i+1,r+1):ans=min(ans,((i*j)%MOD))
    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):
print(0)


L, R = map(int, input().split())
if R - L >= 2018:
	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: 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())

res = 2018
R2 = min(R+1, L+2019)
for i in range(L, R2):
  for j in range(i+1, R2):
    res = min(res, ((i % 2019) * (j % 2019)) % 2019)
    if res == 0:
      break

      print(res)


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

res = 2018
R2 = min(R+1, L+2019)
for i in range(L, R2):
  for j in range(i+1, R2):
    res = min(res, ((i % 2019) * (j % 2019)) % 2019)
    if res == 0:
      break

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())
min1=2018
if r-l>=2018:
  print(0)
  exit()
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      min=min(i*j%2019,min1)
print(min1)
      


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

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

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):
l,r=map(int,input().split())
i=l//2019
d=list(range(l,r+1))
for j in range(len(d)):
    d[j]%=2019
    d2=sorted(d)
    print(d2[0]*d2[1])


l,r=map(int,input().split())
x=l//2019
if 2019*x<l and r<2019*(x+1):
    ans=float("inf")
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans=min(ans,(i*j)%2019)
    print(ans)
else:
    print(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):
l, r = [int(i) for i in input.split()]

if l//2019 == r//2019:
  print(l*(l+1)%2019)
  
else:
  print(0)
  

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

if l//2019 == r//2019:
  min_mod = 2017*2018
  for i in range(l, r):
    for j in range(l+1, r+1):
      temp = (i*j)%2019
      if temp < min_mod:
        min_mod = temp
  print(min_mod)
  
else:
  print(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):
a = input().split()
a = [int(i) for i in a]

a[0] = a[0] % 2019
a[1] = a[1] % 2019

print((a[0] * a[1]) % 2019)

a = input().split()
a = [int(i) for i in a]
if (a[0] < 2019 and a[1] >= 2019) or (a[0] <= 2019 and a[1] >= 2019):
    print(0)
else:
    print((a[0] % 2019) * (a[1] % 2019) % 2019)

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

a[0] = a[0] % 2019
a[1] = a[0] % 2019

print((a[0] * a[1]) % 2019)

a = input().split()
a = [int(i) for i in a]
a = sorted(a)
if a[0] + 2019 <= a[1]:
    print(0)
else:
    b_1 = [i for i in range(a[0], a[1] + 1)]
    c = [i % 2019 for i in b_1]
    c = sorted(c)
    epoc = 2019
    for i in range(len(c)):
        for u in range(i):
            epoc1 = (c[i] * c[u]) % 2019
            if epoc1 < epoc:
                epoc = epoc1

    print(epoc)
    

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())
min = L*(L+1)%2019
a = L
b = L +1
if(R > L + 2019):
    R = L + 2019
for i in range(L,R+1):
    for j in range(i+1,R+1):
        if(i<j):
            if(min > (i*j)%2019):
                min = (i*j)%2019
                a = i
                b = j
        if(min == 0):
            break
    if(min==0):
        break
print(a,b,min)

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

L,R = map(int,input().split())
min = L*(L+1)%2019
a = L
b = L +1
if(R > L + 2019):
    R = L + 2019
for i in range(L,R+1):
    for j in range(i+1,R+1):
        if(i<j):
            if(min > (i*j)%2019):
                min = (i*j)%2019
                a = i
                b = j
        if(min == 0):
            break
    if(min==0):
        break
print(min)

Verdicts: 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())
A=[]
for i in range(L,R+1):
  for j in range(i,R+1):
    A.append(i*j%2019)
print(min(A))

L,R=map(int,input().split())
A=[]
for i in range(L,R+1):
  for j in range(i,R+1):
    A.append(i*j)
print(min(A))

L,R=map(int,input().split())
A=[]
R=min(R,L+2019)
for i in range(L,R+1):
  for j in range(i+1,R+1):
    A.append((i*j)%2019)
print(min(A))

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)
    exit()

ans=int(10000000)
for i in range(l,r):
    for j in range(j+1,r+1):
        if ans>i*j:
            ans=i*j

print(ans)

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

ans=int(10000000)
for i in range(l,r):
    for j in range(i+1,r+1):
        if ans>i*j:
            ans=i*j

print(ans)

l,r=map(int,input().split())
ans=int(10000000)
if r-l>2019:
    print(0)
    exit()

for i in range(l,r):
    for j in range(i+1,r+1):
        now=int((i*j)%2019)
        if ans>now:
            ans=now

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())
m = 2019
l, r = l%m, l%m+(r-l)
if r-l >= m-1:
    print(0)

mi = 2018
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            m = (i*j)%2019
            mi = min(m, mi)
    print(mi)


l, r = map(int, input().split())
m = 2019
l, r = l%m, l%m+(r-l)
if r-l >= m-1:
    print(0)

else:
    mi = 2018
    for i in range(l, r):
        for j in range(i+1, r+1):
            m = (i*j)%2019
            mi = min(m, mi)
    print(mi)


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())

hasamu=R-L
kotae=10000
if hasamu>2017:
  kotae=0

for i in range(L,R):
  for j in range(i+1,R+1):
    seki=i*j
    amari=seki%2019
    if amari<kotae:
      kotae=amari
print(kotae)
  


L2, R2= map(int, input().split())

L=L2%2019
R=R2%2019

hasamu=R2-L2
kotae=10000
if hasamu>2017:
  kotae=0
if L>R:
  kotae=0
else:
  for i in range(L,R):
    for j in range(i+1,R+1):
      seki=i*j
      amari=seki%2019
      if amari<kotae:
        kotae=amari
print(kotae)
  


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 atexit
# import io
import sys
#
 _INPUT_LINES = sys.stdin.read().splitlines()
 input = iter(_INPUT_LINES).__next__
 _OUTPUT_BUFFER = io.StringIO()
 sys.stdout = _OUTPUT_BUFFER
#

 @atexit.register
 def write():
     sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

import math
R = lambda : map(int,input().split())
import math
ans = sys.maxsize
n,k = R()
for i in range(n,k+1):
    for j in range(i+1,k+1):
        ans = min(ans,(i*j)%2019)
        if ans==0:
          print(ans)
          exit()

print(ans)

import atexit
import io
import sys

# _INPUT_LINES = sys.stdin.read().splitlines()
# input = iter(_INPUT_LINES).__next__
# _OUTPUT_BUFFER = io.StringIO()
# sys.stdout = _OUTPUT_BUFFER
#
#
# @atexit.register

#     sys.__stdout__.write(_OUTPUT_BUFFER.getvalue())

import math
R = lambda : map(int,input().split())
ans = sys.maxsize
n,k = R()
for i in range(n,k):
    for j in range(i+1,k+1):
        ans = min(ans,(i*j)%2019)
        if ans==0:
            print(ans)
            exit()

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):
i,j=map(int,input().split())

i%=2019;j%=2019

j+=2019
  
ans=2019

for x in range (i,j+1):
  for y in range (x+1,j+1):
    ans=min(ans,x*y%2019)
  
print(int(ans))


i,j=map(int,input().split())

i%=2019;j%=2019

if(i>j):j+=2019
  
ans=2019

for x in range (i,j+1):
  for y in range (x,j+1):
    ans=min(ans,x*y%2019)
  
print(int(ans))

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

a=0
if r-l<2019:
  a=min([x*y%2019 for x in range(l,r+1) for y in range(x+1,r+1)])
print(a)

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())
num2019 = r//2019 - l//2019
ans = 9999999999
if num2019>=1 or l == 0 or l%2019 ==0:
    ans = 0
else:
    modr = r%2019
    modl = l%2019
    for i in range(l,r):
        tmp = (i*(i+1))%2019
    ans = min(ans,tmp)
print(ans)

l,r = map(int,input().split())
num2019 = r//2019 - l//2019
ans = 9999999999
if num2019>=1 or l == 0 or l%2019 ==0:
    ans = 0
else:
    modr = r%2019
    modl = l%2019
    for a in range(l,r+1):
        for b in range(a+1,r+1):
            tmp = (a*b)%2019
            ans = min(ans,tmp)
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):
left, right = map(int, input().split())
mod = 2019

left %= mod

if right >= mod:
    right = (right % mod) + mod
else:
    right %= mod

min_mod = float("inf")
for i in range(left, right):
    for j in range(i + 1, right + 1):
        curr_mod = i * j % mod
        min_mod = min(min_mod, curr_mod)
        if min_mod == 0:
            break

print(min_mod)


left, right = map(int, input().split())
mod = 2019

min_mod = float("inf")
for i in range(left, min(right, left + mod)):
    for j in range(i + 1, min(right + 1, i + 1 + mod)):
        curr_mod = i * j % mod
        min_mod = min(min_mod, curr_mod)
        if min_mod == 0:
            break

print(min_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=[int(_) for _ in input().split()]
if R-L>2018:
    print(2018*2018)
else:
    ans=0
    for i in range(L,R+1):
        ans=max([ans,i])
    print(ans*ans)

import itertools
L, R = [int(_) for _ in input().split()]
if R - L > 2017 or L % 2019 > R % 2019:
    print(0)
    exit()

L %= 2019
R %= 2019
ans = min(i * j % 2019 for i, j in itertools.combinations(range(L, R + 1), 2))
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(_) for _ in input().split() ]

if l > 2018:
    l = l%2019
if r > 2018:
    l = l%2019    

ls = [2018]

for i in range(l,r):
    for j in range(i+1,r+1):
        if (i*j) % 2019 < min(x%2019 for x in ls):
            ls.append(i*j)
        
print(min([ x%2019 for x in ls]))

#ABC 133 Remainder Minimization 2019
l, r = [ int(_) for _ in input().split() ]

ls = [2018]

for i in range(l,r):
    for j in range(i+1,r+1):
        y = (i*j) % 2019
        if y < min(x for x in ls):
            ls.append(y)
        if y == 0:
            break
    if y == 0:
        break
    
print(min([ x for x in ls]))

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 = L // 2019
M = R // 2019 
print(m, M)

if m == M:
    ans = ((L - (2019 * m)) * (L- (2019 * m) + 1)) % 2019
    print(ans)
else: 
    print(0)


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

mod_list = []
mul_list = []
if R >= L + 2019:
    print(0)
else: 
    for i in range(L, R+1):
        if i % 2019 == 0:
            print(0)
            break
        else:
            mod_list.append(i)
    else: 
        for i in range(len(mod_list)):
            for j in range(len(mod_list)):
                if i != j: 
                    k = (mod_list[i] * mod_list[j]) % 2019
                    mul_list.append(k)
                else:
                    pass

        print(min(mul_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):
inp = input().split()
l = int(inp[0])
r = int(inp[1])

int_list_pre = list(range(l,r+1))
int_list = [s%2019 for s in int_list_pre]
print(int_list)
l = len(int_list)
min_mod = 2018

for i in range(l):
    for j in range(l):
        if j > i:
            compare = (int_list[i] * int_list[j])%2019
            if compare < min_mod:
                min_mod = compare


print(min_mod)


inp = input().split()
l = int(inp[0])
r = int(inp[1])

if r - l > 2019:
    print(0)
else:
    int_list_pre = list(range(l,r+1))
    int_list = [s%2019 for s in int_list_pre]
    l_l = len(int_list)
    min_mod = 2018

    for i in range(l_l):
        for j in range(l_l):
            if j > i:
                compare = (int_list[i] * int_list[j])%2019
                if compare < min_mod:
                    min_mod = compare


    print(min_mod)



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):
i,j=map(int,input().split())
if j-i>=2019:
  print(0)
elif j%2019<i%2019:
  print(0)
else:
  min=2018
  for p in range(i,j):
    for q in range(p,j+1):
      if ((p%2019)*(q%2019))%2019<min:
        min=((p%2019)*(q%2019))%2019
  print(min)

i,j=map(int,input().split())
if j-i>=2019:
  print(0)
elif j%2019<i%2019:
  print(0)
else:
  min=2018
  for p in range(i,j):
    for q in range(p+1,j+1):
      if ((p%2019)*(q%2019))%2019<min:
        min=((p%2019)*(q%2019))%2019
  print(min)

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 = 0
J = 0
now = 0
mod = 2019
for i in range(R-L):
    if(i % 2019 == 0):
        mod = 0
        break
    for j in range(R-L-i):
        if (j % 2019 == 0):
            mod = 0
            break
        I = L + i
        J = L + i + j + 1
        now = (I * J) % 2019
        if(now < mod):
            mod = now

print(mod)




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

I = 0
J = 0
now = 0
mod = 2019

end = 0

for i in range(R-L):
    if(L+i % 2019 == 0 or end == 1):
        mod = 0
        break
    for j in range(R-L-i):
        if (L + i + j + 1 % 2019 == 0):
            mod = 0
            break
        I = L + i
        J = L + i + j + 1
        now = (I * J) % 2019
        if(now < mod):
            mod = now
        if(mod == 0):
            end += 1
            break

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):
import sys
L, R = map(int, input().split())
ans = []

def calc_mod(x, y):
    return x * y % 2019

left = L % 2019
right = R % 2019

if left==0 or right==0:
    print(0)
    sys.exit(0)

elif left > right:
    right += 2019

for i in range(left, right):
    for j in range(1, right+1):
        ans.append(calc_mod(i, j))

print(min(ans))

import sys
L, R = map(int, input().split())
ans = []

def calc_mod(x, y):
    return x * y % 2019

left = L % 2019
right = R % 2019

if R-L > 2019:
    print(0)
    sys.exit(0)

elif left > right:
    print(0)
    sys.exit(0)

elif left==0 or right==0:
    print(0)
    sys.exit(0)

for i in range(left, right):
    for j in range(i+1, right+1):
        x = calc_mod(i, j)
        if x==0:
            print(0)
            sys.exit(0)
        ans.append(x)

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):
a=int(input())
b=int(input())
c=((a)*(a+1))%2019
print(c

l, r = map(int, input().split())
nums_of_2019 = r//2019 - (l-1)//2019
if nums_of_2019 >= 2:
    print(0)
else:
    min_num = 2020
    for i in range(l,r):
        for j in range(i+1,r+1):
            min_num = min(min_num, (i*j)%2019)
    
    print(min_num)

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,C,D = map(int,input().split())

count = 0

for i in range(A,B+1):
    if not i % C == 0:
        if not i % D ==0:
            count += 1

print(count)

#! python3
#  solve_133C.py

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

ans = 3000

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

Verdicts: Runtime Error

Accepted