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

rem_l = l%2019
rem_r = r%2019

ans = -1

if r - l >= 2019:
    ans = 0

elif rem_l >= rem_r:
    ans = 0

else:
    ans = float('INF')
    for i in range(l, r):
        for j in range(i, r):
            temp = (i * j) % 2019
            if temp < ans:
                ans = temp

print(ans)


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

rem_l = l%2019
rem_r = r%2019

ans = -1

if r - l >= 2019:
    ans = 0

elif rem_l >= rem_r:
    ans = 0

else:
    ans = float('INF')
    for i in range(l, r):
        for j in raneg(i, r):
            temp = (i * j) % 2019
            if temp < ans:
                ans = temp

print(ans)


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

rem_l = l%2019
rem_r = r%2019

ans = -1

if r - l >= 2019:
    ans = 0

elif rem_l >= rem_r:
    ans = 0

else:
    ans = float('INF')
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            temp = (i * j) % 2019
            if temp < ans:
                ans = temp

print(ans)


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())
mod = 2019

l = L // mod
r = R // mod

if l != r:
    print(0)
else:
   l_ = L % mod
   r_ = R % mod
   ans = 2019
   for i in range(l_, r_):
       for j in range(i+1, r_+1):
           a = i * j % mod
           ans = min(ans, a)
           if ans == 1:
               break
        if ans == 1:
            break
   print(ans)


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

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

l,r=map(int,input().split())
s=range(l,r+1)[:2019]
print(min(i*j%2019for i in s for j in s if i<j))

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 numpy as np
L = int(input())
R = int(input())

ans = 2019*2019

if(R-L >=2019):
    print(0)
else:
    for i in range(L,R-1):
        for j in range(i+1,R):
            ans = np.minimum(ans,(i*j)%2019)
            if(ans == 0):
                print(0)
                exit()
    print(ans)

import numpy as np
S = input().split() 
L = int(S[0])
R = int(S[1])
ans = 2019*2019
if(R-L >=2019):
    print(0)
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            ans = np.minimum(ans,(i*j)%2019)
            if(ans == 0):
                print(0)
                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):
l,r = map(int, input().split())
gap = r-l

vlist = []

    v = (l+x) % 2019
    vlist.append(v)

vlist.sort()
#print(vlist)

#res = i*j % 2019
print(vlist[0]*vlist[1])

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

vlist = []
mini = 2019
xlist = []

for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)

mini = min(vlist)
for x in vlist:
    if v <= mini+1:
        xlist.append(x)
        

xlist.sort()
#print(vlist)

#res = i*j % 2019
print((xlist[0]*xlist[1])%2019)

l,r = map(int, input().split())
gap = r-l
 
vlist = []
mini = 2019
 
for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)
    if v == 0:
        print(0)
        exit()
 
vlist.sort()

mini = 2019

for i in vlist:
    for j in vlist:
        temp = i*j %2019
        mini = min(temp, mini)
        if mini == 0:
            print(0)
            exit()

print(mini)
    
#print((vlist[0]*vlist[1])%2019)
#print((vlist[0]*vlist[1])%2019)

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

vlist = []

    v = (l+x) % 2019
    vlist.append(v)

vlist.sort()
print(vlist)

#res = i*j % 2019
print(vlist[0]*vlist[1])

l,r = map(int, input().split())
gap = r-l
 
vlist = []
mini = 2019
 
for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)
    if v == 0:
        print(0)
        exit()
 
vlist.sort()

mini = 2019

for i in vlist:
    for j in vlist:
        temp = (i*j) %2019
        mini = min(temp, mini)
        if mini == 0:
            print(0)
            exit()

print(mini)
    
#print((vlist[0]*vlist[1])%2019)
#print((vlist[0]*vlist[1])%2019)

l,r = map(int, input().split())
gap = r-l
 
vlist = []
mini = 2019
 
for x in range(gap+1):
    v = (l+x) % 2019
    vlist.append(v)
    if v == 0:
        print(0)
        exit()
 
vlist.sort()

mini = 2019

for i in vlist:
    for j in vlist:
        if i==j:
            pass
        else:
            temp = (i*j) %2019
            mini = min(temp, mini)
            if mini == 0:
                print(0)
                exit()

print(mini)
    
#print((vlist[0]*vlist[1])%2019)
#print((vlist[0]*vlist[1])%2019)

Verdicts: Runtime Error

Runtime Error

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

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

l,r = list(map(int, input().split())) l  %= 2019
r %= 2019
res=2019
if r-l >= 2019:
    print(0)
else:
    for i in range(r-l+1):
        if res > l*(l+1):
            print(l*(l+1))
            break

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

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

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

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

Verdicts: 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):
n1,n2 = map(int,input().split())

n1mod = n1 % 2019
n2mod = n2 % 2019

a = (n1mod * n2mod) % 2019

print(a)

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

ilist = [False for x in range(2020)]
a=2*10**9
for i in range(R+1)[L:L+2020]:
  imod = i % 2019
  if ilist[imod]:
    continue
  ilist[imod] = True
  for j in range(R+1)[i+1:i+1+2020]:
    jmod = j % 2019
    m = (imod * jmod) % 2019
    a = min(a,m)

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


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

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


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


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: 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):
l,r=list(map(int, input().split()))
c=[0]*(r-l+1)
for i in range(l,r+1):
	c[i-l]=i%2019
minc=min(c)
print(minc*minc+1))

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

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):
#!/bin/env python3
def main():
    l,r = map(int,input().split())
    res = 0
    if r-l >= 2019:
      pass
    else:
      for i in range(l%2019,r-2019*(l//2019)):
        for j in range(i,r-2019*(l//2019)):
          res = min(res,i*j%2019)

    print(res)

main()


#!/bin/env python3
def main():
    l,r = map(int,input().split())
    res = 0
    if r-l >= 2019:
      pass
    else:
      for i in range(l%2019,r-2019*(l//2019)):
        for j in range(i+1,r-2019*(l//2019)):
          res = min(res,(i*j)%2019)

    print(res)

main()


#!/bin/env python3
def main():
    l,r = map(int,input().split())
    res = 2019
    if r-l >= 2019:
      res = 0
    else:
      for i in range(l%2019,r-2019*(l//2019)+1):
        for j in range(i+1,r-2019*(l//2019)+1):
          res = min(res,(i*j)%2019)

    print(res)

main()


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

l,r=list(map(int,input().split()))
m=2018
for i in range(l,min(r+1,l+2019)):
  for j in range(i+1,min(r+1,l+2019)):
    m=min(m,i*j%2019)
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 = [int(_) for _ in input().split()]
if L//2019 != R//2019:
    mod_min=0
else:
    mod_list=[]

    mod_min = 10**10
    for i in range(L,R):
        for j in range(i,R+1):
            if mod_min >= i*j%2019:
                mod_min = i*j%2019
                
            if mod_min == 0:
                break
        if mod_min == 0:
                break
#                 print(i,j,mod_min)
print(mod_min)

L,R = [int(_) for _ in input().split()]
if L//2019 != R//2019:
    mod_min=0
else:
    mod_list=[]

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

minimum = l%2019
maximum = r%2019

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

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

ans = 10000
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)

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):
N=list(map(int,input().split()))
#A=list(map(int,input().split()))
print((N[0]%2019)*(N[1]%2019)%2019)

N=list(map(int,input().split()))
#A=list(map(int,input().split()))
if N[1]>=((673-N[0]%673)+N[0]):
  if N[1]==N[0]+1:
    p=(N[1]*N[0])%2019
  else:
    p=0
else:
 a=N[0]%2019
 b=N[1]%2019
 max1=2018
 for i in range(a,b):
     for j in range(i+1,b+1):
         if max1>(i*j)%2019:
           max1=(i*j)%2019
 p=max1

print(p)
 



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())
if R-L>673:
    print(0)
else:
    A =[]
    if L == 0 and R-L>1:
        L = 1
    else:
        print(0)
        sys.exit()
    for i in range(R-L+1):
        n = (L+i)
        if n % 673 == 0 and (R-L+1) >= 3:
            print(0)
            sys.exit()
        else:
            A.append(n%2019)
    A.sort()
    print((A[0]*A[1])%2019)


import sys

L,R = map(int,input().split())
if R-L>673:
    print(0)
else:
    A =[]
    for i in range(R-L+1):
        n = (L+i)
        if n % 673 == 0 and (R-L+1) >= 3:
            print(0)
            sys.exit()
        else:
            A.append(n%2019)
    print(A)
    A.sort()
    print((A[0]*A[1])%2019)


import sys

L,R = map(int,input().split())
if R-L>673:
    print(0)
else:
    ans =2019
    for i in range(R-L+1):
        for j in range(R-(L+i)):
            m = L+i
            n = L+j+i+1
            ans = min(ans, m*n%2019)
            if ans == 0:
                print(ans)
                sys.exit()
    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 main():
    l,r = map(int,input().split(' '))
    tmp = 2019
    if l//2019 < r//2019:
        print(0)
    else:
        for i in range(l,r):
            if tmp > (i*(i+1))%2019:
                tmp = (i*(i+1))%2019
                if tmp == 0:
        print(tmp)

if __name__ == '__main__':
    main()

def main():
    l,r = map(int,input().split(' '))
    tmp = 2019
    if l//2019 < r//2019:
        print(0)
    else:
        for i in range(l,r):
            for j in range(i,r):
                if tmp > (i*r)%2019:
                    tmp = (i*r)%2019
        print(tmp)

if __name__ == '__main__':
    main()

def main():
    l,r = map(int,input().split(' '))
    tmp = 2019
    if l//2019 < r//2019:
        print(0)
    else:
        for i in range(l,r):
            for j in range(i+1,r+1):
                if tmp > (i*r)%2019:
                    tmp = (i*r)%2019
        print(tmp)

if __name__ == '__main__':
    main()

def main():
    l,r = map(int,input().split(' '))
    tmp = 2019
    if l//2019 < r//2019:
        print(0)
    else:
        for i in range(l,r+1):
            for j in range(i,r+1):
                if tmp > (i*r)%2019:
                    tmp = (i*r)%2019
        print(tmp)

if __name__ == '__main__':
    main()

def main():
    l,r = map(int,input().split(' '))
    tmp = 2019
    if l//2019 < r//2019:
        print(0)
    else:
        for i in range(l,r):
            for j in range(i+1,r+1):
                if tmp > (i*j)%2019:
                    tmp = (i*j)%2019
        print(tmp)

if __name__ == '__main__':
    main()

Verdicts: Runtime Error

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

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


import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# rstrip().decode('utf-8')
# INF=float("inf")
#MOD=10**9+7

# import math
#import numpy as np


# from heapq import heapify,heappop,heappush
#from math import gcd
# from fractions import gcd
# from collections import deque
# from collections import defaultdict
# from collections import Counter
# from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())


def main():
	L,R=map(int,input().split())
	ans=0
	LL, RR = L % 2019, R % 2019
	if R-L<2019 and LL<RR:
		ans=2018
		L,R=L%2019,R%2019
		for i in range(LL,RR):
			j=1
			while i+j<=RR:
				ans=min(ans,(i*(i+j))%2019)
				j+=1
	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):
def main():
    L, R = map(int, input().split())

    ans = L * R % 2019
    if R - L >= 2019
        ans = 0
    else:
        l = L % 2019
        r = R % 2019
        if l == r:
            ans = 2*l
        else:
            ans = min(l*(l+1), l*r)

    print(ans)


if __name__ == '__main__':
    main()


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

    ans = L * R % 2019
    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)


if __name__ == '__main__':
    main()


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):
b, c = map(int, input().split())
if c-b >=2018:
    print(0)
else:
    t = b%2019
    if t+(c-b+1) >= 2019:
        print(0)
    else:
        import numpy as np
        ind = [t+i for i in range(c-b+1)]
        print(np.dot(ind, np.array(ind).T)%2019)

b, c = map(int, input().split())
if c-b >=2018:
    print(0)
else:
    t = b%2019
    if t+(c-b+1) >= 2019:
        print(0)
    else:
        import numpy as np
        ind = [t+i for i in range(c-b+1)]
        print(np.min(ind*np.array(ind).reshape((len(ind),-1))%2019))


b, c = map(int, input().split())
if c-b >=2018:
    print(0)
else:
    t = b%2019
    if t+(c-b+1) >= 2019:
        print(0)
    else:
        import numpy as np
        ind = [t+i for i in range(c-b+1)]
        mask = np.array([[True if i!=j else False for i in range(len(ind))] for j in range(len(ind))])
        tmp = ind*np.array(ind).reshape((len(ind),-1))%2019
        print(np.min(tmp[mask]))

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):
from enum import Enum
from queue import Queue
import collections
import numpy as np


import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

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


from enum import Enum
from queue import Queue
import collections
import numpy as np


import sys
import math

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001

L,R = map(int,input().split())
min = BIG_NUM
if (R/2019 - L/2019)>=1.0:
    print(0)
else:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            tmp = (i*j)%2019
            if tmp < min:
                min = tmp
            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):
def solve():
    x = int(input())
    l = [i**j for i in range(1,x+1) for j in range(1,x+1) if i**j<=x]
    return max(l)
        
if __name__ == '__main__':
    print(solve())

def solve():
    l,r = map(int, input().split())
    if r-l<2019:
        arr = []
        for i in range(l,r):
            for j in range(i+1,r+1):
                if i*j%2019 == 0:
                    return 0
                arr.append(i*j%2019)
        return min(arr)
    else:
        return 0


if __name__ == '__main__':
    print(solve())

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(x) for x in input().split())
tmpmin = 2020
tmprem = i*r%2019
if l*r<2019:
    print(l*(l+1))
else:
    for i in range(l, r+1):
        for j in range(l+1, r+1):
            tmp = (i*j)%2019
            tmpnxt = (i*(j+1))%2019
            if tmp < tmpmin:
                tmpmin = tmp
            if tmp < tmpnxt:
                break
    print(tmpmin)

import sys
l, r = (int(x) for x in input().split())
tmpmin = 2019
if r-l >= 2019:
    print(0)
else:
    for i in range(l, r):
        for j in range(l+1, r+1):
            tmp = (i*j)%2019
            if tmp < tmpmin:
                tmpmin = tmp
                if tmpmin == 0:
                    print(tmpmin)
                    sys.exit()
    print(tmpmin)

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

flag = 0
min_ = 2020
for i in range(L,R):
    for j in range(i+1,R+1):
        s = (i*j) % 2019
        if s == 0:
            print('0')
            exit()
        if s < min_:
            print(i,j)
            min_ = s
print(min_)


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

flag = 0
min_ = 2020
for i in range(L,R):
    for j in range(i+1,R+1):
        s = (i*j) % 2019
        if s == 0:
            print('0')
            exit()
        if s < min_:
            min_ = s
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):
from goto import goto, label

S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    if flg == 0:
        for j in range(i+1, R+1, 1):
            mod = (i*j) % 2019
            if mod < min:
                min = mod
                if min == 0:
                    flg = 1
                    break
    elif:
        break
print(min)


from goto import goto, label

S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    if flg == 0:
        for j in range(i+1, R+1, 1):
            mod = (i*j) % 2019
            if mod < min:
                min = mod
                if min == 0:
                    flg = 1
                    break
    elif:
        break
print(min)


S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)
for i in range(L, R, 1):
    for j in range(i+1, R+1, 1):
        mod = (i*j) % 2019
        if mod < min:
            min = mod

print(mod)


from goto import goto, label

S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

for i in range(L, R, 1):
    for j in range(i+1, R+1, 1):
        mod = (i*j) % 2019
        if mod < min:
            min = mod
            if min == 0:
                goto .END
label .END
print(min)


from goto import goto, label

S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    for j in range(i+1, R+1, 1):
        mod = (i*j) % 2019
        if mod < min:
            min = mod

print(min)



S = input()

S = S.split()

L = int(S[0])
R = int(S[1])
min = 2 * (10**10)

flg = 0

for i in range(L, R, 1):
    if flg ==0:
        for j in range(i+1, R+1, 1):
            mod = (i*j) % 2019
            if mod < min:
                min = mod
                if min == 0:
                    flg = 1
                    break
    else:
        break

print(min)


Verdicts: Runtime Error

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

ans = 10 ** 9
for i in range(L, R+1):
    for j in range(i, R):
        mod = i * j % 2019
        if ans > mod:
            ans = mod
        elif mod == 0:
            ans = 0
            break
    else:
        continue
    break
print(ans)

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

ans = 10 ** 9
for i in range(L, R+1):
    for j in range(i, R):
        mod = i * j % 2019
        if ans > mod:
            ans = mod
        if ans == 0:
            break
    else:
        continue
    break
print(ans)

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

ans = 10 ** 9
for i range(L, R+1):
    for j range(i, R):
        mod = i * j % 2019
        if ans > mod:
            ans = mod
        elif mod == 0:
            ans = 0
            break
    else:
        continue
    break
print(ans)

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

ans = 10 ** 9
for i in range(L, R):
    for j in range(i+1, R+1):
        mod = i * j % 2019
        if ans > mod:
            ans = mod
        if ans == 0:
            break
    else:
        continue
    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):
l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
  
ans = (l * (l + 1)) % N
count = 0
for i in range(l,r-1):
  for j in range(l+1,r):
    if(count >= (N - 1)):
      flag = True
      break
    if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
  if flag:
    break
    
print(ans)

l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
  
ans = (l * (l + 1)) % N
count = 0
for i in range(l,r):
  for j in range(l+1,r+1):
    if(count >= (N - 1)):
      flag = True
      break
    else if(ans > (i * j) % N):
      ans = (i * j) % N
    count += 1
  if flag:
    break
    
print(ans)

l,r = input().split()
N = 2019
  
ans = (l * (l + 1)) % N;
count = 0;
for i in range(l,r-1):
  if(count >= (N - 1)) break
  for j in range(l+1,r):
    if(count >= (N - 1)) break
    if(ans > (i * j) % N) ans = (i * j) % N
    count++;
    
printf("%lu\n",ans);
return 0

l,r = input().split()
l = int(l)
r = int(r)
N = int(2019)
  
ans = N
count = 0
right = min(l + N, r)
for i in range(l,right):
  for j in range(i+1,right+1):
    ans = min(ans, (i * j) % N)
    
print(ans)


Verdicts: 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):
n = int(input())
d = list(map(int, input().split()))
d.sort()

half = int(n/2)

n1 = d[half-1]
n2 = d[half]

if n2-n1 == 0:
    print(0)
    exit()
else: 
    print(n2-n1)

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

if r-l >= 673:
    print(0)
    exit()
else:
    ans = 2018
    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())

diff = R - L

if diff < 2019:
    ans = 10 ** 10
    for i in range(R, L):
        for j in range(i+1, L+1):
            ans = min(ans, i * j % 2019)
else:
    ans = 0

print(ans)

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

a = R % 2019
b = L % 2019

if a > 2019 // 2:
    a = 2019 - a
if b > 2019 // 2:
    b = 2019 - b

print(a * (a+1) % 2019)


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

diff = R - L

if diff < 2019:
    ans = 10 ** 10
    for i in range(L, R):
        for j in range(i+1, R+1):
            ans = min(ans, i * j % 2019)
else:
    ans = 0

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

mini = (L * R) % 2019

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

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



print(mini)


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

mini = (L * R) % 2019

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

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



print(mini)

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
L,R = map(int,input().split())
mod = 2019
if R - L >= 2019:
    print(0)
else:
    m = 10**5
    for i in range(L+1,R+1):
        if L * i % mod == 0:
            print(0)
            sys.exit()
    print((L * i) % mod)

import sys
L,R = map(int,input().split())
mod = 2019
if R - L >= 2019:
    print(0)
else:
    m = 10**5
    for i in range(L+1,R+1):
        if L * i % mod == 0:
            print(0)
            sys.exit()
    print(min((L * i) % mod, 2018))

import sys
L,R = map(int,input().split())
mod = 2019
if R - L >= 2019:
    print(0)
else:
    ans = 10**8
    for i in range(L,R):
        for j in range(i+1,R+1):
            if i * j % mod == 0:
                print(0)
                sys.exit()
            ans = min(ans,(i*j)%mod)
    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):
if __name__ == '__main__':
    l, r = map(int, input().split())
    tmp = []
    for i in range(l, min(r + 1, l + 4029)):
        print(i)
        tmp.append(i % 2019)
    tmp.sort()
    print(tmp[0] * tmp[1] % 2019)


if __name__ == '__main__':
    l, r = map(int, input().split())
    if r - l >= 2018:
        print(0)
    else:
        ll = l % 2019
        rr = r - l + ll
        ans = 2019
        for i in range(ll, rr):
            for j in range(i + 1, rr + 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):
import sys
l,r = map(int,input().split())
if r-l >= 2019:
    print(0)
    sys.exit()

temp = 2019
for i in range(1,min(r-l+1,2020)):
    temp = min(temp,(l+i)%2019)
    
print(temp*(temp+1))

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

l %= 2019
r %= 2019

for i in range(l,r+1):
    for m in range(i+1,r+1):
        ans = min(ans,(i*m)%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())
if L % 2019 == 0:
    low = L // 2019
else:
    low = L // 2019 + 1
high = R // 2019
if low <= high:
    
    print(0)
else:
    print(L*(L+1))


L, R = map(int, input().split())
if L % 2019 == 0:
    low = L // 2019
else:
    low = L // 2019 + 1
high = R // 2019

if low <= high:
    
    print(0)
else:
    minmod = 2018
    for i in range(L, R):
        for j in range(i + 1, R + 1):
            temp = (i * j) % 2019
            if temp < minmod:
                minmod = temp
    print(minmod)


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())
results = []
for n in range(1):
    if diff > 2019:
        ret = 0
        break
    for i in range(L, R):
        for j in range(i+1,R+1):
            results.append((i*j)%2019)
        ret = min(results)
print(ret)

L, R = map(int, input().split())
diff = R-L
for n in range(1):
    if diff > 2019:
        ret = 0
        break
        
        [inner for outer in init for inner in outer]
    ret = min([ (i*j)%2019 for i in range(L, R) for j in range(i+1,R+1) ])
print(ret)

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())
a = (l-1)//2019
b = r/2019
if a!=b:
  print('0')
  exit()
if l<2019:
  a = l%2019
elif l>2019:
  a = l%2019
  b=(l+1)%2019
if r<2019:
  b = (l+1)%2019
elif r>2019 and l<2019:
  print('0')
  exit()
print((a*b)%2019)

l, r = map(int, input().split())
a = (l-1)//2019
b = r/2019
if a!=b:
  print('0')
  exit()
l=l%2019
r=r%2019
res=10000000000
for i in range(l, r+1):
  for j in range(i, r+1):
    temp = (i*j)%2019
    if temp<res:
      res=temp
print(res)

l, r = map(int, input().split())
a = (l-1)//2019
b = r//2019
if a!=b:
  print('0')
  exit()
l=l%2019
r=r%2019
res=2019
for i in range(l, r+1):
  for j in range(i, r+1):
    temp = (i*j)%2019
    if temp<res:
      res=temp
print(res)

l, r = map(int, input().split())
a = (l-1)//2019
b = r//2019
if a!=b:
  print('0')
  exit()
l=l%2019
r=r%2019
res=2019
for i in range(l, r+1):
  for j in range(i+1, r+1):
    temp = (i*j)%2019
    if temp<res:
      res=temp
print(res)

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

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

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


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

l,r=map(int,input().split())
c=r-l
if c>=2018:
    print(0)
else:
    for i in range(l,r-1):
        for k in range(l+1,n):
            d=2018
            if (i*k)%2019<d:
                d=(i*k)&2019
    print(d)

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


l,r=map(int,input().split())
c=r-l
if c>=2018:
    print(0)
else:
    for i in range(l,r-1):
        for k in range(l+1,n):
            c=2018
            if (i*k)%2019<c:
                c=(i*k)&2019
    print(c)

##C
l,r=map(int,input().split())
c=(r-l)
d=2018
if c>=2018:
    print(0)
else:
    for i in range(l,r-1):
        for k in range(l+1,r):
            
            if (i*k)%2019<d:
                d=(i*k)&2019
            
    print(d)



l,r=map(int,input().split())
c=r-l
if c>=2018:
    print(0)
else:
    for i in range(l,r-1):
        for k in range(l+1,r):
            d=2018
            if (i*k)%2019<d:
                d=(i*k)&2019
    print(d)

##C
l,r=map(int,input().split())
c=(r-l)
d=2018
if c>=2018:
    print(0)
else:
    for i in range(l,r):
        for k in range(l+1,r+1):
            
            if (i*k)%2019<d:
                d=(i*k)%2019
    print(d)

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

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())
s=[]
if ((r//2019)!=(l//2019)):
        a=0
    s.append(a)
elif((r-l!=1)):
    for i in range(l,r-1):
        for j in range(l+1,r):
            #print(i,j)
            a=(i*j)%2019
            #print(a)
            s.append(a)
            if (a==0):
                break
else:
    a=(l*r)%2019
    s.append(a)
print(min(s))



l,r=map(int,input().split())
s=[]
if(r-l!=1):
    for i in range(l,r-1):
        for j in range(l+1,r):
            #print(i,j)
            a=(i*j)%2019
            print(a)
            s.append(a)
            if (a==0):
                break
else:
    a=(l*r)%2019
    s.append(a)
print(min(s))



l,r=map(int,input().split())
s=[]
if ((r//2019)!=(l//2019)):
    a=0
    s.append(a)
elif((r-l!=1)):
    for i in range(l,r-1):
        for j in range(i+1,r+1):
            #print(i,j)
            a=(i*j)%2019
            #print(a)
            s.append(a)
            if (a==0):
                break
else:
    a=(l*r)%2019
    s.append(a)
print(min(s))



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):
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np



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

l = r + (l-r) % 2019

answer = 9999
for j in range(l,r+1):
    for i in range(l,j):
        a = i % 2019
        b = j % 2019
        answer = min(answer,(a*b)%2019)

print(answer)


# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np



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

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

answer = 9999
for j in range(l,r+1):
    for i in range(l,j):
        a = i % 2019
        b = j % 2019
        answer = min(answer,(a*b)%2019)

print(answer)


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):
s = input().split() 
print(s) 
print(s[0]) 
print(s[1]) 

a = int(s[0])
b = int(s[1])
m = 2019

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

print(m)



s = input().split() 

a = int(s[0])
b = int(s[1])
m = 2019

while b-a >= 2019*2:
    b-=2019

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

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

l,r = map(int, input().split())
if r-l+1>2019:
  print(0)
  exit()
L = []
for i in range(l,r):
  for j in range(i+1,r+1):
    a = i*j
    b = a%2019
    L.append(b)
    if b == 0:
      break
print(min(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):
n,m=map(int,input().split())
if m-n>=2018:
  print(0)
else:
  l=[]
  for i in range(n,m+1):
    l.append(i%2019)
  t=10000
  for i in range(len(l)):
    for j in range(len(l)):
      if t>(l[i]*l[j])%2019:
        t=(l[i]*l[j])%2019
  print(t)

n,m=map(int,input().split())
if m-n=>2018:
  print(0)
else:
  l=[]
  for i in range(n,m+1):
    l.append(i%2019)
  l=sorted(l)
  print(l[0]*l[1])

n,m=map(int,input().split())
if m-n>=2018:
  print(0)
else:
  l=[]
  for i in range(n,m+1):
    l.append(i%2019)
  t=10000
  for i in range(len(l)-1):
    for j in range(i+1,len(l)):
      if t>(l[i]*l[j])%2019:
        t=(l[i]*l[j])%2019
  print(t)


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( ))
ans = []
if r - l>=2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      tmp = i*j%2019
      ans.append(tmp)
      
pritn(mimn(ans))

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

l2 = l // 2019
r2 = r // 2019

if l2 != r2:
  print(0)
else:
  ans=2019
  for i in range(l2, r2):
    for j in range(i+1, r2 + 1):
      ans = min(ans, (i * j)  % 2019)
  print(ans)
  

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

l2 = l // 2019
r2 = r // 2019

if l2 != r2:
  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())
MOD = 2019

nl = l%MOD
diff = r-l
li1 = []
li2 = []

print(nl)

if diff>2018:
  print(0)
else:
  for i in range(diff+1):
    li1.append(nl+i)
  for j in range(len(li1)):
    for k in range(j+1,len(li1)):
      li2.append(li1[j]*li1[k]%MOD)
  print(min(li2))

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

nl = l%MOD
diff = r-l
li1 = []
li2 = []

if diff>2018:
  print(0)
else:
  for i in range(diff+1):
    li1.append(nl+i)
  for j in range(len(li1)):
    for k in range(j+1,len(li1)):
      li2.append(li1[j]*li1[k]%MOD)
  print(min(li2))

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

l=L%2019
r=R%2019

ans=0

if R-L<2019 and l<r:
    D=[]
    for i in range(l,r):
        for j in range(i+1,r+1):
            D.append((i*j)%2019)

print(ans)

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

l=L%2019
r=R%2019

ans=0

if R-L<2019 and l<r:
    D=[]
    for i in range(l,r):
        for j in range(i+1,r+1):
            D.append((i*j)%2019)
    ans=min(D)

print(ans)

Verdicts: Wrong Answer

Accepted