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())
n = r - l + 1
if 2019<=n:
    print(0)
elif 3<=n and n<2019:
    for k in range(l,r+1):
        if k%673==0:
            print(0)
        else:
            mod = 2019
            for i in range(l,r):
                for j in range(l+1,r+1):
                    mod_new = (i*j)%2019
                    if mod_new == 1:
                        print(1)
                        exit()
                    else:
                        mod = min(mod,mod_new)
            print(mod)                             
else:
    print((l*r)%2019)

l,r = map(int, input().split())
n = r - l + 1
if 2019<=n:
    print(0)
elif 3<=n and n<2019:
	mod = 2019
    for i in range(l,r):
        for j in range(l+1,r+1):
            mod_new = (i*j)%2019
            mod = min(mod,mod_new)
    print(mod)                             
else:
    print((l*r)%2019)

l,r = map(int, input().split())
n = r - l + 1
if 2019<=n:
    print(0)
elif:
  	mod = 2019
	for i in range(l,r):
        for j in range(l+1,r+1):
            mod_new = (i*j)%2019
            mod = min(mod,mod_new)
    print(mod)

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

Verdicts: Wrong Answer

Runtime Error

Runtime Error

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

Submission attempts (in order):
# -*- coding: utf-8 -*-

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

min = 2019

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

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

print(min)

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

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

min = 2019

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

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

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 = [int(i) for i in input().split()]
if R-L >= 4038:
    print(0)
else:
    ans = []
    for i in range(L,R+1):
        ans.append(i % mod)
    ans = sorted(ans)
    print(ans[0]*ans[1])

L,R = [int(i) for i in input().split()]
if R-L >= 4038:
    print(0)
else:
    ans = []
    for i in range(L,R+1):
        ans.append(i % mod)
    ans = sorted(ans)
    ans2 = (ans[0]*ans[1])%mod
    print(ans2)

L,R = [int(i) for i in input().split()]
mod = 2019
if R-L >= 673:
    print(0)
else:
    ans = []
    for i in range(L,R+1):
        for ii in range(i+1,R+1):
            ans.append((i*ii)%mod)
    ans = sorted(ans)
    print(ans[0])

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
L, R = map(int, input().split())
C = []
flag = False
for i in range(L, R+1):
    if i%2019==0:
        flag = True
        break
    else:
        C.append(i)
        
if flag:
    print(0)
else:
    ans = 4080400
    for x, y in list(itertools.combinations(C, 2)):
        if (x*y)%2019<ans:
            ans = (x*y)%2019
    print(ans)

L, R = map(int, input().split())
C = []
flag = False
for i in range(L, R+1):
    if i%2019==0:
        flag = True
        break
    else:
        C.append(i)
        
if flag:
    print(0)
else:
    import itertools
    ans = 4080400
    for x, y in list(itertools.combinations(C, 2)):
        if (x*y)%2019<ans:
            ans = (x*y)%2019
    print(ans)

Verdicts: Runtime Error

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

Submission attempts (in order):

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


n = 2019
L,R =map(int,input().split())
l = L%n
N =min(2019,R-L+1)
ans = 2019
for i in range(N):
    for j in range(i):
        foo = (i+l)*(j+l)%n
        if ans > foo:
            ans = foo
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 math

x = input()
x = x.split()

l = int(x[0])
r = int(x[1])

if l % 2019 > r % 2019 or r-l >= 2018:
  print("0")
  exit()


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

import math

x = input()
x = x.split()

l = int(x[0])
r = int(x[1])

if l % 2019 > r % 2019 or r-l >= 2018:
  print("0")
  exit()


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

Verdicts: Wrong Answer

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

Submission attempts (in order):
list(combinations([i for i in range(_[0],_[1]+1)],2)if _[1]-_[0]<2019else combinations([i for i in range(_[0],_[0]+2020)],2))

from itertools import combinations
_=list(map(int,input().split()))
print(min([i[0]*i[1]%2019 for i in list(combinations([i for i in range(_[0],_[1]+1)],2)if _[1]-_[0]<2019else combinations([i for i in range(_[0],_[0]+2020)],2))]))

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

L,R=map(int,input().split())
c=2019
z=0
for i in range(L,R+1):
    for j in range(i+1,R+1):
        a=i*j
        b=a%2019
        if c>b:
            c=b
        if c==0:
            z=1
            break
    if z==1:
        break
print(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):
import math

l, r = map(int, input().split())
e = 2019
e1 = 3
e2 = e // e1

if r-l == 1:
    print(l*r % e)
else:
    if divmod(l,e2)[0] < divmod(r,e2)[0]:
        print(0)
    else:
        print(r*(r-1) % e)

import math

l, r = map(int, input().split())
e = 2019
e1 = 3
e2 = e // e1

if r-l == 1:
    print(l*r % e)
else:
    if divmod(l,e2)[0] < divmod(r,e2)[0]:
        print(0)
    else:
        if r < e
            print(r*(r-1) % e)
        elif e < l:
            print(l*(l+1) % e)

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

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

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 = set()
T = set()
if (R-L)>=673:
    print(0)
else:
    l = L%2019
    for i in range(R-L+1):
        S = S | {l+i}
    for i in S:
        for j in S:
                T = T | {(i*j)%2019}
    print(min(T))

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

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()))
# array = np.arange(L, R+1)

def get_flg3():
    if R-L >= 3:
        return True
    elif R//3 != L//3:
        return True
    else:
        return False
    

def get_flg673():
    if R-L >= 673:
        return True
    elif R//673 != L//673:
        return True
    else:
        return False

def mataganai_2019():
    return (L*(L+1))//2019 == ((R-1)*R)//2019
        
if get_flg3() & get_flg673():
    print(0)
elif mataganai_2019():
    print('{}'.format(L*(L+1)%2019))
else:
    print(1)

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

def get_amari():
    min_ = 2019
    for i in range(L,R):
        for j in range(i+1, R+1):
            if (i*j)%2019 < min_:
                min_ = (i*j)%2019
    return min_
   
def get_flg3():
    if R-L >= 3:
        return True
    elif R//3 != L//3:
        return True
    else:
        return False
    

def get_flg673():
    if R-L >= 673:
        return True
    elif R//673 != L//673:
        return True
    else:
        return False

if get_flg3() & get_flg673():
    print(0)
else:
    print(get_amari())


Verdicts: Wrong Answer

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

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

res = 1000000007

amari = [i % 2019 for i in range(L, R + 1)]
l = len(amari)

if R - L + 1 > 2019:
    print(0)
else:
    for i in range(l + 1):
        a = amari[i]
        for j in range(i + 1, l + 1):
            b = amari[j]
            res = min(res, a * b % 2019)

    print(res)

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

res = 1000000007

if R - L + 1 > 2019:
    print(0)
else:
    amari = [i % 2019 for i in range(L, R + 1)]
    l = len(amari)
    for i in range(l + 1):
        a = amari[i]
        for j in range(i + 1, l + 1):
            b = amari[j]
            res = min(res, a * b % 2019)

    print(res)

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

res = 1000000007

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

print(res)

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

res = 1000000007

if R - L + 1 > 2019:
    print(0)
else:
    amari = [i % 2019 for i in range(L, R + 1)]
    l = len(amari)
    for i in range(l):
        a = amari[i]
        for j in range(i + 1, l):
            b = amari[j]
            res = min(res, a * b % 2019)

    print(res)

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
L, R = map(int, input().split())
min = 2019
modulo = 2019
for i in range(L, R + 1):
  base = (i * i) % 2019
  for j in range(i + 1, R + 1):
    modulo = (base + j) % 2019
    if (modulo < min):
      min = modulo
print(min)


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

L=L2%2019
R=R2%2019

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

Verdicts: 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 = 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])


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


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

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

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 = (int(i) for i in input().split()) 
S=[]
j=0
if R-L>=2:
    for i in range(L,R):
        S.append((L+j)%2019)
        j=j+1
    S.sort()
    for i in range(L,R):
        if S[i]%673==0 or S[0]==0:
            print(0)
        else:
            ans=(S[0]*S[1])%2019
            print(ans)
else:
    ans=(R*L)%2019
    print(ans)

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


Verdicts: Runtime Error

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

Submission attempts (in order):
import numpy as np
L, R = map(int, input().split(" "))
arr = np.array(np.arange(L, R+1))
mod_list = []
min_mod_list = []
if (0 in (arr % 2019)) or (0 in arr):
  print(0)
else:
  for i in arr:
#    index_ = np.extract(i, arr)
    index_ = np.where(arr==i)
    for j in arr[int(index_[0])+1:]:
      mod_list.append(((i * j) % 2019))
    
    min_mod_list.append(min(mod_list))
    del mod_list
    mod_list = []
  
  
  print(min(min_mod_list))

import numpy as np
L, R = map(int, input().split(" "))
arr = np.array(np.arange(L, R+1))
mod_list = []
min_mod_list = []
if (0 in (arr % 2019)) or (0 in arr):
  print(0)
else:
  for i in arr:
#    index_ = np.extract(i, arr)
    index_ = np.where(arr==i)
    for j in arr[int(index_[0]):]:
      mod_list.append(((i * j) % 2019))
    
    min_mod_list.append(min(mod_list))
    del mod_list
    mod_list = []
  
  
  print(min(min_mod_list))

import numpy as np

L, R = map(int, input().split(" "))
#L, R = 2020, 4000000000
if R - L > 2019:
    print(0)
else:
    arr = np.array(np.arange(L, R+1))
    mod_list = []
    min_mod_list = []
    
    if (0 in (arr % 2019)) or (0 in arr):
        print(0)
    else:
    
        for i in arr:
            mod_list = []
            index_ = np.where(arr==i)
            if i == arr[-1]:
                break
            
            for j in arr[int(index_[0])+1:]:
                mod_list.append((i * j) % 2019)
     
            min_mod_list.append(min(mod_list))
            if min(mod_list) == 0:
                break
    
    
        print(min(min_mod_list))


Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
def solve():
  L, R = map(int, input().split())
  ans = 2019
  for i in range(L, R + 1):
    for j in range(i, R + 1):
      ans = min(ans, (i * j) % 2019)
  return ans

print(solve())

def solve():
  L, R = map(int, input().split())
  ans = 2019
  for i in range(L, R):
    for j in range(i + 1, R + 1):
      v = i * j % 2019
      if v < ans: ans = v
      if ans == 0: return 0
  return ans

print(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):
l,r = map(int,input().split())
if r-l>=2018:
  print(2)
elif r%2019>=0:
  print(0)
else:
  print(l%2019+(l+1)%2019)

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
l,r = map(int, input().split())
if r < 2019:
	print((l*(l+1)) % 2019)
	exit()
elif r-l >=  2019:
	print(0)
	exit()
elif r-l < 2019:
	if r % 2019 == 0 or l % 2019 == 0:
		print(0)
		exit()
	else:
		mini = 2018
		for i in range(0,r-l):
			for j in range(1,r-l+1):
				if i >= j:
					continue
				mod = ((l+i)*(l+j)) % 2019
				print(i,j)
				if mod < mini:
					mini = mod
print(mini)

l,r = map(int, input().split())
if r < 2019:
	print((l*(l+1)) % 2019)
	exit()
elif r-l >=  2019:
	print(0)
	exit()
elif r-l < 2019:
	if r % 2019 == 0 or l % 2019 == 0:
		print(0)
		exit()
	else:
		mini = 2018
		for i in range(0,r-l):
			for j in range(1,r-l+1):
				if i >= j:
					continue
				mod = ((l+i)*(l+j)) % 2019
				if mod < mini:
					mini = mod
print(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):
l,r = map(int,input().split())
mod = 2019

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
L,R= [int(i) for i in input().split()]
n=[]
for i in range(R-L+1):	
	for j in range(i+1,R-L+1):
		a = (L+i)*(L+j)%2019
		if a == 0:
			print(0)
			exit()
		else 
			n.append((L+i)*(L+j)%2019)
print(min(n))


L,R= [int(i) for i in input().split()]
n=[]
for i in range(R-L+1):	
	for j in range(i+1,R-L+1):
		a = ((L+i)*(L+j))%2019
		if a == 0:
			print(0)
			exit()
		else: 
			n.append(((L+i)*(L+j))%2019)
print(min(n))

Verdicts: Runtime Error

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

Submission attempts (in order):
l, r = map(int, input().split())
if r-l >= 2019:
    ans = 0
else:
    n = 2019
    l = l%n
    print(l)
    r = r%n
    print(r)
    ans = 2019
    a = min(l,r)
    b = max(l,r)

    for i in range(a,b):
        for j in range(a+1,b+1):
            print(i,j)
            ans = min(ans, (i*j)%n)

print(ans)

l, r = map(int, input().split())
if r-l >= 2019:
    ans = 0
else:
    n = 2019
    l = l%n
    r = r%n
    ans = 2019
    a = min(l,r)
    b = max(l,r)

    for i in range(a,b):
        for j in range(a+1,b+1):
            ans = min(ans, (i*j)%n)

print(ans)

Verdicts: Wrong Answer

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

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

minmod = 2 * 10 ** 9

print(l,r)

if r - l >= 2019:
    print(0)
    sys.exit()

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

print(minmod)

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

minmod = 2 * 10 ** 9

print(l,r)

if r - l >= 2019:
    print(0)
    sys.exit()

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

print(minmod)

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

minmod = 2 * 10 ** 9


if r - l >= 2019:
    print(0)
    sys.exit()

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

print(minmod)

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

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

l,r = map(int,input().split())
x = []
for i in range(r-1):
  for j in range(i+1,r):
    res = (i*j)%2019
    x.append(res)
xs = sorted(x)
print(x[1])

l,r = map(int,input().split())
x = []
for i in range(l,r-1):
  for j in range(i+1,r):
    res = (i*j)%2019
    x.append(res)
xs = sorted(x)
print(x[1])

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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

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

Submission attempts (in order):
def solve(left, right):
    if right - left >= 2019:
        return 0
    l_mod = left % 2019
    r_mod = right % 2019
    if r_mod < l_mod:
        return 0
    ans = 2019
    for i in range(l_mod, r_mod + 1):
        for j in range(i + 1, r_mod + 1):
            ans = min(ans, i * j % 2019)
    return ans
 L, R = map(int, input().split())
 print(solve(L, R))


L,R = map(int,input().split())
l = L
m = (L *(L + 1)) % 2019
while l < min (R, L + 2019):
  r = l + 1
  while r <= min (R, L + 2019):
  	n = (l * r) % 2019 
  	m = min(m,n)
  	r = r + 1
  l = l + 1
print(m)  


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

def solve():
    i = L//2019
    ans = 0
    while L <= 2019*i <= R:
        i += 1
#    print(i)
    if i >= 1:
        print(ans)
    else:
        ans = (L*(L+1)) % 2019
        print(ans)


if __name__ == "__main__":
    L,R = list(map(int, input().split()))
    solve()



def solve():
    i = L//2019
    ans = 0
    while L <= 2019*i <= R:
        i += 1
#    print(i)
    if i >= 1:
        print(ans)
    else:
        ans = 2019
        for n in range(L,R):
            for m in range(n+1, R+1):
                ans = min(ans, ((n*m)%2019))
        print(ans)


if __name__ == "__main__":
    L,R = list(map(int, input().split()))
    solve()



def solve():
    i = (L//2019) + 1
    ans = 0
    if L <= 2019*i <= R:
        print(ans)
    else:
        ans = 2020
        for n in range(L,R):
            for m in range(n+1,R+1):
                ans = min(ans, (n*m)%2019)
            if ans == 0:
                break
        print(ans)

if __name__ == "__main__":
    L,R = list(map(int, input().split()))
    solve()


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 = [int(item) for item in input().split()]
l, ml = divmod(L, 2019)
r, mr = divmod(R, 2019)
print (l, ml)
print (r, mr)
if (l==r):
  print((ml*(ml+1))%2019)
elif (l < r):
  print(0)

L, R = [int(item) for item in input().split()]
l, ml = divmod(L, 2019)
r, mr = divmod(R, 2019)
if (l==r):
  m = 2019
  for i in range(ml, mr+1):
    for j in range(i+1, mr+1):
      m = min(m, (i*j)%2019)
  print(m)
else:
  print(0)

Verdicts: Wrong Answer

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

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

ans = 2018
x = 2018
x_min = 2018
if l - n >= 673:
    ans = 0
elif l - n > 2:
    for i in range(l,n+1):
        x = i % 673
        if x == 0:
            ans = 0
            bleak
        else:
            x = i % 2019
            if x < x_min:
                x_min = x
            ans = x*(x+1)%2019
else:
    for i in range(l,n+1):
        for j in range(l,n+1):
            ansss = i*j%2019
            if ansss < ans:
                ans = ansss

print(ans)

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

ll = l % 2019
ans = 2018
if l-n >= 672:
    ans = 0
elif l-n > 2:
    for i in range(ll,ll + n-l +1):
        if i % 673 == 0:
            ans = 0
            break
        else:
            for j in range(ll,ll + n-l +1):
                if i != j:
                    ansss = i*j%2019
                    if ansss == 0:
                        ans = 0
                        break
                    elif ansss < ans:
                        ans = ansss
else:
    ans = l*n%2019

print(ans)

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

ans = 2018
x = 2018
x_min = 2018
if l - n >= 673:
    ans = 0
elif l - n > 2:
    for i in range(l,n):
        x = i % 673
        if x == 0:
            ans = 0
        else:
            x = i % 2019
            if x < x_min:
                x_min = x
            ans = x*(x+1)%2019
else:
    for i in range(l,n):
        for j in range(l,n):
            ansss = i*j%2019
            if ansss < ans:
                ans = ansss

print(ans)

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

ans = 2018
if l-n >= 672:
    ans = 0
else:
    for i in range(l,n+1):
        ii = i % 2019
        for j in range(l,n+1):
            jj = j % 2019
            ansss = ii*jj%2019
            if ansss == 0:
                ans = 0
                break
            elif ansss < ans:
                ans = ansss

print(ans)


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

ll = l % 2019
ans = 2018
if l-n >= 672:
    ans = 0
elif n-l > 2:
    for i in range(ll,ll + n-l +1):
        if i % 673 == 0:
            ans = 0
            break
        else:
            for j in range(ll,ll + n-l +1):
                if i != j:
                    ansss = i*j%2019
                    if ansss == 0:
                        ans = 0
                        break
                    elif ansss < ans:
                        ans = ansss
else:
    ans = l*n%2019

print(ans)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

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

Submission attempts (in order):
l, r=map(int, input().split())
if r-l>672:
	p=0
else:
	x=[]
	for i in range(l, r):
		for j in range(i+1, r+1):
			x.append(i*j%2019)
			if not p:
				break
		if not p:
			break
	p=min(x)
print(p)

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

Verdicts: Runtime Error

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

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

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

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

Verdicts: Runtime Error

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

Submission attempts (in order):
import sys
sys.setrecursionlimit(10**6)

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

MOD = 2019

#n = 2019
#pf = {}
#

#    while n % i == 0:
#        pf[i] = pf.get(i,0) + 1
#        n //= i
#if n > 1: pf[n] = 1
#print(pf)
## 2019=3*673

import itertools

l_mod = l%MOD
r_mod = r%MOD

if r-l > 2019:
    ans = 0
else:
    if l_mod < r_mod:
    	li = [i for i in range(l_mod, r_mod+1)]
    	ans = 2018
    	for v in itertools.combinations(li, 2):
      	ans = min(ans, v[0]*v[1]%MOD)        
    else:
        ans = 0

print(ans)

import sys
sys.setrecursionlimit(10**6)

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

MOD = 2019

#n = 2019
#pf = {}
#

#    while n % i == 0:
#        pf[i] = pf.get(i,0) + 1
#        n //= i
#if n > 1: pf[n] = 1
#print(pf)
## 2019=3*673

import itertools

l_mod = l%MOD
r_mod = r%MOD

if r-l > 2019:
    ans = 0
else:
    if l_mod <= 3 <= r_mod and l_mod <= 673 <= r_mod:
        ans = 0
    elif l_mod < r_mod:
        li = [i for i in range(l_mod, r_mod+1)]
        ans = 2018
        for v in itertools.combinations(li, 2):
            ans = min(ans, v[0]*v[1]%MOD)        
    else:
        ans = 0

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):
A=list(map(int,input().split()))
t=True
C=2019
if t:
    for i in range(A[1]):
        for t in range(A[1]+1):
            if t>i and i>=A[0]:
                if i-t>2019:
                  	C=0
                    t=False
                    break
                else:
                    if t*i%2019<C:
                        C=t*i%2019
print(C)

A=list(map(int,input().split()))
t=True
sum=2019
if t:
    for i in range(int(A[1])):
        if i>=A[0]:
            for t in range (int(A[1])+1):
                if t>i:
                    if i*t%2019<=sum:
                        sum=i*t%2019
                        print(i,t)
print(sum)

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

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

print(ans)

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

for i in range(L, R):
    for j in range(i + 1, R):
        tmp = int((i + 1) * j) % inf
        ans = min(ans, tmp)
        break
    if ans == 0:
        break

print(ans)

import sys

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

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

ans = 2019

if L >= R:
   
for i in range(L, R):

    for j in range(i + 1, R + 1):
        tmp = int((i * j) % inf)
        ans = min(ans, tmp)
        if ans == 0:
            break
    if ans == 0:
        break

print(ans)


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

print(ans)


import sys

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

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

ans = 2019
   
for i in range(L, R):

    for j in range(i + 1, R + 1):
        tmp = int((i * j) % inf)
        ans = min(ans, tmp)
        if ans == 0:
            break
    if ans == 0:
        break

print(ans)


Verdicts: Runtime Error

Wrong Answer

Runtime Error

Wrong Answer

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

Submission attempts (in order):
s=input()
#s = ("2020 2040")
#print(s) 
s = s.split(" ")

L = int( s[0] )
R = int( s[1] )


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

print(result)



s=input()
#s = ("4 2 9")
#print(s) 
s = s.split(" ")

L = int( s[0] )
R = int( s[1] )


result =4.0e9  
for i in range(L,R-1):
    for j in range(i,R):
        mod = i*j % 2019
        if result > mod:
            result = mod

print(result)

s=input()
#s = ("2020 2040")
#print(s) 
s = s.split(" ")
 
L = int( s[0] )
R = int( s[1] )
 
 
result =4.0e9  
for i in range(L,min(L+2019,R)):
    for j in range(i+1,min(R+1,L+2020)):
        mod = i*j % 2019
        #print(i,j,i*j,mod)
        if result > mod:
            result = mod
 
print(result)

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

@functools.lru_cache(maxsize = None)
for i in range(L, R) :
	for j in range(i + 1, R + 1) :
		if((i * j) % 2019 < mod) :
			mod = (i * j) % 2019
		else :
			pass
	if(mod == 0) :
		break
	else :
		pass
	
print(mod)

import functools

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

@functools.lru_cache(maxsize = None)
for i in range(L, R) :
	for j in range(i + 1, R + 1) :
		if((i * j) % 2019 < mod) :
			mod = (i * j) % 2019
		else :
			pass
	if(mod == 0) :
		break
	else :
		pass
	
print(mod)

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

for i in range(L, R) :
	for j in range(i + 1, R + 1) :
		if((i * j) % 2019 < mod) :
			mod = (i * j) % 2019
			x = ((i * j) // 2019) * 2019 + 2019
			if(x > i * R) :
				break
			else :
				pass
		elif(mod == 0) :
			break
		else :
			pass
	if(mod == 0) :
		break
	else :
		pass
	
print(mod)

Verdicts: Runtime Error

Runtime Error

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

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

N = R - L + 1
r = L % 2019

if N >= 2019:
    print(0)
    exit()

m1 = 2018
m2 = 2017
for i in range(N):
    a = (r + i) % 2019
    if a < m1:
        m1 = a
    elif a < m2:
        m2 = a

an = m1 * (m2 + 1)
print(an % 2019)

N = R - L + 1
l = L % 2019

if N >= 2019:
    print(0)
    exit()

m = 2018
for i in range(N):
    a = (l + i) % 2019
    if a < m:
        m = a

print(m * (m + 1))

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

m1 = 2018
for i in range(L, R):
    for j in range(L+1, R+1):
        a = (i*j) % 2019
        if a == 0:
            print(0)
            exit()
        if a < m1:
            m1 = a
print(m1)

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):
import math
def main():
    l, r = map(int,input().split())
    if r - l >= 637:
        print(0)
        return
    l_mod = l % 2019
    r_mod = r % 2019
    ans = []
    if l_mod > r_mod :
        ans = [i for i in range(l_mod,2019)]
        ans.extend([i for i in range(r_mod+1)])
    else:
        ans = [i for i in range(l_mod,r_mod+1)]
    print(ans)
    ans.sort()
    print((ans[0] * ans[1]) % 2019)

if __name__ == '__main__':
    main()


import math
def main():
    l, r = map(int,input().split())
    if r - l >= 637:
        print(0)
        return
    l_mod = l % 2019
    r_mod = r % 2019
    ans = []
    if l_mod > r_mod :
        ans = [i for i in range(l_mod,2019)]
        ans.extend([i for i in range(r_mod+1)])
    else:
        ans = [i for i in range(l_mod,r_mod+1)]
    ans.sort()
    a = 2019
    for i in range(len(ans)):
        for j in range(len(ans)):
            a = min(a,(ans[i] * ans[j]) % 2019)
    print(a)

if __name__ == '__main__':
    main()


import math
def main():
    l, r = map(int,input().split())
    if r - l >= 637:
        print(0)
        return
    l_mod = l % 2019
    r_mod = r % 2019
    ans = []
    if l_mod > r_mod :
        ans = [i for i in range(l_mod,2019)]
        ans.extend([i for i in range(r_mod+1)])
    else:
        ans = [i for i in range(l_mod,r_mod+1)]
    ans.sort()
    a = 2019
    for i in range(len(ans)):
        for j in range(i + 1, len(ans)):
            a = min(a,(ans[i] * ans[j]) % 2019)
    print(a)

if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

Wrong Answer

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

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

ml = (l % 2019)
mr = (r % 2019)
t = l + 2019
if r > t:
    m = 0
else:
    print(ml, mr)
    if ml < mr:
        for x in range(ml, mr):
            m = min(m, (x * (x+1)) % 2019)
    else:
        m = 0
print(m)

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

ml = (l % 2019)
mr = (r % 2019)
t = l + 2019
if r > t:
    m = 0
else:
    if ml < mr:
        for x in range(ml,mr):
            m = min(m, (ml * mr) % 2019)
    else:
        m = 0
print(m)

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

ml = (l % 2019)
mr = (r % 2019)
t = l + 2019
if r > t:
    m = 0
else:
    if ml < mr:
        for i in range(ml, mr):
            for j in range(i+1, mr+1):
                m = min(m, (i * j) % 2019)
    else:
        m = 0
print(m)

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 = input().split()
l = int(l)
r = int(r)

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

    mod_min = 2019

    if l < r:
        for i in range(l, r):
            for j in range(i+1, r+1):
                print(i, j)
                mod = (i * j) % 2019
                if mod < mod_min:
                    mod_min = mod
    else:
        
        #     for j in range(i+1, r+2019 + 1):
        
        #         if mod < mod_min:
        #             mod_min = mod
        mod_min = 0

    print(mod_min)


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

l_q = l // 2019
r_q = r // 2019
l_mod = l % 2019
r_mod = r % 2019

mod_min = 2019

if l_q < r_q:
    print(0)
else:
    for i in range(l_mod, r_mod):
        for j in range(i+1, r_mod+1):
            mod = (i * j) % 2019
            if mod < mod_min:
                mod_min = mod
    
    print(mod_min)


Verdicts: Wrong Answer

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

Submission attempts (in order):
L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
lll=L//673
rrr=R//673
if l<r or ll==0:
  print(0)
elif lll>=1 and R-L>=3:
  print(0)
else:
  print(ll*(ll+1))


L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
if l<r or ll==0 or :
  print(0)
else:
  print(ll*(ll+1))

L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
rr=R%2019
Ans=[]
if R-L>=2019:
  print(0)
else:
  if R==L+1:
    Ans.append(R*L%2019)
  else:
    for i in range(R,L+1):
      for j in range(R+1,L+1):
        Ans.append(i*j%2019)
print(min(Ans))


L,R=map(int,input().split())
l=L//2019
ll=L%2019
r=R//2019
rr=R%2019
Ans=[2019]
if R-L>=2019:
  print(0)
else:
    for i in range(R,L+1):
      for j in range(R+1,L+1):
        Ans.append(i*j%2019)
print(min(Ans))


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


Verdicts: Wrong Answer

Runtime Error

Runtime Error

Wrong Answer

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

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

d = 10 ** 10

if R -L > 2019:
  print(0)
else:
  N = R -L 
  for i in range(N):
    for j in range(N):
      
      a = L+i
      b = L+j
      
      c = a * b % 2019
      d = min(c,d)
  print(d)

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

d = 10 ** 10

if R -L > 2019:
  print(0)
else:
  N = R -L 
  for i in range(N):
    for j in range(i+1,N+1):
      
      a = L+i
      b = L+j
      
      c = a * b % 2019
      d = min(c,d)
  print(d)


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())
diff = r - l

if(diff >= 2019):
  print(0)
else:
  lmod = l % 2019
  rmod = r % 2019
  if(rmod  < lmod):
    print(0)
  else:
    ans =2020
    for i in range(l,r+1):
      for j in range(i,r+1):
        if((i*j) % 2019 < ans):
          ans = (i*j) % 2019
    print(ans)

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

if(diff >= 2019):
  print(0)
else:
  lmod = l % 2019
  rmod = r % 2019
  if(rmod  < lmod):
    print(0)
  else:
    ans =2020
    for i in range(l,r+1):
      for j in range(i+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):
# -*- coding utf-8 -*-
L, R = map(int, input().split())

L = L % 2019
R = R % 2019 + (2019 if R >= 2019 else 0)

ans = 10000


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

print(ans)


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

L = L % 2019
R = R % 2019 + 2019

ans = 10000


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

print(ans)


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

a = L // 2019
L -= a * 2019
R -= a * 2019
R = min(R, L + 2018)

ans = 10000


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())
l_mod = L % 2019
r_mod = R % 2019
result = 2019
if l_mod > r_mod:
    print(0)
else:
    print(L_mod*(L_mod+1)%2019)

L, R = map(int, input().split())
l_mod = L % 2019
r_mod = R % 2019

if l_mod > r_mod:
    print(0)
else:
    mod = (l_mod*(l_mod+1)) % 2019
    for i in range(l_mod,r_mod):
        for j in range(l_mod+i+1,r_mod+1):
            print(i)
            if mod > (i*j) %2019:
                mod = (i*j) %2019
    print(mod)

L, R = map(int, input().split())
l_mod = L % 2019
r_mod = R % 2019
result = 2019
if l_mod > r_mod:
    print(0)
else:
    print((L_mod*(L_mod+1))%2019)

L, R = map(int, input().split())
l_mod = L % 2019
r_mod = R % 2019
if R >2019+L:
    print(0)
else:
    mod = (l_mod*(l_mod+1)) % 2019
    for i in range(l_mod,r_mod):
        for j in range(i+1,r_mod+1):
            if mod>(i*j)%2019:
                mod=(i*j)%2019
    print(mod)

Verdicts: Runtime Error

Wrong Answer

Runtime Error

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

Submission attempts (in order):
L, R = [int(x) for x in input().strip().split()]

new_L = (L*(L+1)) % 2019
new_R = (R*(R-1)) % 2019
num_range = new_R - new_L
if num_range >= 2019 or num_range == 0 or L == 0: print(0)
else:
    delim_L = new_L % 2019
    delim_R = new_R % 2019
    if delim_L > delim_R: print(delim_R)
    else: print(delim_R)

L, R = [int(x) for x in input().strip().split()]

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

Verdicts: Wrong Answer

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

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

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

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

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


Verdicts: Wrong Answer

Accepted