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:

def main():
    l, r = list(map(int, input().split(" ")))
    
    m = 3000
    for i in range(l, r):
        for j in range(i, 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:
l,r = map(int,input().split())

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if r-l >= 2019:
    print("2")
else:
    min = 2019
    for i in range(l,r+1):
        if min > i % 2019:
            min = i % 2019
        else:
            print(min*(min+1))
            break

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
 
i_rest = l % 2019
for i in range(l, r):
  i_rest_next = i % 2019
  if i_rest_next <= i_rest:
    i_rest = i_rest_next
    count_i = i
min_i = i_rest

i_rest = (count_i+1) % 2019
for i in range(count_i+1, r+1):
  i_rest_next = i % 2019
  if i_rest_next <= i_rest:
    i_rest = i_rest_next
min_j = i_rest
 
print(min_i * min_j)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
 
i_rest = l % 2019
for i in range(l, r):
  i_rest_next = i % 2019
  if i_rest_next <= i_rest:
    i_rest = i_rest_next
    count_i = i
min_i = i_rest

i_rest = (count_i+1) % 2019
for i in range(count_i+1, r+1):
  i_rest_next = i % 2019
  if i_rest_next <= i_rest:
    i_rest = i_rest_next
min_j = i_rest
 
print(min_i * min_j % 2019)

Submission status: Wrong Answer

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

i_rest = l % 2019
for i in range(l, r):
  i_rest_next = i % 2019
  if i_rest_next < i_rest:
    i_rest = i_rest_next
    
min_i = i_rest

i_rest = (l+1) % 2019
for i in range(l+1, r+1):
  i_rest_next = i % 2019
  if i_rest_next < i_rest:
    i_rest = i_rest_next

min_j = i_rest

print(min_i * min_j % 2019)

Submission status: Wrong Answer

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

i_rest = l % 2019
for i in range(l, r):
  i_rest_next = i % 2019
  if i_rest_next < i_rest:
    i_rest = i_rest_next
    
min_i = i_rest

i_rest = (l+1) % 2019
for i in range(l+1, r+1):
  i_rest_next = i % 2019
  if i_rest_next < i_rest:
    i_rest = i_rest_next

min_j = i_rest

print(min_i * min_j)

Submission status: Wrong Answer

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

min_i = min([i%2019 for i in range(l, r)])
min_j = min([j%2019 for j in range(l+1, r+1)])
print(min_i * min_j)

Submission status: Wrong Answer

Solution code:
l,r=map(int,input().split())
ans=0
if r//2019==l//2019:
    ans=(l*(l+1))%2019
print(ans)

Submission status: Wrong Answer

Solution code:
l,r=map(int,input().split())
ans=0
if r//2019==l//2019:
    ans=((l%2019)**2+(l%2019))%2019
print(ans)

Submission status: Wrong Answer

Solution code:
l,r=map(int,input().split())
ans=0
if r//2019==l//2019:
    ans=((l%2019)*((l+1)%2019))%2019
print(ans)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
if L == 0 or R - (L-1) >= 2019 or L%2019==0 or R%2019==0:
  print(0)
  exit()

ans = 2018
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 == 1:
      print(ans)
      exit()
print(ans)

Submission status: Wrong Answer

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

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

ans = 2018
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 == 1:
      print(ans)
      exit()
print(ans)

Submission status: Wrong Answer

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

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

for b in range(0, 2019):
  for i in range(L,R):
    for j in range(i+1,R+1):
      if int((R*(R-1)-b)/2019) == 0:
        if int(i*j) == int(b):
            print(b)
            exit()
      else:
        for a in range(int((R*(R-1)-b)/2019)):
          if int(i*j) == int(2019*a + b):
            print(b)
            exit()

Submission status: Wrong Answer

Solution code:
L,R=map(int,input().split())
mod=2019
start=L//mod
goal=R//mod
if start!=goal:
  print(0)
else:
  a=L%mod
  print((a*(a+1))%mod)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
for b in range(0, 2019):
  for i in range(L,R):
    for j in range(i+1,R+1):
      if int((R*(R-1)-b)/2019) == 0:
        if int(i*j) == int(b):
            print(b)
            exit()
      else:
        for a in range(int((R*(R-1)-b)/2019)):
          if int(i*j) == int(2019*a + b):
            print(b)
            exit()

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
for b in range(0, 2019):
  for i in range(L,R):
    for j in range(i+1,R+1):
      if int((R*(R-1)-b)/2019) == 0:
        if int(i*j) == int(b):
            print(b)
            exit()
      else:
        for a in range(int((R*(R-1)-b)/2019)):
          print(b,i,j,a)
          if int(i*j) == int(2019*a + b):
            print(b)
            exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
l,r = map(int,input().split())
r = min(r, l+673)
ans = 2018
for i in range(l,r):
    for j in range(l+1,r+1):
        if ans > (i%2019)*(j%2019):
            ans = (i%2019)*(j%2019)
print(ans)

Submission status: Wrong Answer

Solution code:
l,r = map(int, input().split())
mod = 2019
for i in range(l,r+1):
    if i % 2019 == 0:
        print(0)
        exit()
print(l%mod * (l+1)%mod)

Submission status: Wrong Answer

Solution code:
l,m = map(int, input().split())
mod = 2019
for i in range(l,m+1):
    if i % 2019 == 0:
        print(0)
        exit()
print(l%mod * (l+1)%mod)

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
mod1 = []
mod2 = []
for i in range(l,r+1):
  mod1.append(i%2019)
print(mod1)
for i in range(len(mod1)-1):
  for j in range(i+1,len(mod1)):
    mod2.append((mod1[i]*mod1[j])%2019)
print(mod2)
print(min(mod2))

Submission status: Wrong Answer

Solution code:
l, r = map(int, input().split())
mod1 = []
mod2 = []
for i in range(l,r+1):
  mod1.append(i%2019)
print(mod1)
for i in range(len(mod1)-1):
  for j in range(i+1,len(mod1)):
    mod2.append((mod1[i]*mod1[j])%2019)
print(mod2)
print(min(mod2))

Submission status: Wrong Answer

Solution code:
#30 ABC133C
l,r=map(int,input().split())
l%=2019
r%=2019
if l>=r:
	print(0)
else:
	res=1<<32
	for i in range(l,r+1):
		for j in range(i+1,r+1):
			res=min(res,(i*j)%2019)
	print(res)

Submission status: Wrong Answer

Solution code:
#30 ABC133C
l,r=map(int,input().split())
l%=2019
r%=2019
if l>r:
	print(0)
else:
	res=1<<32
	if l==r:
		print(l*r)
	else:
		for i in range(l,r+1):
			for j in range(i+1,r+1):
				res=min(res,(i*j)%2019)
		print(res)

Submission status: Wrong Answer

Solution code:
#30 ABC133C
l,r=map(int,input().split())
l%=2019
r%=2019
if l>r:
	print(0)
else:
	res=1<<32
	for i in range(l,r+1):
		for j in range(i+1,r+1):
			res=min(res,(i*j)%2019)
	print(res)

Submission status: Wrong Answer

Solution code:
#30 ABC133C
l,r=map(int,input().split())
l%=2019
r%=2019
if l>r:
	print(0)
else:
	res=1<<32
	for i in range(l,r+1):
		for j in range(i+1,r+1):
			res=min(res,i*j%2019)
	print(res)

Submission status: Wrong Answer

Solution code:
#30 ABC133C
l,r=map(int,input().split())
l%=2019
r%=2019
if l>r:
	print(0)
else:
	res=2018
	for i in range(l,r+1):
		for j in range(i+1,r+1):
			res=min(res,i*j%2019)
	print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
L,R=map(int,input().split())
ans=10**19
if R-L>=2019:
  print(ans)
else:
  for i in (L,R-1):
    for j in (i+1,R):
      ans=min(ans,(i*j)%2019)
  print(ans)

Submission status: Wrong Answer

Solution code:
L,R = [int(i) for i in input().split()]
list=[]
if R-L>=672:
    print(0)
else:
    for i in range(L,R+1):
        list.append(i%2019)
    else:
        print(sorted(list)[0]*sorted(list)[1]%2019)

Submission status: Wrong Answer

Solution code:
L,R = [int(i) for i in input().split()]
list=[]
if R-L>=2018:
    print(0)
else:
    for i in range(L,R+1):
        list.append(i%2019)
    else:
        print(sorted(list)[0]*sorted(list)[1])

Submission status: Wrong Answer

Solution code:
l,r=map(int,input().split())
an=(l*(l+1))%2019

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

print(an)

Submission status: Wrong Answer

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

if (n // 2019) - (l // 2019) > 0:
	print(0)
else:
	l_s = (l * (l + 1)) % 2019
	n_s = (n * (n - 1)) % 2019
	
	if l_s <= n_s:
		print(l_s)
	else:
		print(n_s)

Submission status: Wrong Answer

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

if (n // 2019) - (l // 2019) > 0:
	print(0)
else:
	print((l * (l + 1) ) % 2019)

Submission status: Wrong Answer

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

List = []
if R-L >= 673:
    ans = 0
else:
    while L <= R:
        List.append(L%2019)
        L += 1
    List.sort()
    ans = ((List[0]*List[1])%2019)
    
print(ans)

Submission status: Wrong Answer

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

List = []
if R-L >= 5000:
    ans = 0
else:
    while L <= R:
        List.append(L%2019)
        L += 1
    List.sort()
    ans = ((List[0]*List[1])%2019)
    
print(ans)

Submission status: Wrong Answer

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

List = []
if R-L >= 2019:
    ans = 0
    print("why")
else:
    while L <= R:
        List.append(L%2019)
        L += 1
    List.sort()
    ans = ((List[0]*List[1])%2019)
    
print(ans)

Submission status: Wrong Answer

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

List = []
if R-L >= 2019:
    ans = 0
else:
    while L <= R:
        List.append(L%2019)
        L += 1
    List.sort()
    ans = ((List[0]*List[1])%2019)
    
print(ans)

Submission status: Wrong Answer

Solution code:
# Remainder Minimization 2019
L, R = map(int, input().split())
ans = 0
ans_a = 0
ans_b = 0
for i in range(L, R):
    a = i % 2019
    if ans_a == 0:
        ans_a = a
    elif ans_a > a:
        ans_a = a
    else:
        pass

for j in range(L+1, R+1):
    b = j % 2019
    if ans_b == 0:
        ans_b = b
    elif ans_b > b:
        ans_b = b
    else:
        pass

ans = ans_a * ans_b
print(ans)

Submission status: Wrong Answer

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

List = []
if R-L >= 2019:
    ans = 0
else:
    while L <= R:
        List.append(L%2019)
        L += 1
    List.sort()
    ans = (List[0]*List[1]%2019)
    
print(ans)

Submission status: Wrong Answer

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

ans = 0
ans_a = 0
ans_b = 0
for i in range(L, R):
    a = i % 2019
    if ans_a == 0:
        ans_a = a
    elif ans_a >= a:
        ans_a = a
    else:
        pass

for j in range(L+1, R+1):
    b = j % 2019
    if ans_b == 0:
        ans_b = b
    elif ans_b >= b:
        ans_b = b
    else:
        pass

ans = ans_a * ans_b
print(ans)

Submission status: Wrong Answer

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

List = []
if R-L > 2019:
    ans = 0
else:
    while L <= R:
        List.append(L%2019)
        L += 1
    List.sort()
    ans = List[0]*List[1]
    
print(ans)

Submission status: Wrong Answer

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

List = []
if R-L >= 2019:
    ans = 0
else:
    while L <= R:
        List.append(L%2019)
        L += 1
    List.sort()
    ans = List[0]*List[1]
    
print(ans)

Submission status: Wrong Answer

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

A = 0
ans = 0
ans_a = 0
ans_b = 0
for i in range(L, R):
    a = i % 2019
    if ans_a == 0:
        ans_a = a
    elif ans_a >= a:
        ans_a = a
    else:
        pass

for j in range(L+1, R+1):
    b = j % 2019
    if ans_b == 0:
        ans_b = b
    elif ans_b >= b:
        ans_b = b
    else:
        pass

print(ans_a*ans_b)

Submission status: Wrong Answer

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

A = 0
ans = 0
for i in range(L, R):
    j = i
    while j <= R:
        j = j + 1
        A = (i * j) % 2019
        if ans == 0:
            ans = A
        elif ans >= A:
            ans = A
        else:
            pass

print(ans)

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
L, R = (int(a) for a in input().split())

minimum = 2019

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

Submission status: Wrong Answer

Solution code:
L, R = (int(a) for a in input().split())

minimum = 2019

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

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

mod = [x % 2019 for x in range(L, R+1)]
minmod = min(mod)
print((minmod*(minmod+1))%2019)

Submission status: Wrong Answer

Solution code:
l, r = map(int,input().split())
min_val = float('inf')
for i in range(l,r):
  for j in range(l+1, r+1):
    min_val = min(min_val, (i*j)%2019)
    if min_val==2:
      break
print(min_val)

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
if R < 2019:
    print(L * (L+1))
elif L<=2019 and 2019 <= R:
    print(0)
else:
    if R - L > 2019:
        print(0)
    else:
        modL = L % 2019
        modR = R % 2019
        if modL< modR:
            print(modL * ((L + 1) % 2019))
        else:
            print(0)

Submission status: Wrong Answer

Solution code:
# c
L, R = map(int, input().split())
if R < 2019:
    print(L * (L+1))
elif L<=2019 and 2019 <= R:
    print(0)
else:
    m = []
    for i in range(L,R+1):
        m.append(i%2019)
    firstm = min(m)
    m.remove(firstm)
    secondm = min(m)
    print (firstm * secondm)

Submission status: Wrong Answer

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

m = 2018

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

if R < L:
    R +=2019

for l in range(L,R):
    for r in range(l+1,R+1):
        m = min(m,l*r%2019)

print(m)

Submission status: Wrong Answer

Solution code:
[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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    l, r = map(int, input().split())
    m = (r // 2019) * 2019
    if l <= m <= r:
        print(0)
        return
    print((l * (l + 1)) % 2019)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

Solution code:
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)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
L, R = map(int, input().split())
mod = 2018
i = L
for j in range(i+1, R+1):
    num = i*j % 2019
    if mod > num:
        mod = num
    if mod == 0:
        break
print(mod)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
  l, r = map(int, input().split(' '))
  if r - l >= 2019:
    print(0)
  else:
    i = l + 1
    ans = l * r
    while i <= r:
      li = l * i
      if mod(li) < ans:
        ans = mod(li)
      i += 1
    print(ans)


def mod(n):
  if n < 2019:
    return n
  else:
    return(n % 2019)


if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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

arr = []
for i in range(l, r+1):
    if i * (i + 1) < 2019:
        print(i * (i + 1))
        exit()
    else:
        arr.append(i * (i + 1) % 2019)

print(min(arr))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def remainder_min(l,r):
    sml = 2*(10**9)**2+1
    _r = min(r,l+2019)
    for i in range(l,_r+1):
        j = i + 1
        num = i * j
        rem = num % 2019
        if rem == 0:
            return 0
        #print("i=%d, j=%d, i*j= %d, rem=%d" %(i,j,(i*j),rem))
        sml = min(sml,rem)
    return sml


if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)

Submission status: Wrong Answer

Solution code:
def remainder_min(l,r):
    sml = 2*(10**9)**2+1
    _r = min(r,l+2019)
    for i in range(l,_r):
        j = i + 1
        num = i * j
        rem = num % 2019
        if rem == 0:
            return 0
        #print("i=%d, j=%d, i*j= %d, rem=%d" %(i,j,(i*j),rem))
        sml = min(sml,rem)
    return sml


if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)

Submission status: Wrong Answer

Solution code:
def remainder_min(l,r):
    sml = 2*(10**9)**2+1

    for i in xrange(l,r):
        #print("----------------------------------")
        if i % 2019 == 0:
            return 0

        j = i + 1
        num = i * j
        rem = num % 2019
        #print("i=%d, j=%d, i*j= %d, rem=%d" %(i,j,(i*j),rem))
        if rem == 0:
            return 0

        if sml > rem:
            sml = rem
            #print("+")
        else:
            #print("")
            pass

    return sml


if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def remainder_min(l,r):
    sml = 2*(10**9)**2+1

    for i in xrange(l,r):
        if i % 2019 == 0:
            return 0
        for j in xrange(i+1,r+1):
            num = i * j
            rem = num % 2019
            #print("i=%d, j=%d, rem=%d" %(i,j,rem))
            if rem == 0:
                return 0

            if sml > rem:
                sml = rem
                break
            else:
                break
    return sml


if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)

Submission status: Wrong Answer

Solution code:
def remainder_min(l,r):
    sml = 2*(10**9)**2+1

    for i in xrange(l,r):
        if i % 673 == 0:
            return 0
        for j in xrange(i+1,r+1):
            num = i * j
            rem = num % 2019
            #print("i=%d, j=%d, rem=%d" %(i,j,rem))
            if rem == 0:
                return 0

            if sml > rem:
                sml = rem
                break
            else:
                break
    return sml


if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)

Submission status: Wrong Answer

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

L = L % 2019
R = R % 2019
if L > R:
  R += 2019

M = []

for i in range(L, R + 1):
  i2 = i % 2019
  for j in range(i + 1 , R + 1):
    M.append(( i2 * (j % 2019) % 2019))
             
if R == 0:
  print (0)
elif len(M) == 0:
  print(L)
elif L < 0 and R > 0:
  print (0)
else:
  print (min(M))

Submission status: Wrong Answer

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

M = []
for i in range(L % 2019, (R+1) % 2019):
  i2 = i % 2019
  for j in range((i+1) % 2019 , (R+1) % 2019):
    M.append(( i2 * (j % 2019) % 2019))
             
if R == 0:
  print (0)
elif len(M) == 0:
  print(L)
elif L < 0 and R > 0:
  print (0)
else:
  print (min(M))

Submission status: Wrong Answer

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

M = []
for i in range(L % 2019, (R+1) % 2019):
  i2 = i % 2019
  for j in range((i+1) % 2019 , (R+1) % 2019):
    M.append(( i2 * (j % 2019) % 2019))
             
if len(M) == 0:
  if R == 0:
    print (0)
  else:
    print(L)
elif L < 0 and R > 0:
  print (0)
else:
  print (min(M))

Submission status: Wrong Answer

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

M = []
for i in range(L % 2019, (R+1) % 2019):
  i2 = i % 2019
  for j in range((i+1) % 2019 , (R+1) % 2019):
    M.append(( i2 * (j % 2019) % 2019))
             
if len(M) == 0:
  if R == 0:
    print (0)
  else:
    print(L)
elif L <= 0 and R >= 0:
  print (0)
else:
  print (min(M))

Submission status: Wrong Answer

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

M = []
for i in range(L % 2019, (R+1) % 2019):
  i2 = i % 2019
  for j in range((i+1) % 2019 , (R+1) % 2019):
    M.append(( i2 * (j % 2019) % 2019))
             
if len(M) == 0:
  print(L)
#elif L < 0 and R > 0:
#  print (0)
else:
  print (min(M))

Submission status: Wrong Answer

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

L = L % 2019
R = R % 2019
if L > R:
  R = R + 2019

M = []

for i in range(L, R+1):
  i2 = i % 2019
  for j in range(i + 1, R+1):
    M.append(( i2 * (j % 2019) % 2019))

if len(M) == 0:
  print(L)
elif L < 0 and R > 0:
  print (0)
else:
  print (min(M))

Submission status: Wrong Answer

Solution code:
def remainder_min(left,right):
    left1 = left + 1
    rem = (left * left1) % 2019
    return rem


if __name__ == '__main__':
    l,r = map(int,raw_input().split())
    print remainder_min(l,r)

Submission status: Wrong Answer

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

M = []
for i in range(L % 2019, (R+1) % 2019):
  i2 = i % 2019
  for j in range((i+1) % 2019 , (R+1) % 2019):
    M.append(( i2 * (j % 2019) % 2019))
             
if len(M) == 0:
  print(L)
elif L < 0 and R > 0:
  print (0)
else:
  print (min(M))

Submission status: Wrong Answer

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

M = []
for i in range(L, R+1):
  for j in range(i+1, R+1):
    if i % 3 == 0 or j % 3 == 0:
      M.append (i * j / 3 % 673)
    else:
      M.append(i * j % 2019)
if len(M) == 0:
  print(L)
else:
  print (min(M))

Submission status: Wrong Answer

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

M = []
for i in range(L,R):
  for j in range(i+1,R):
    M.append(i * j % 2019)
if len(M) == 0:
  print(L)
else:
  print (min(M))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if R - L >= mod:
    print(0)
else:
    lm, rm = L % mod, R % mod
    arr = [i % mod for i in range(lm, lm + (R - L) + 1)]
    arr.sort()
    res = arr[0] * arr[1]
    print(res)

Submission status: Wrong Answer

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

res = 2019

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

        if b == r:
            break

    if res == 0: break

print(res % 2019)

Submission status: Wrong Answer

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

l, r = (l, r) if l < r else (r, l)

res = 2019

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

print(res % 2019)

Submission status: Wrong Answer

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

l, r = (l, r) if l < r else (r, l)

res = 2019

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

print(res)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys

MOD = 2019  # type: int

def solve(L: int, R: int):
    if(R-L >= 2018):
        print(0)
    else:
        m = 2020
        for i in range(L,R+1):
            for j in range(L+1,R+1):
                m = min(m,(i*j)%2019)
        print(m)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    L = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    solve(L, R)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys

MOD = 2019  # type: int

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


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    L = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    solve(L, R)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

ans = 2018
tmp = 0

if L + 1 == R:
	ans = (L * R) % 2019
	print(ans)
	exit()

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

print(ans)

Submission status: Wrong Answer

Solution code:
#133 11:06
L,R=map(int,input().split())
if R-L==1:#これ以外なら3の倍数が必ず入る
    print((L*R)%2019)
else:
    a=[]
    for i in range(L,R+1):
        a.append(i%2019)
    if min(a)==0:
        print(0)
    else:
        print(min(a)**2+min(a))

Submission status: Wrong Answer

Solution code:
# import numpy as np
# import copy

def main():
    l,r = [ int(i) for i in input().split(' ')]
    count = 0
    lst = []
    for i in range(l,r):
        lst.append(i%2019)
        if(count > 2020):
            break
        count = count + 1

    print(min(lst))

if __name__ == "__main__":
    main()