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

def repeat_division(n):
    while True:
        if n < 2019:
            break
        n %= 2019
    return n

l = repeat_division(L)
r = repeat_division(R)

if R - L  >= 2019:
    print(0)
elif l > r:
    print(0)
else:
    min = 2019
    for l in range(1,l+1):
        for k in range(1,r+1):
            if min > repeat_division(k *l):
                min = repeat_division(k *l)

    print(min)


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

def repeat_division(n):
    while True:
        if n < 2019:
            break
        n %= 2019
    return n

l = repeat_division(L)
r = repeat_division(R)

if R - L  >= 2019:
    print(0)
elif l > r:
    print(0)
else:
    min = 2019
    for k in range(l, r):
        for i in range(k,r+1):
            if min > repeat_division(k * i):
                min = repeat_division(k * i)
    print(min)


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

def repeat_division(n):
    while True:
        if n < 2019:
            break
        n %= 2019
    return n

l = repeat_division(L)
r = repeat_division(R)

if R - L  >= 2019:
    print(0)
elif l > r:
    print(0)
else:
    min = 2019
    for k in range(l, r):
        for i in range(k+1,r+1):
            if min > repeat_division(k * i):
                min = repeat_division(k * i)
    print(min)


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
# coding: utf-8
# Your code here!

L, R = map(int, input().split())
L_mod = L % 2019
R_mod = R % 2019
min_mod = pow(2018,2)
num = 0
print(L_mod)
print(R_mod)

if L_mod < R_mod:
    for i in range(L_mod, R_mod):
        for j in range(i + 1, R_mod + 1):
            num = (i * j) % 2019
            if min_mod > num:
                min_mod = num
elif L_mod > R_mod:
    for i in range(R_mod, L_mod):
        for j in range(i + 1, L_mod + 1):
            num = (i * j) % 2019
            if min_mod > num:
                min_mod = num
else:
    min_mod = L_mod * R_mod % 2019
print(min_mod)

# coding: utf-8
# Your code here!

L, R = map(int, input().split())
L_mod = L % 2019
R_mod = R % 2019
min_mod = pow(2018,2)
num = 0

if abs(L - R) >= 2019:
    min_mod = 0
elif L_mod < R_mod:
    for i in range(L_mod, R_mod):
        for j in range(i + 1, R_mod + 1):
            num = (i * j) % 2019
            if min_mod > num:
                min_mod = num
elif L_mod > R_mod:
    for i in range(R_mod, L_mod):
        for j in range(i + 1, L_mod + 1):
            num = (i * j) % 2019
            if min_mod > num:
                min_mod = num
else:
    min_mod = L_mod * R_mod % 2019
print(min_mod)

Verdicts: Wrong Answer

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

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

x = r // mod
line = x * mod
print(line)

if l < line < r:
    print(0)

else:
    y = l % 2019
    print((y*(y+1))%mod)

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
#coding utf-8
L,R=map(int,input().split())

tmp=2019//L
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)

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):

# C - Remainder Minimization 2019
L,R=map(int,input().split())

mod=2019

l=L%mod if L<=mod else 0
r=R%mod if R<=mod else 0
m=min(l,r)

print(m*(m+1))


# C - Remainder Minimization 2019
L,R=map(int,input().split())

mod=2019
ans=20000

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

print(ans)

Verdicts: Wrong Answer

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

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

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


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

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

left = L // 2019
right = R // 2019

if left != right:
    print(0)
else:
    left_edge = (L) * (L - 1) % 2019
    right_edge = (R) * (R - 1) % 2019
    print(min(left_edge, right_edge))


L, R = map(int, input().split())
mod = 2019
left = L // mod
right = R // mod
l_mod = L % mod
r_mod = R % mod

if left != right or l_mod == 0 or r_mod == 0:
    print(0)
else:
    ans = float('inf')
    for i in range(l_mod, r_mod):
        for j in range(i + 1, r_mod + 1):
            ans = min(ans, (i * j) % mod)
    print(ans)


Verdicts: Wrong Answer

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

Submission attempts (in order):
a, b = map(int, input().split())
print(a,b)
c = []
if b - a >= 2019:
    print(0)
else:
    for i in range(a,b):
        for j in range(i+1,b+1):
            c.append((i*j)%2019)
#print(c)
print(min(c))






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


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

l_mod = l % 2019
r_mod = r % 2019
li = []

if r - l > 2018:
    ans = 0
for i in range(l,r):
    for j in range(l,r):
        li.append((i * j) % 2019)

ans = min(li)

print(ans)

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

li = []

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

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())
n=R-L
ans=[]
if L < 2019:
    for i in range(n+1):
        l=L+i
        ans.append(l % 2019)
    a=ans.sort()
    print(a[0]*a[1])
else:
    if R < 4038:
        for i in range(n+1):
            l=L+i
            ans.append(l % 2019)
        a=ans.sort()
        print(a[0]*a[1])
    else:
        print(0)



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



Verdicts: Runtime Error

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

Submission attempts (in order):
l,r=map(int, input().split())
l%=2019
r%=2019
res = 10000000000
if(l>r):
    print(0)
else:
    for i in range(min(l,r),max(l,r)):
        for j in range(i+1, max(l,r)+1):
            print(l,r)
            res = min(res,(i*j)%2019)
    print(res)


print(0)

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

else:
    l%=2019
    r%=2019
    res = 10000000000

    for i in range(min(l,r),max(l,r)):
        for j in range(i+1, max(l,r)+1):
            res = min(res,(i*j)%2019)
    print(res)


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):
# -*- coding:utf-8 -*-


def solve():
    L, R = list(map(int, input().split()))
    MOD = 2019

    L %= MOD
    R = L+2019

    ans = MOD
    for i in range(L, R):
        for j in range(i+1, R+1):
            ans = min(ans, (i*j)%MOD)
            if ans == 0:
                print(ans)
                return
    print(ans)


if __name__ == "__main__":
    solve()


# -*- coding:utf-8 -*-

def solve():
    L, R = list(map(int, input().split()))
    MOD = 2019

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

    print(ans)


if __name__ == "__main__":
    solve()


Verdicts: Wrong Answer

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

Submission attempts (in order):
import math

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

ls = l % 2019
rs = r % 2019

dif = r / 2019 - l / 2019

#print("dif = {}".format(dif))

if (dif != 0):
    print(0)
elif (rs - ls == 1):
    print(ls*rs % 2019)
else:
    mini = []
    for i in range(ls, rs):
        mini.append(min(i * j % 2019 for j in range(ls + 1, rs)))
    print(min(mini))


import math

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

ls = l % 2019
rs = r % 2019

dif = r // 2019 - l // 2019

#print("dif = {}".format(dif))

if (dif != 0):
    print(0)
elif (r - l == 1):
    print(ls*rs % 2019)
else:
    mini = []
    for i in range(ls, rs):
        mini.append(min(i * j % 2019 for j in range(ls + 1, rs+1)))
    print(min(mini))


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 comb(n, k):
    m = 1
    if n < 2 * k:
        k = n - k
    for i in range(1, k + 1):
        m = m * (n - i + 1) / i    
    return m % 2019
L,R = map(int,input().split())
min = 999999999
lists = list(range(L,R+1))
for i in range(len(lists)):
    if min > comb(L,lists[i]) and min !=1 :
        min = comb(L,lists[i])
print(min)

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

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 r-l >= 2019:  
    ans = 0
elif r-l >= 673:  
    ans = 0
elif l <= 2019 and 2019 <= r:  
    ans = 0
elif l <= 673 and 673 <= r and r-l >= 3:  
    ans = 0
elif r-l >= (r % 2019):  
    ans = 0
elif r-l >= (r % 673) and r-l >= 3:  
    ans = 0
else:
    ans = (l*(l+1)) % 2019

print(ans)

l, r = list(map(int, input().split()))
# b = list(map(int, input().split()))
# 2019=3*673

if r-l >= 2019:  
    ans = 0
elif r-l >= 673:  
    ans = 0
elif l <= 2019 and 2019 <= r:  
    ans = 0
elif l <= 673 and 673 <= r and r-l >= 3:  
    ans = 0
elif r-l >= (r % 2019):  
    ans = 0
elif r-l >= (r % 673) and r-l >= 3:  
    ans = 0
else:
    ans = (l*(l+1)) % 2019

print(0)


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


#a = list(map(int, input().split()))
# b = list(map(int, input().split()))


# print(min(15*n, 100*(n//10+1), 100*(n//10)+15*(n % 10)))


mod = 2019
a = l//mod
b = r//mod

if b-a > 0:
    print(0)
else:
    m = 2020
    for i in range(l, r+1):
        for j in range(i+1, r+1):
            a = (i*j) % mod
            if a < m:
                m = a

    print(m)


Verdicts: Runtime Error

Wrong Answer

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

Submission attempts (in order):
L, R = map(int, input().split())
mod = 2019
mini = 2019 
count1 = 0

for i in range(L,R):
    count2 = 0
    for j in range(i+1, R+1):
        print((i % mod) * (j % mod))
        if mini > ((i % mod) * (j % mod)):
            mini = ((i % mod) * (j % mod))
        count2 += 1
        if count2 == mod:
            break
    count1 += 1
    if count1 == mod:
        break
print(mini)
    

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

L, R = map(int, input().split())
mod = 2019
mini = 2019 
count1 = 0

for i in range(L,R):
    count2 = 0
    for j in range(i+1, R+1):
        #if i == 3 and j == 673:
        #    print(i, j)
        #    print(i%mod,j%mod,(i % mod) * (j % mod))
        if mini > (((i % mod) * (j % mod)))%mod:
            mini = (((i % mod) * (j % mod))%mod)
        count2 += 1
        if count2 == mod:
            break
    count1 += 1
    if count1 == mod:
        break
print(mini)
    

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
L,R=map(int,input().split())
ans=2018
for i in range(L,R+1):
    for j in range(i+1,R+1):
        ans=min(ans,i*j%2018)
        if ans==0:
            print(0)
            exit()
print(ans)

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

minimum = 2020

R = min(R,2020)

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

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

minimum = 2020

R = min(R,2020)

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

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

Wrong Answer

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

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

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

Verdicts: Runtime Error

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

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

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

print(ans)

L, R = map(int, input().split())
MOD = 2019
l = L % MOD
r = R % MOD
ans = 2019

if l >= r or l == 0 or r == 0　or (R - L) >= 2019:
    ans = 0
else:
    for i in range(l, r):
        for j in range(l + 1, r + 1):
            if j <= i:
                continue
            else:
                ans = min(ans, i * j % MOD)

print(ans)


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

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

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

rl = r-l
l2 = l%2019
r2 = l2+rl

if rl>2019:
    print(0)
else:
    min_dif = 2019
    for j in range(l2, r2+1):
        if (l2*j)%2019 < min_dif:
            min_dif = (l2*j)%2019
    print(min_dif)


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

rl = r-l
l2 = l%2019
r2 = l2+rl

if rl>2019:
    print(0)
else:
    min_dif = 2019
    for i in range(l2, r2):
        for j in range(i+1, r2+1):
            if (i*j)%2019 < min_dif:
                min_dif = (i*j)%2019
    print(min_dif)


Verdicts: Wrong Answer

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

Submission attempts (in order):
# -*- coding: utf-8 -*-
L,R = list(map(int,input().split()))
if R-L >= 2019:
    import sys
    print(0)
    sys.exit()
mod_2019 = lambda x:x%2019
ret = 2020
ij_list = [i for i in range(L,R+1)]
for i in range(len(ij_list)):
    for j in range(i):
        k = mod_2019(ij_list[i]*ij_list[j])
        print(k)
        if k < ret:
            ret = k
print(ret)


# -*- coding: utf-8 -*-
L,R = list(map(int,input().split()))
if R-L >= 2019:
    import sys
    print(0)
    sys.exit()
mod_2019 = lambda x:x%2019
ret = 2020
ij_list = list(map(mod_2019,[i for i in range(L,R+1)]))
for i in range(len(ij_list)):
    for j in range(i):
        k = mod_2019(ij_list[i]*ij_list[j])
        print(k)
        if k < ret:
            ret = k
print(ret)


# -*- coding: utf-8 -*-
L,R = list(map(int,input().split()))
if R-L >= 2019:
    import sys
    print(0)
    sys.exit()
mod_2019 = lambda x:x%2019
ret = 2020
ij_list = [i for i in range(L,R+1)]
for i in range(len(ij_list)):
    for j in range(i):
        k = mod_2019(ij_list[i]*ij_list[j])
        if k < ret:
            ret = k
print(ret)


Verdicts: Wrong Answer

Wrong Answer

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

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

l = l%2019
r = r%2019

if l >= r:
    print(0)
else:
    ans = float('inf')
    for left in range(l, r+1):
        for right in range(left+1, r+1):
            # ans = min(ans, (left*right)%2019)
            score = (left*right)%2019
            if score < ans:
                print(f'{left}, {right}: {score}')
                ans = score
    print(ans)

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

l = l%2019
r = r%2019

if l >= r:
    print(0)
else:
    ans = float('inf')
    for left in range(l, r):
        for right in range(left+1, r+1):
            ans = min(ans, (left*right)%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(" "))
min = 1000000000000
for i in range(L%2019,(R+1)%2019 + 2019):
  for j in range(i+1,(R+1)%2019 + 2019):
    tmp = (i * j)%2019
    if min > tmp:
      min = tmp
print(min)


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


Verdicts: Wrong Answer

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

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

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

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

print( ans )

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

if R-L>2019 or L>R :
    print(0)
    exit()
if L%2019+(R-L)>=2019 :
    print(0)
    exit()
l1=L%2019
r1=R%2019

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

print( ans )

Verdicts: Wrong Answer

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

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

ans = 2019
flag = True
for i in range(L, L+2019):
    if flag:
        for j in range(i, L+2019):
            if j > R:
                flag = False
                break
            ans = min(((i % 2019) * (j % 2019)) % 2019, ans)
print(ans)


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

ans = 2019
flag = True
for i in range(L, L+2018):
    if flag:
        for j in range(i, L+2018):
            if j > R:
                flag = False
                break
            ans = min(((i % 2019) * (j % 2019)) % 2019, ans)
print(ans)


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


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
import sys
import math
import numpy as np
INF = 1000000000
MOD = 2019


def input():
    return sys.stdin.readline().rstrip()


def main():
    l, r = [int(e) for e in input().split()]
    ans = INF
    for i in range(l, min(l + MOD, r + 1)):
        for j in range(j + 1, min(l + MOD, r + 1)):
            ans = min(ans, ((i % MOD) * (j % MOD)) % MOD)
    print(ans)


main()


import sys
import math
import numpy as np
INF = 1000000000
MOD = 2019


def input():
    return sys.stdin.readline().rstrip()


def main():
    l, r = [int(e) for e in input().split()]
    ans = INF
    for i in range(l, min(l + MOD, r + 1)):
        for j in range(i + 1, min(l + MOD, r + 1)):
            ans = min(ans, ((i % MOD) * (j % MOD)) % MOD)
    print(ans)


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):
#abc133 c
L,R=map(int,input().split())
ans=0
R=min(R,L+2019*2)
ans=2018
amari=[]
for i in range(L,R+1):
    tmp=i%2019
    amari.append(tmp)
    if len(amari)==2019*2:
        break
for i in range(len(amari)):
    for j in range(len(amari)):
        if i==j:
            continue
        ans=min(ans,(amari[i]*amari[j]*2019))
        if ans==0:
            break
print(ans)

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
L, R = map(int, input().split())
ij = [_ % 2019 for _ in range(L, R+1)]
ij_s = sorted(ij)
if ij_s in 3 and 673:
    print(0)
else:
    print((ij_s[0]*ij_s[1]))

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


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);print(+(r-l<2019)and min(i*j%2019for i in s for j in s))

s=range(*eval(input().replace(' ',',1+')))[:673];print(min(i*j%2019for i in s for j in s if i<j))

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())
la = l % 2019
lb = l // 2019
ra = r % 2019
rb = r // 2019
ans = (la * ra) // 2019
# (la + lb) * (ra * rb) // 2019
print(ans)


l, r = map(int, input().split())
la = l % 2019
lb = l // 2019
ra = r % 2019
rb = r // 2019
ans = (la * ra) % 2019
# (la + lb) * (ra * rb) // 2019
print(ans)


l, r = map(int, input().split())
la = l % 2019
ra = r % 2019
diff = ra - la
if diff <= 0:
  diff+=2019
ans = None
for i in range(la, la+diff):
  for j in range(i+1, la+diff+1):
    mul = (i*j) % 2019
    if mul < ans:
      ans = mul
print(ans)


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


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)

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


Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
L,R = map(int,input().split())
target = 2019
L_mod = L % target
R_mod = R % target
#print(L_mod,'L',R_mod,'R')
if L_mod > R_mod:
    print(0)
    exit(0)
if L_mod == R_mod and L < R:
    print(0)
    exit(0)
if L_mod == R_mod:
    print(L_mod)
    exit(0)
if L+1 == R:
    print(L * R % target)
    exit(0)
if L_mod < R_mod and R-L >= target:
    print(0)
    exit(0)

ans = 2019
for i in range(R_mod-L_mod):
    for j in range(R_mod-L_mod):
        if ((L+i) * (L+j)) % target < ans:
            #print(L+i,'Li')
            #print(L+j,'Lj')
            ans = ((L+i) * (L+j)) % target
print(ans)

'''
2020 3000
2020 4040
2018 4040
2018 2020
'''




L,R = map(int,input().split())
target = 2019
L_mod = L % target
R_mod = R % target
#print(L_mod,'L',R_mod,'R')
if L_mod > R_mod:
    print(0)
    exit(0)
if L_mod == R_mod and L < R:
    print(0)
    exit(0)
if L+1 == R:
    print(L * R % target)
    exit(0)
if L_mod < R_mod and R-L >= target:
    print(0)
    exit(0)

ans = 2019
for i in range(R_mod-L_mod + 1):
    for j in range(i+1,R_mod-L_mod+1):
        #print(L+j,'Lj')
        if ((L+i) * (L+j)) % target < ans:
            #print(L+i,'Li')
            #print(L+j,'Lj')
            ans = ((L+i) * (L+j)) % target
            if ans == 0:
                print(0)
                exit(0)
print(ans)

'''
2020 3000
2020 4040
2018 4040
2018 2020
'''




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

print(ans)

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

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

print(ans)

Verdicts: Wrong Answer

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

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

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

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

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


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

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


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

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


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

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


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

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


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

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

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

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
l,r = map(int,input().split())
ans = float('inf')
if r - l + 1> 2019:
    print(0)
    exit()
num = list([i%2019 for i in range(l,r+1)])
print(list([i for i in range(l,r+1)]))
num.sort()
ans = num[0]*num[1]

print(ans)


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

if r - l + 1> 2019:
    print(0)
    exit()
num = list([i%2019 for i in range(l,r+1)])
print(list([i for i in range(l,r+1)]))
num.sort()
ans = num[0]*num[1]

print(ans)


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

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

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

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

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

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

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

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

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


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

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


Verdicts: Wrong Answer

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

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

l, r = map(int, input().split())
r = 2018**2
ll = min(l+2019, r)+1
for i in range(l, ll):
    for j in range(i+1, ll):
        r = min(r, i*j%2019)
        if r == 0:
            break
print(r)

l, r = map(int, input().split())
ans = 2018**2
ll = min(l+2019, r)+1
for i in range(l, ll):
    for j in range(i+1, ll):
        ans = min(ans, i*j%2019)
        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())
L1 = L%2019
R1 = R%2019
L2 = L//2019
R2 = R//2019
ans = 2018
if L2 != R2:
  ans = 0
else:
  for i in range(L+1,R):
    for j in range(i+1,R):
      x = (i*j)%2019
      ans = min(ans,x)
print(ans)

L, R = map(int, input().split())
L1 = L%2019
R1 = R%2019
L2 = L//2019
R2 = R//2019
if L2 != R2:
  ans = 0
else:
  ans = L*(L+1)
  for i in range(L+1,R):
    for j in range(i+1,R):
      x = (i*j)%2019
      ans = min(ans,x)
print(ans)

L, R = map(int, input().split())
L1 = L%2019
R1 = R%2019
L2 = L//2019
R2 = R//2019
if L2 != R2:
  ans = 0
else:
  ans = (L*(L+1))%2019
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      x = (i*j)%2019
      ans = min(ans,x)
print(ans)

Verdicts: Wrong Answer

Wrong Answer

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

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


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


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

print(M)

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
# coding; utf-8
l, r = map(int, input().split())

if r-l > 2019:
        l = l%2019
        r = r%2019 + 2019

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

print(ans)

# coding; utf-8
l, r = map(int, input().split())

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

if R<L+2019:
  end=R+1
else:
  end=L+2019

mod=2019
num=0
for i in range(L,end):
  if i%2019<mod:
    mod=i%2019
    num=i

print(num,num+1)

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

if R<L+2019:
  end=R
else:
  end=L+2018

ans=2020*2020
for l in range(L,end):
  for r in range(l+1,end+1):
    if ans>(l*r)%2019:
      ans=(l*r)%2019
    if ans==0:
      break
print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):

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


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

# coding: utf-8


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

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

main()




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

def mod(num):
    return num % 2019

t1 = 10 ** 9
t2 = 10 ** 9

for i in range(R, L + 1, -1):
    if mod(i) < t1:
        t2 = t1
        t1 = mod(i)

if R - L == 1:
    print(mod(L * R))
else:
    print(mod(t1 * t2))


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

def mod(num):
    return num % 2019


#  (2019a + x)(2019b + y) = 2019(n) + xy

ans = 10 ** 9

lr = min(R, L + 2019) + 1

for i in range(L, lr):
    for j in range(i + 1, lr):
        ans = min(ans, mod(i * j))
        
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):
a = list(map(int,input().split()))
b = []
d = [a[0]%10000,a[1]%10000]
e = sorted(d)

for i in range(d[0],d[1]+1):
  for j in range(d[0],i):
    c = (i*j)%2019
    b.append(c)
else:
  print(b)

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

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

print(ans)

Verdicts: 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
import numpy as np

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

if l == 2019:
    print(0)
elif l < 2019 and r >= 2019:
    print(0)
elif l * r < 2019:
    print(l * (l + 1))
else:
    s = 2020
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            print(i, j)
            if (i * j) % 2019 < s:
                s = (i * j) % 2019
    print(s)



import sys
import numpy as np

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

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



import sys
import numpy as np

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

for i in range(991):
  if l <= 2019 * i and r >= 2019 * i:
    print(0)
    exit(0)
if r - l >= 2019:
  print(0)
elif l * r < 2019:
    print(l * (l + 1))
else:
    s = 2020
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            if (i * j) % 2019 < s:
                s = (i * j) % 2019
    print(s)



Verdicts: Wrong Answer

Wrong Answer

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

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

l_2019 = L % 2019
r_2019 = R % 2019

if R - L >= 2017 or L == 0:
    print(0)
else:
    if l_2019 >= r_2019:
        print(0)
    else:
        if l_2019 >= 2019 - r_2019:
            if r_2019 % 3 == 0:
                print((r_2019-1)*(r_2019-2)%2019)
            elif r_2019 % 3 == 1:
                print((r_2019)*(r_2019-2)%2019)
            else:
                print((r_2019)*(r_2019-1)%2019)
        else:
            if l_2019 % 3 == 0:
                print(((l_2019+1)*(l_2019+2))%2019)
            elif l_2019 % 3 == 1:
                print(((l_2019*(l_2019+2))%2019))
            else:
                print(((l_2019*(l_2019+1))%2019))

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
L, R = map(int, input().split())
mod = 2019
ans = 10**9 + 7
for i in range(L, min(L + mod, R)):
  for j in range(i + 1, min(i + mod, R)):
    ans = min((i * J) % mod, ans)
print(ans)

L, R = map(int, input().split())
mod = 2019
ans = float("inf")

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


Verdicts: Runtime Error

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

Submission attempts (in order):
import math
L, R = list(map(int, input().split()))
if math.ceil(L / 2019) <= R // 2019:
    print(0)
else:
    res = 0
    for i in range(L % 2019, R % 2019):
        for j in range(L % 2019 + 1, R % 2019 + 1):
            res = min(res, (i * j) % 2019)
    print(res)


import math
INF = 2_000_000_001
L, R = list(map(int, input().split()))
if math.ceil(L / 2019) <= R // 2019:
    print(0)
else:
    res = INF
    for i in range(L % 2019, R % 2019):
        for j in range(L % 2019 + 1, R % 2019 + 1):
            res = min(res, (i * j) % 2019)
    print(res)


Verdicts: Wrong Answer

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

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

l = []
for i in range(L,min(R,L+MOD)+1):
    l.append(i%MOD)
l = sorted(l)
print(l)
print((l[0]*l[1])%MOD)

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

ans = 10**10
for i in range(L,min(R,L+MOD)+1):
    for j in range(i+1,min(R,L+MOD)+1):
        if ans > (i*j)%MOD:
            ans = (i*j)%MOD

print(ans)

Verdicts: Wrong Answer

Accepted