Problem:


Score : 300 points

Problem Statement

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.

Constraints

All values in input are integers.

0 \leq L < R \leq 2 \times 10^9

Input

Input is given from Standard Input in the following format:

L R

Output

Print the minimum possible value of (i \times j) \mbox{ mod } 2019 when i and j are chosen under the given condition.

Sample Input 1

2020 2040

Sample Output 1

2

When (i, j) = (2020, 2021), (i \times j) \mbox{ mod } 2019  = 2.

Sample Input 2

4 5

Sample Output 2

20

We have only one choice: (i, j) = (4, 5).



Sample input:
2020 2040


Sample output:
2

Submission status: Wrong Answer

Solution code:
l,r=map(int,input().split())
ans = [0]

l = l%2019
r = r%2019

for n in range(l,r+1):
    for m in range(n+1,r+1):
        tmp = n*m%2019
        if tmp == 0:
            print(0)
            exit()
        ans.append(tmp)
print(min(ans))

Submission status: Wrong Answer

Solution code:

l,r = map(int, input().split())
waruL = l / 2019
waruR = r / 2019
if waruL < waruR :
    modMin = 0
else:
    modL = l%2019
    modR = r%2019

    for i in range(modL,modR):
        for j in range(i+1,modR+1):
            modIJ = (i*j)%2019
            if modIJ < modMin:
                modMin = modIJ
print(modMin)

Submission status: Wrong Answer

Solution code:
L,R= list(map(int, input().split()))
dis = R-L
if dis >= 2018:
    print(0)
else:
    l = L%2019
    r = R%2019
    if l < r:
        print(l*(l+1))
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
L,R= list(map(int, input().split()))
dis = R-L
if dis >= 2019:
    print(0)
else:
    l = L%2019
    r = R%2019
    if l < r:
        print(l*(l+1))
    else:
        print(0)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
la = l - l%2019
l = l%2019
r -= la
df = r%2019
if df > l:
  r = df
  ans = 1000000000
else:
  ans = 0
  print(ans)
  exit()
for i in range(l,r):
  for j in range(i+1, r+1):
    cmp = (i*j)%2019
    if cmp < ans:
      ans = cmp
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
la = l - l%2019
l = l%2019
r -= la
# rb = r%2019
# r = rb if rb > l else rb+2019
df = r%2019
if df > l:
  r = df
  ans = 100000000
else:
  ans = 0
  print(ans)
  exit()
for i in range(l,r):
  for j in range(i+1, r+1):
    cmp = (i*j)%2019
    if cmp < ans:
      ans = cmp
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
la = l - l%2019
l = l%2019
r -= la
rb = r%2019
r = rb if rb >= l else rb+2019
ans = 100000000
for i in range(l,r):
  for j in range(i+1, r+1):
    cmp = (i*j)%2019
    if cmp < ans:
      ans = cmp
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
la = l - l%2019
l = l%2019
r -= la
rb = r%2019
r = rb if rb > l else rb+2019
ans = 100000000
for i in range(l,r):
  for j in range(i+1, r+1):
    cmp = (i*j)%2019
    if cmp < ans:
      ans = cmp
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
l = l%2019 if l%2019!=0 else 2019
r = r%2019 if r%2019!=0 else 2019
print ((l*r)%2019)

Submission status: Wrong Answer

Solution code:
l,r = map(int, input().split())
modL = l%2019
modR = r%2019

if(modR <= modL):
    modMin = 0
else:
    modMin = 2018

for i in range(modL,modR):
    for j in range(i+1,modR+1):
        modIJ = (i*j)%2019
        # print(i)
        # print(j)
        # print('----')
        #print(modMin)
        #print(modIJ)
        #print('---')
        if modIJ < modMin:
            modMin = modIJ
print(modMin)

Submission status: Wrong Answer

Solution code:

l,r = map(int, input().split())
modL = l%2019
modR = r%2019

if(modR <= modL):
    modMin = 0
else:
    modMin = 2018

for i in range(modL,modR):
    for j in range(i+1,modR+1):
        modIJ = (i*j)%2019
        print(i)
        print(j)
        print('----')
        #print(modMin)
        #print(modIJ)
        #print('---')
        if modIJ < modMin:
            modMin = modIJ
print(modMin)

Submission status: Wrong Answer

Solution code:
l,r = map(int, input().split())
modL = l%2019
modR = r%2019

modMin = 2019
for i in range(modL,modR):
    for j in range(i+1,modR+1):
        modIJ = (i*j)%2019
        #print(modMin)
        #print(modIJ)
        #print('---')
        if modIJ < modMin:
            modMin = modIJ
print(modMin)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
ans = []
check = False

for i in range(L, R+1):
    if i % 2019 == 0:
        print(0)
        check = True
        break
    else:
        ans.append(i % 2019)

if not check:
    ans.sort()
    print(ans[0]*ans[1])

Submission status: Wrong Answer

Solution code:
l,r=map(int,input().split())
r1=r//2019
ans=10**10
for i in range(0,r1+1):
    if l<=2019*i and i*2019<=r:
        ans=0
        break
    else:
        if l>2019:
            ans=min(ans,(l*(l+1)%2019))
        else:
            ans=min(ans,l*(l+1))

print(ans)

Submission status: Wrong Answer

Solution code:
l,r = map(int, input().split())
min = 0

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

        ans = i*j%2019
        
        if i == l and j == l+1:
            min = ans
    
        if ans < min:
            min = ans
        
        if min == 0:
            break

    if min == 0:
        break

print(min)

Submission status: Wrong Answer

Solution code:
l,r = map(int, input().split())
min = 0

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

        ans = i*j%2019
        
        if i == l and j == l+1:
            min = ans
    
        if ans < min:
            min = ans
        
        if min == 0:
            break

    if min == 0:
        break

print(min)

Submission status: Wrong Answer

Solution code:
tmp=input().split()
l=int(tmp[0])
r=int(tmp[1])

lmod = l%2019
rmod = r%2019
min = 2019

for i in range(lmod, rmod):
  for j in range(i+1, rmod+1):
#    print(i," ", j)
    tmp = (i*j)%2019
    if tmp < min:
      min = tmp
if min == 2019:
  min = 0
print(min)

Submission status: Wrong Answer

Solution code:
tmp=input().split()
l=int(tmp[0])
r=int(tmp[1])

lmod = l%2019
rmod = r%2019
min = 2019

for i in range(lmod, rmod+1):
  for j in range(i+1, rmod+1):
#    print(i," ", j)
    tmp = (i*j)%2019
    if tmp < min:
      min = tmp
if min == 2019:
  min = 0
print(min)

Submission status: Wrong Answer

Solution code:
tmp=input().split()
l=int(tmp[0])
r=int(tmp[1])

lmod = l%2019
rmod = r%2019
min = 2018

for i in range(lmod, rmod+1):
  for j in range(i+1, rmod+1):
#    print(i," ", j)
    tmp = (i*j)%2019
    if tmp < min:
      min = tmp
print(min)

Submission status: Wrong Answer

Solution code:
tmp=input().split()
l=int(tmp[0])
r=int(tmp[1])

lmod = l%2019
rmod = r%2019
min = 2019

for i in range(lmod, rmod+1):
  for j in range(i+1, rmod+1):
    tmp = (i*j)%2019
    if tmp < min:
      min = tmp
print(min)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
b = sorted([i%2019 for i in range(l,min(r+1,l+2019))])
print(min(2018,b[0]*b[1]))

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
b = sorted([i%2019 for i in range(l,min(r+1,l+2019))])
print(b[0]*b[1])

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
b = sorted([i for i in range(l,min(r+1,l+2019))])
print(b[0]*b[1]%2019)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
if r - l >2018:
    print(0)
elif l%2019 >= r%2019:
    print(0)
else:
    b = sorted([i for i in range(l%2019,r+1)])
    print(b[0]*b[1])

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
b = sorted([i for i in range(l%2019,min(r+1,l+2020))])
print(b[0]*b[1])

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
if l-r >2020:
    print(0)
else:
    b = sorted([i%2019 for i in range(l,r+1)])
    print(b[0]*b[1])

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
b = sorted([i%2019 for i in range(l,r+1)])
print(b[0]*b[1])

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

lst = sorted(set([x % 2019 for x in  range(L, min((L + 2019 + 1),(R + 1)))]))
print(lst[0] * lst[1])

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())

lst = sorted([x % 2019 for x in  range(L, min((L + 2019 + 1),(R + 1)))])
print(lst[0] * lst[1])

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
lst = sorted([x % 2019 for x in  range(L, R + 1)])
print(lst[0] * lst[1])

Submission status: Wrong Answer

Solution code:
from heapq import heapify, heappush, heappop
l, r = map(int, input().split())

if 2018 <= r-l:
    print(0)
else:
    mods = []
    heapify(mods)
    for i in range(l, r+1):
        heappush(mods, i%2019)
    print((heappop(mods)*heappop(mods))%2019)

Submission status: Wrong Answer

Solution code:
from heapq import heapify, heappush, heappop
l, r = map(int, input().split())

if 2018 <= r-l:
    print(0)
else:
    mods = []
    heapify(mods)
    for i in range(l, r+1):
        heappush(mods, i%2019)
    print(heappop(mods)*heappop(mods))

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())

if r-l+1 >= 2019:
    print(0)
else:
    num = [i % 2019 for i in range(l, r+1)]
    if 3 in num and 673 in num:
        print(0)
    else:
        num = sorted(num)
        print((num[0]*num[1]) % 2019)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())

num = [i % 2019 for i in range(l, r+1)]
if 3 in num and 673 in num:
    print(0)
else:
    m1 = min(num)
    num.remove(m1)
    m2 = min(num)
    print((m1 * m2) % 2019)

Submission status: Wrong Answer

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

lamari = l%2019
ramari = r%2019

if r-l>=2018:
  print(0)
elif lamari < ramari:
  print(lamari*(lamari+1))
else:
  print(0)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
L = l%2019
R = r%2019
ans = 0
if l-r >= 2019:
    ans = 0
elif l-r < 2019:
    if L < R:
        ans = L*(L + 1) 
    elif R <= L:
        ans = 0
print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())

mod = 2020
for i in range(l, r, 1):
  for j in range(i + 1, r + 1, 1):
    a = (i * j) % 2019
    if a == 0:
      mod = a
      break
    elif a < mod:
      mod = a
  else:
    break

print(mod)

Submission status: Wrong Answer

Solution code:
L,R = map(int,input().split())
mod=2019
amari = R%mod
if R-amari>=L:
  print(0)
else:
  print((L%mod)*((L+1)%mod)%mod)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())

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

Submission status: Wrong Answer

Solution code:
L,R = map(int,input().split())
mod=2019
amari = R%mod
if R-amari>=L:
  print(0)
else:
  print((L%mod)*((L+1)%mod))

Submission status: Wrong Answer

Solution code:
#coding utf-8
L,R=map(int,input().split())

tmp=R//2019
ans=0
for i in range(tmp+1):
  if i*2019>=L and i*2019<=R:
    print(0)
    break
  if i==tmp:
    print((L%2019*(L+1)%2019)%2019)

Submission status: Wrong Answer

Solution code:
L, R = list(map(int, str(input()).split()))

# L と Rの差が十分に大きければ、答えは0になる
# それ以外の状況であれば愚直に計算しても大した計算量ではない。

MOD = 2019

if R - L > MOD:
    print(0)
else:
    modlist = list()
    for i in range(L, R + 1):
        modlist.append(i % MOD)
    min_1st = modlist.pop(modlist.index(min(modlist)))
    min_2nd = modlist.pop(modlist.index(min(modlist)))
    print(min_1st * min_2nd)

Submission status: Wrong Answer

Solution code:
#coding utf-8
L,R=map(int,input().split())

tmp=L//2019
ans=0
for i in range(tmp+1):
  if i*2019>=L and i*2019<=R:
    print(0)
    break
  if i==tmp:
    print((L%2019*(L+1)%2019)%2019)

Submission status: Wrong Answer

Solution code:
#coding utf-8
L,R=map(int,input().split())

tmp=L//2019
ans=0
for i in range(1,tmp+1):
  if i*2019>=L and i*2019<=R:
    print(0)
    break
  if i==tmp:
    print((L%2019*(L+1)%2019)%2019)

Submission status: Wrong Answer

Solution code:
L, R = list(map(int, str(input()).split()))

# L と Rの差が十分に大きければ、答えは1になる（4038以上の差があれば２回modが１になる）
# それ以外の状況であれば愚直に計算しても大した計算量ではない。

MOD = 2019

if R - L > MOD * 2:
    print(1)
else:
    modlist = list()
    for i in range(L, R + 1):
        modlist.append(i % MOD)
    min_1st = modlist.pop(modlist.index(min(modlist)))
    min_2nd = modlist.pop(modlist.index(min(modlist)))
    print(min_1st * min_2nd)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())

num = [i % 2019 for i in range(l, r+1)]
m1 = min(num)
num.remove(m1)
m2 = min(num)

print((m1 * m2) % 2019)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())

num = [i % 2019 for i in range(l, r+1)]
num = sorted(num)

print(num[0] * num[1])

Submission status: Wrong Answer

Solution code:
def main():
    L, R = map(int, input().split())
    if L <= 2019 and R >= 2019:
        print(0)
    else:
        left_rest = L % 2019
        right_rest = R % 2019
        start = min(left_rest, right_rest)
        last = max(left_rest, right_rest)
        rest_list = list(range(start, last+1))

        ans = 100000
        for i in range(len(rest_list)-1):
            ans = min(
                ans,
                (rest_list[i] * rest_list[i+1]) % 2019
            )
        ans = min(
            ans,
            (rest_list[-1] * rest_list[0]) % 2019
        )
        print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    L, R = map(int, input().split())
    if L <= 2019 and R >= 2019:
        print(0)
    else:
        left_rest = L % 2019
        right_rest = R % 2019
        start = min(left_rest, right_rest)
        last = max(left_rest, right_rest)
        rest_list = list(range(start, last+1))
        ans = min([(rest_list[0]*rest_list[1]) %
                   2019, rest_list[-1]*rest_list[0] % 2019])
        print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    L, R = map(int, input().split())
    first_min_rest = 1000000
    second_min_rest = 1000000
    for divided in range(L, R+1):
        rest = divided % 2019
        if rest < first_min_rest:
            second_min_rest = first_min_rest
            first_min_rest = rest
        elif rest < second_min_rest and rest > first_min_rest:
            second_min_rest = rest
        else:
            pass
    print(first_min_rest * second_min_rest)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def main():
    L, R = map(int, input().split())
    if L <= 2019 and R >= 2019:
        print(0)
    else:
        left_rest = L % 2019
        right_rest = R % 2019
        start = min(left_rest, right_rest)
        last = max(left_rest, right_rest)
        rest_list = list(range(start, last+1))
        print(rest_list[0] * rest_list[1])


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def resolve():
    l, r = map(int, input().split())

    if r - l == 1:
        print((l * r) % 2019)
        return

    if r - l + 1 >= 673 or (l % 673) > (r % 673):
        print(0)
    else:
        print((l * (l+1) % 2019))
resolve()

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
l2 = l % 2019
r2 = r % 2019
if r - l >= 2018:
    print(0)
    exit()
if l2 <= r2:
    print((l2*(l2 + 1)) % 2019)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
l2 = l % 2019
r2 = r % 2019
if r - l >= 2019:
    print(0)
    exit()
if l2 < r2:
    print((l2*(l2 + 1)) % 2019)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
l2 = l % 2019
r2 = r % 2019
if r - l >= 2019:
    print(0)
    exit()
if l2 < r2:
    print(l2*(l2 + 1) % 2019)
else:
    print(0)

Submission status: Wrong Answer

Solution code:
def resolve():
    l, r = map(int, input().split())
    if r - l + 1 >= 2019:
        print(0)

    lmod = l % 2019
    rmod = r % 2019

    if lmod > rmod:
        print(0)
    else:
        print((l % 2019) * ((l + 1) % 2019))

resolve()

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
l2 = l % 2019
r2 = r % 2019
if r - l >= 2019:
    print(0)
    exit()
if l2 < r2:
    print(l2*(l2 + 1))
else:
    print(0)

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
l2 = l % 2019
r2 = r % 2019
if r - l >= 2018:
    print(0)
    exit()
if l2 < r2:
    print(l2*(l2 + 1))
else:
    print(0)

Submission status: Wrong Answer

Solution code:

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

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

print(least)

Submission status: Wrong Answer

Solution code:

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

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

print(least)

Submission status: Wrong Answer

Solution code:

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

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

print(least)

Submission status: Wrong Answer

Solution code:

l, r = map(int, input().split())
print((l * (l+1)) % 2019)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
L, R = map(lambda x: int(x) % 2019, input().split())

if L > R:
    R, L = L, R

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

print(min_mod)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

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

	print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

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

	print(ans)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

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

print(ans)

Submission status: Wrong Answer

Solution code:
L,R = list(map(int,input().split()))
 
min = 20000000
 
#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

print(tmp,L)

for i in range(L,tmp+2):
    for j in range(i + 1,tmp+2):
        if min > (i * j) % 2019 and i <= R and j <= R and L <= i:
            min = (i * j) % 2019
            if min == 0:
                break
    if min == 0:
        break
 
print(min)

Submission status: Wrong Answer

Solution code:
L,R = list(map(int,input().split()))
 
min = 20000000
 
#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        #print(tmp)
        break
if L == 0:
     print(0)
else:
    for i in range(L,tmp+1):
        for j in range(i + 1,tmp+1):
            if min > (i * j) % 2019 and i <= R and j <= R and L <= i:
                #print((i * j) % 2019)
                min = (i * j) % 2019
                if min == 0:
                    break
        if min == 0:
            break
 
print(min)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

ans = 2019

for i in range(l,r):
	for j in range(i+1,r+1):
		temp = (i*j)%2019
		print("{} {}".format(i,j))
		if ans > temp:
			ans = temp
			if ans == 0:
				print(ans)
				exit()
if ans == 2019:
	ans = l*r
print(ans)

Submission status: Wrong Answer

Solution code:
L,R = list(map(int,input().split()))
 
min = 20000000
 
#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        print(tmp)
        break
if L == 0:
     print(0)
else:
    for i in range(L,tmp+1):
        for j in range(i + 1,tmp+1):
            if min > (i * j) % 2019 and i <= R and j <= R and L <= i:
                print((i * j) % 2019)
                min = (i * j) % 2019
                if min == 0:
                    break
        if min == 0:
            break
 
print(min)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

ans = 2019

for i in range(l,r):
	for j in range(i+1,r):
		temp = (i*j)%2019
		#print("{} {}".format(i,j))
		if ans > temp:
			ans = temp
			if ans == 0:
				print(ans)
				exit()
if ans == 2019:
	ans = l*r
print(ans)

Submission status: Wrong Answer

Solution code:
L,R = list(map(int,input().split()))
 
min = 20000000
 
#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break
 
for i in range(L,tmp+1):
    for j in range(i + 1,tmp+1):
        if min > (i * j) % 2019 and i <= R and j <= R and L <= i:
            min = (i * j) % 2019
            if min == 0:
                break
    if min == 0:
        break
 
print(min)

Submission status: Wrong Answer

Solution code:
List = list(map(int,input().split()))
L = List[0]
R = List[1]
count_dict = {}
count_list = []
if R - L >= 2019:
    print(0)
else:
    for i in range(L,R):
        for j in range(i,R+1):
            count_dict[i,j]  = (i * j) % 2019

    for i in count_dict.values():
        count_list.append(i)

    sort_list = sorted(count_list)
    print(sort_list[0])

Submission status: Wrong Answer

Solution code:
List = list(map(int,input().split()))
L = List[0]
R = List[1]
count_dict = {}
count_list = []
if R - L >= 2019:
    print(0)
else:
    for i in range(L,R+1):
        for j in range(i,R+1):
            count_dict[i,j]  = (i * j) % 2019

    for i in count_dict.values():
        count_list.append(i)

    sort_list = sorted(count_list)
    print(sort_list[0])

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())

ans = 2019

for i in range(l,r):
	for j in range(i+1,r):
		temp = (i*j)%2019
		#print("{} {}".format(i,j))
		if ans > temp:
			ans = temp
if ans == 2019:
	ans = l*r
print(ans)

Submission status: Wrong Answer

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

min = 20000000

#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

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

print(min)

Submission status: Wrong Answer

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

min = 20000000

#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

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

print(min)

Submission status: Wrong Answer

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

min = 20000000

#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

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

print(min)

Submission status: Wrong Answer

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

min = 2001

#探索範囲決め
for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

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

print(min)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
L, R = map(lambda x: int(x) % 2019, input().split())

if L > R:
    R, L = L, R

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

print(min_mod)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
L, R = map(lambda x: int(x) % 2019, input().split())

if L == 0 or R == 0:
    print(0)
    exit(0)

if L > R:
    R, L = L, R

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

print(min_mod)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
L, R = map(lambda x: int(x) % 2019, input().split())

if L == 0 or R == 0:
    print(0)
    exit(0)

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

print(min_mod)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
L, R = map(lambda x: int(x) % 2019, input().split())

if L == 0 or R == 0:
    print(0)
    exit(0)

i_condi = [x for x in range(L, R)]
j_condi = [x for x in range(L + 1, R + 1)]

min_mod = 2019
for index, i in enumerate(i_condi):
    for j in j_condi[index:]:
        min_mod = min(min_mod, (i * j) % 2019)

print(min_mod)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
L, R = map(lambda x: int(x) % 2019, input().split())

if L == 0 or R == 0:
    print(0)
    exit(0)

i_condi = [x for x in range(L, R)]
j_condi = [x for x in range(L + 1, R + 1)]

min_mod = 2019
for i, j in zip(i_condi, j_condi):
    min_mod = min(min_mod, (i * j) % 2019)

print(min_mod)

Submission status: Wrong Answer

Solution code:
def main():
    l, r = list(map(int, input().split(" ")))

    m = 3000
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            r = (i * j) % 2019
            if r < m:
                m = r
            if m == 0:
                print(m)
                return
    print(m)


main()

Submission status: Wrong Answer

Solution code:
def main():
    l, r = list(map(int, input().split(" ")))

    m = 3000
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            r = (i * j) % 2019
            if m > r:
                m = r
            if m == 0:
                print(m)
                return
    print(m)
    return


main()

Submission status: Wrong Answer

Solution code:
def main():
    l, r = list(map(int, input().split(" ")))

    m = 3000
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            r = (i * j) % 2019
            if m > r:
                m = r
            if m == 0:
                print(m)
                return
    print(m)


main()

Submission status: Wrong Answer

Solution code:
def main():
    l, r = list(map(int, input().split(" ")))

    m = 3000
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            r = (i * j) % 2019
            if r == 0:
                print(0)
                return
            if m > r:
                m = r
    print(m)


main()

Submission status: Wrong Answer

Solution code:
def main():
    l, r = list(map(int, input().split(" ")))
 
    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if r == 0:
                print(0)
                return
            m = min(m, r)
    print(m)
     
      
main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    l, r = list(map(int, input().split(" ")))
    m = 3000
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if r == 0:
                print(r)
                return
            if m > r:
                m = r
    print(m)
    return

main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    l, r = list(map(int, input().split(" ")))
    m = 2018
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if m == 0:
                print(m)
                return
            if m > r:
                m = r
    print(m)
    return

main()

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def main():
    l, r = list(map(int, input().split(" ")))
    r = min(r, 4038)
    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if m == 0:
                print(m)
                return
            if m > r:
                m = r
    print(m)
    return

main()

Submission status: Wrong Answer

Solution code:

def main():
    l, r = list(map(int, input().split(" ")))
    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if m == 0:
                print(0)
                return
            if m > r:
                m = r
    print(m)
    return

main()

Submission status: Wrong Answer

Solution code:

def main():
    l, r = list(map(int, input().split(" ")))
    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if m == 0:
                print(0)
                exit()
            if m > r:
                m = r
    print(m)
    
main()

Submission status: Wrong Answer

Solution code:

def main():
    l, r = list(map(int, input().split(" ")))
    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if r == 0:
                print(0)
                exit()
            if m > r:
                m = r
    print(m)


main()

Submission status: Wrong Answer

Solution code:

def main():
    l, r = list(map(int, input().split(" ")))
    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if r == 0:
                print(0)
                return
            if m > r:
                m = r
    print(m)


main()

Submission status: Wrong Answer

Solution code:

def main():
    l, r = list(map(int, input().split(" ")))
    if r - l > 673:
        print(0)
    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if r == 0:
                print(0)
                return
            else:
                m = min(m, r)
    print(m)


main()

Submission status: Wrong Answer

Solution code:

def main():
    l, r = list(map(int, input().split(" ")))

    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = (i*j) % 2019
            if r == 0:
                print(0)
                return
            else:
                m = min(m, r)
    print(m)


main()

Submission status: Wrong Answer

Solution code:

def main():
    l, r = list(map(int, input().split(" ")))

    m = 3000
    for i in range(l, r):
        for j in range(i+1, r+1):
            r = i*j % 2019
            if r == 0:
                print(0)
                return
            else:
                m = min(m, r)
    print(m)


main()