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())
m = 2019
ans = 0
if R-L < m:
    ans = m
    L = L%m
    R = R%m
    print(L,R)
    lis = list(range(L,R+1))
    lis2 = [i%m for i in lis]
    for i in range(len(lis2)):
        for j in range(i+1,len(lis2)):
            if ans > (lis2[i]*lis[j])%m:
                ans = (lis2[i]*lis[j])%m
print(ans)

L, R= map(int,input().split())
m = 2019
ans = 0
if R-L < m:
    ans = m
    L = L%m
    R = R%m
    lis = list(range(L,R+1))
    lis2 = [i%m for i in lis]
    for i in range(len(lis2)):
        for j in range(i+1,len(lis2)):
            if ans > (lis2[i]*lis[j])%m:
                ans = (lis2[i]*lis[j])%m
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
sys.setrecursionlimit(10**7)
input = sys.stdin.readlines
from math import sqrt

def isSquare(n):
    m = int(sqrt(n))
    for x in range(m-2, m+2):
        if x**2 == n:
            return True

def getDistance(xi, xj, dimention):
    d = 0
    for i in range(dimention):
        d += (xi[i] - xj[i])**2
    return d

def main():
    lines = input()

    n, d = list(map(int, lines[0].split()))
    x = []
    for i, xi in enumerate(lines[1:]):
        x.append(list(map(int, xi.split())))

    cnt = 0

    for i, xi in enumerate(x):
        for j, xj in enumerate(x[i+1:]):
            dist = getDistance(xi, xj, d)
            if isSquare(dist):
                cnt += 1
    print(cnt)

main()

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readlines
from math import sqrt

def isSquare(n):
    m = int(sqrt(n))
    for x in range(m-1, m+1):
        if x**2 == n:
            return True

def getDistance(xi, xj, dimention):
    d = 0
    for i in range(dimention):
        d += (xi[i] - xj[i])**2
    return d

def main():
    lines = input()

    n, d = list(map(int, lines[0].split()))
    x = []
    for i, xi in enumerate(lines[1:]):
        x.append(list(map(int, xi.split())))

    cnt = 0

    for i, xi in enumerate(x):
        for j, xj in enumerate(x[i+1:]):
            dist = getDistance(xi, xj, d)
            if isSquare(dist):
                cnt += 1
    print(cnt)

main()

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

def main():
    l, r = list(map(int, input().split()))
    diff = r-l
    if diff >= 2018:
        return 0

    else:
        min_ = 2 ** 20
        
        p = l // 2019 ; q = l % 2019
        for xi in range(l, r):
            qi = (q + (xi - l)) % 2019
            if qi == 0:
                return 0
            for xj in range(xi+1, r+1):
                qj = (q + (xj - l)) % 2019
                if qj == 0:
                    return 0
                else:
                    qij = (qi * qj) % 2019
                    if qij < min_:
                        min_ = qij

    return min_

print(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(i) for i in input().split())
Z = 2020
if R - L >= 2019:
  print(0)
else:
  for i in range(L,R+1):
    a = i % 2019
    for j in range(L,R+1):
      b = j % 2019
    if i != j and (a*b)%2019 < Z:
      X = a
      Y = b
      Z = (a*b) % 2019
  print(Z)

L, R = (int(i) for i in input().split())
Z = 2020
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
      c = (a*b) % 2019
      if c < Z:
        Z = c
  print(Z)

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 numpy as np
L, R = list(map(int, input().split(' ')))
x = []
x.append(L % 2019)
for i in range(L+1, R+1):
    m = i % 2019
    if s == m:
        break
    x.append(m)
min_v = 2018
for i in range(0, len(x)-1):
    tmp = np.amin(np.mod([x[i]*x[j] for j in range(i+1, len(x))], 2019))
    if tmp < min_v:
        min_v = tmp

print(min_v)

import numpy as np
L, R = list(map(int, input().split(' ')))
x = []
x.append(L % 2019)
for i in range(L+1, R+1):
    m = i % 2019
    if s == m:
        break
    x.append(m)
min_v = 2018
for i in range(0, len(x)-1):
    tmp = np.amin(np.mod([x[i]*x[j] for j in range(i+1, len(x))], 2019))
    if tmp < min_v:
        min_v = tmp

print(min_v)

import numpy as np
L, R = list(map(int, input().split(' ')))
x = []
x.append(L % 2019)
for i in range(L+1, R+1):
    m = i % 2019
    if s == m:
        break
    x.append(m)
min_v = 2018
for i in range(0, len(x)-1):
    tmp = np.amin(np.mod([x[i]*x[j] for j in range(i+1, len(x))], 2019))
    if tmp < min_v:
        min_v = tmp

print(min_v)

import numpy as np
L, R = list(map(int, input().split(' ')))
x = []
x.append(L % 2019)
for i in range(L+1, R+1):
    m = i % 2019
    if x[0] == m:
        break
    x.append(m)
    
min_v = 2018
for i in range(0, len(x)-1):
    tmp = np.amin(np.mod([x[i]*x[j] for j in range(i+1, len(x))], 2019))
    if tmp < min_v:
        min_v = tmp

print(min_v)

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

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

    if L == 0:
        return 0

    if (R // 2019) > ((L-1) // 2019):
        return 0

    if (R // 673) > ((L-1) // 673):
        if R - L >= 2:
            return 0
        if (R % 3) == 0 or (L % 3) == 0:
            return 0

    left = L % 2019
    return (left * (left + 1)) % MOD


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


import sys

def main():
    input = sys.stdin.readline
    L, R = map(int, input().split())
    R = min(R, L + 2019)

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

    return ans


if __name__ == '__main__':
    print(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):
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
    exit()
minn = 2*(10**9)*2
for i in range(l, r+1):
    for j in range(i+1, r+1):
        if minn > i * j % 2019:
        minn = min(minn, i * j % 2019)
print(minn)

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

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

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


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

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

L,R = map(int,input().split())
a = L%2019
b = R%2019
N = 2018
if R-L>=2019:
  print(2)
elif R-L<2019 and b>a:
  print(b*(b+1))
elif R-L<2019 and b<=a:
  print(2)

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

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

Verdicts: Runtime Error

Time Limit Exceeded

Runtime Error

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):
def main(): 

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

    f_v = s_v = 2018 

    range_t = min(2019, R-L)

    print(range_t)

    for i in range(range_t + 1):
       if f_v % 2019 > (L + i) % 2019:
           s_v = f_v
           f_v = (L + i)
       elif s_v % 2019 > (L + i) % 2019:
           s_v = (L + i)


    print(s_v * f_v % 2019)

if __name__ == "__main__":
    main() 

def main(): 

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

    min_value = 2019

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

    print(min_value)


if __name__ == "__main__":
    main() 

Verdicts: Wrong Answer

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

Submission attempts (in order):
c=list(map(int,input().split()))
l,r=c[0],c[1]
if r-l>2017:
  print(0)
else:
  ml,mr=l%2019,r%2019
  if ml>mr:
    print(0)
  else:
    mini=2019
    for i in range(mr-ml):
      for j in range(ml-mr-i):
        mini=min(mini,((ml+i)*(ml+i+1+j))%2019)
    print(mini)


c=list(map(int,input().split()))
l,r=c[0],c[1]
if r-l>2017:
  print(0)
else:
  ml,mr=l%2019,r%2019
  if ml>mr:
    print(0)
  else:
    mini=2019
    for i in range(mr-ml):
      for j in range(ml-mr-i):
        mini=min(mini,(i*(i+1+j))%2019)
    print(mini)

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

c=list(map(int,input().split()))
l,r=c[0],c[1]
if r-l>2017:
  print(0)
else:
  ml,mr=l%2019,r%2019
  if ml>mr:
    print(0)
  else:
    mini=2019
    for i in range(ml,mr+1):
      for j in range(mr+1-i):
        mini=min(mini,(i*(i+j))%2019)
    print(mini)

c=list(map(int,input().split()))
l,r=c[0],c[1]
if r-l>2017:
  print(0)
else:
  ml,mr=l%2019,r%2019
  if ml>mr:
    print(0)
  else:
    mini=2019
    print((ml,mr))
    d=mr-ml
    for i in range(d):
      for j in range(d-i):
        print((i,j))
        mini=min(mini,((ml+i)*(ml+i+1+j))%2019)
    print(mini)



c=list(map(int,input().split()))
l,r=c[0],c[1]
if r-l>2017:
  print(0)
else:
  ml,mr=l%2019,r%2019
  if ml>mr:
    print(0)
  else:
    mini=2019
    d=mr-ml
    for i in range(d):
      for j in range(d-i):
        if mini>(ml+i)*(ml+i+1+j)%2019:
        	mini=(ml+i)*(ml+i+1+j)%2019
    print(mini)

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

div_l = L//2019
div_r = R//2019
div_ll = L//673
div_rr = R//673

ans = 0
if div_l == div_r and div_ll == dir_rr:
  mod_l = L%2019
  mod_r = R%2019
  ans = mod_l * (mod_l+1)
print(ans)


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

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

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

div_l = L//2019
div_r = R//2019
div_ll = L//673
div_rr = R//673

ans = 0
if div_l == div_r and div_ll == dir_rr:
  mod_l = L%2019
  mod_r = R%2019
  ans = mod_l * (mod_l+1)
print(ans)


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

div_l = L//2019
div_r = R//2019
div_ll = L//673
div_rr = R//673

ans = 0
if div_l == div_r and div_ll == dir_rr:
  mod_l = L%2019
  mod_r = R%2019
  ans = mod_l * (mod_l+1)
print(ans)


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

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

Verdicts: Runtime Error

Wrong Answer

Runtime Error

Runtime Error

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

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

if r - l > 2020:
    r = l + 2020

ans = 2020
for i in range(l):
    for j in range(i+1,r):
        sub = i*j%2019

        if sub < ans:
            ans = sub

print(ans)


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

if r - l > 2020:
    r = l + 2020

ans = 2020
for i in range(l,r):
    for j in range(i+1,r+1):
        sub = (i*j)%2019

        if sub < ans:
            ans = sub

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):
from itertools import permutations
l, r = map(int,input().split())
a = []
for i in range(l,r+1):
    tmp = i%2019
    if tmp not in a:
        a.append(tmp)
print (a)
perm = permutations(a,2)
min = 2019
for i in list(perm):
    tmp = i[0]*i[1]%2019
    if min > tmp:
        min = tmp
print(min)


from itertools import permutations
l, r = map(int,input().split())
a = []
for i in range(l,r+1):
    tmp = i%2019
    if tmp not in a:
perm = permutations(a,2)
min = 2019
for i in list(perm):
    tmp = i[0]*i[1]%2019
    if min > tmp:
        min = tmp
print(min)


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

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())
i=1
temp=0
while r>2019*i:
  if l<=2019*i:
    temp=1
    break
  i=i+1

count=2019
r=r%2019
l=l%2019
for i in range(0,r+1):
  for j in range(l+1,r+1):
    temp=(i*j)%2019
    count=min(count,temp)

if temp==1:
  print(0)
else:
  print(count)

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

l,r=map(int,input().split())
i=1
temp=0
while r>2019*i:
  if l<=2019*i:
    temp=1
    break
  i=i+1

count=2019
r=r%2019
l=l%2019
for i in range(l,r+1):
  for j in range(i+1,r+1):
    temp1=(i*j)%2019
    count=min(count,temp1)

if temp==1:
  print(0)
else:
  print(count)

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

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


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

print((i%2019)*(j%2019))

i, j = map(int, input().split())
a = i % 2019
a_r = i // 2019

b = j % 2019
b_r = j // 2019

if a_r == b_r:
    minv = float('INF')
    for first in range(a, b):
        for second in range(a+1, b+1):
            result = first*second%2019
            if result < minv:
                minv = result

    print(minv)
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):
import sys

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

import sys

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

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 os

MOD = 2019


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    L, R = list(map(int, sys.stdin.readline().split()))
    ret = float('inf')
    print(L, R)
    for i in range(L, R):
        for j in range(L + 1, R + 1):
            ret = min(ret, (i * j) % MOD)

    print(ret)


if __name__ == '__main__':
    main()


import sys
import os

MOD = 2019


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    L, R = list(map(int, sys.stdin.readline().split()))
    ret = float('inf')

    l, r = L%MOD, R%MOD
    for i in range(l, r+1):
        for j in range(l+1, R+1):
            ret = min(ret, (i * j) % MOD)

    print(ret)


if __name__ == '__main__':
    main()


import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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

    print(ret)


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

P = 2019

L = L%2019
R = min(R, L+4038)

tmp = 2018
for i in range(L, R):
    for j in range(L+1, R+1):
        tmp = min((i*j)%P, tmp)
        
print(tmp)

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

P = 2019

def mul(a, b):
    return ((a % P) * (b % P)) % P

R = min(R, l+4038)

tmp = 10**9
for i in range(L, R):
    for j in range(L+1, R+1):
        tmp = min(mul(i, j), tmp)
        
print(tmp)

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

P = 2019

R = min(R, L+673)

tmp = 2018
for i in range(L, R):
    for j in range(L+1, R+1):
        tmp = min((i*j)%P, tmp)
        
print(tmp)

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())
li = []
if R-L+1 >= 2019:
  print(0)
else:
  for i in range(L, R+1):
    for j in range(L, R+1):
      a = i*j
      if a < 2019:
        li.append(a)
      else:
        while a > 2019:
          a %= 2019
          li.append(a)
  print(min(li))

L, R = map(int, input().split())
li = []
if R-L+1 >= 2019:
  print(0)
else:
  for i in range(L, R+1):
    for j in range(L, R+1):
      if i != j:
        a = i*j
        if a < 2019:
          li.append(a)
        else:
          while a > 2019:
            a %= 2019
            li.append(a)
  print(li)

L, R = map(int, input().split())
li = []
for i in range(L, min(L+4038, 2000000000)):
  li.append(i%2019)
a = min(li)
li.remove(min(li))
b = min(li)
li.remove(min(li))
print(a*b)
       

L, R = map(int, input().split())
li = []
for i in range(L, min(L+10000, 2000000000)):
  li.append(i%2019)
a = min(li)
li.remove(min(li))
b = min(li)
li.remove(min(li))
print(a*b)

L, R = map(int, input().split())
li = []
for i in range(L, min(L+2019, 2000000000)):
  li.append(i%2019)
a = min(li)
li.remove(min(li))
b = min(li)
li.remove(min(li))
print(a*b)

L, R = map(int, input().split())
li = []
li_a =[]
if R-L+1 >= 2019:
  print(0)
else:
  for i in range(L, R+1):
    li.append(i%2019)
  for x in li:
    for y in li:
      if x != y:
        li_a.append((x*y)%2019)
  print(min(li_a))

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):
import itertools
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
	ans=0
else:
	L%=2019
	R%=2019

	print(L,R)
	INF=10*9
	ans=INF
	for c in itertools.combinations(range(min(L,R),max(L,R)),2):
		ans=min(ans,(c[0]*c[1])%2019)
print(ans)

import itertools
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
	ans=0
else:
	L%=2019
	R%=2019
	INF=10*9
	ans=INF
	for i in itertools.combinations(range(L,R+1),2):
		ans=min(ans,(i*j)%2019)
print(ans)

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


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

Verdicts: Wrong Answer

Runtime Error

Wrong Answer

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

Submission attempts (in order):
L,R = map(int,input().split())
m = 10**18
if R-L>=2019:
    print(0)
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            m = min(m,i*j%2019)
            print(m)

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

L,R = map(int,input().split())
m = 10**18
if R-L>=2019:
    print(0)
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            m = min(m,i*j%2019)
    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 = map(int, input().split())
if r < 2019:
    print(l*r)
elif l <= 2019 and 2019 <= r:
    print(0)
elif l > 2019:
    if (r-l) >= 2018:
        print(0)
    else:
        new_l = l % 2019
        new_r = r % 2019
        count_l = l // 2019
        count_r = r // 2019
        if new_r >= 2 and count_l != count_r:
            print(2)
        else:
            num = 2019
            for i in range(l, r+1):
                for j in range(i, r+1):
                    ans = (i*j)%2019
                    if ans < num:
                        num = ans
            print(num)

l, r = map(int, input().split())
if r < 2019:
    print(l*r)
elif l <= 2019 and 2019 <= r:
    print(0)
else:
    if (r-l) >= 2018:
        print(0)
    else:
        new_l = l % 2019
        new_r = r % 2019
        count_l = l // 2019
        count_r = r // 2019
        if new_r >= 2 and count_l != count_r:
            print(2)

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

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 , r = L//2019, R//2019
if R - L >= 2019:
    print(0)
else:
    flag=0
    Amari=[]
    for i in range(R-1):
        for j in range(i+1,L+1):
            amari = (i*j) % 2019
            Amari.append(amari)
    print(min(Amari))


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

else:
    Amari=[]
    for i in range(L,R):
        for j in range(i+1,R+1):
            k = i*j
            Amari.append(k%2019)
    print(min(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):
import math

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

mod = 2019

l = L % 2019
r = R % 2019

if l >= r:
    print(0)
    exit()
else:
    _min = 2*1000000000+5
    for i in range(l, r):
        for j in range(i, r+1):
            _min = min(_min, i*j%mod)

print(_min)

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

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

ans = 100000000+5
for i in range(L, R):
    for j in range(i+1, R+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):
L,R = list(map(int,input().split()))
 
min = 20000000
 

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

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

for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

print(tmp,L)

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

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

for i in range(L,R+1):
    tmp = i
    if tmp % 2019 == 0:
        break

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

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 >= 2018:
  print(0)
  exit()
else:
  a = 2018
  x = list(range(l,r+1))
  for i in range(r+1-l):
    a = min(a,x[i]%2019)
    print(a)
    if x[i]%2019 == 0:
      print(0)
      exit()
  print(a*(a+1))

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
L,R = map(int,input().split())
if(L<=R-2018)or(L==0):
  print(0)
else:
  ans = 2020
  l = L%2019
  r = R%2019
  for i in range(l,r):
    for j in range(i+1,r):
      min(ans,(i*j)%2019)
  print(ans)
    

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

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

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


L,R = map(int,input().split())
h = L//2019
h += 1
if(L<=2019*h)and(2019*h<=R):
  print(0)
else:
  ans = 2020
  l = L%2019
  r = R%2019
  for i in range(l,r):
    for j in range(i+1,r):
      min(ans,(i*j)%2019)
  print(ans)
    


L,R = map(int,input().split())
ans = 3000
for i in range(L,R+1):
  if(i%2019==0):
    ans = 0
    break
if ans>0:
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      k = (i*j)%2019
      ans = min(ans,k)
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())
min2019 = L
while True:
    if min2019 % 2019 == 0:
        break
    else:
        min2019 -= 1

if min2019 + 2019 <= R+1:
    max2019 = 2018
else:
    max2019 = R % 2019

min2019 = L % 2019

print(min2019, max2019)

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


L, R = map(int, input().split())
min2019 = L
while True:
    if min2019 % 2019 == 0:
        break
    else:
        min2019 -= 1

if min2019 + 2019 < R:
    max2019 = 2018
else:
    max2019 = R

min2019 = L

print(min2019, max2019)

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


L, R = map(int, input().split())
mod = []
for i in range(L, R+1):
    if i % 2019 not in mod:
        mod.append(i % 2019)
    else:
        break

ans = mod[0] * mod[1] % 2019
for i in range(len(mod)):
    for j in range(i+1, len(mod)):
        if mod[i] * mod[j] % 2019 <= ans:
            ans = mod[i] * mod[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 = (int(i) for i in input().split())

if l <= 2019 <= r or r <= 2019 <= l:
  print(0)
  exit()

while l // 2019 > 0 or r // 2019 > 0:
  l = l % 2019
  r = r % 2019

mini = 2*(1e+9)
print(l,r)
if l < r:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      print(i,j)
      mini = min(mini, (i*j) % 2019)
elif l > r:
  for i in range(r,l+1):
    for j in range(i+1,l+1):
      print(i,j)

      mini = min(mini, (i*j) % 2019)
elif l == r:
  print(l*r% 2019)
  exit(0)
print(mini)

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

if l <= 2019 <= r or r <= 2019 <= l or r - l >= 2019 or l - r >= 2019:
  print(0)
  exit(0)

while l // 2019 > 0 or r // 2019 > 0:
  l = l % 2019
  r = r % 2019

mini = 2*(1e+9)
if l < r:
  for i in range(l,r+1):
    for j in range(i+1,r+1):
      mini = min(mini, (i*j) % 2019)
elif l > r:
  for i in range(r,l+1):
    for j in range(i+1,l+1):

      mini = min(mini, (i*j) % 2019)
elif l == r:
  print(l*r% 2019)
  exit(0)
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())
result = R*R
if R - L + 1 > 2019:
    R = L + 2018
for i in range(L,R+1):
    print("i="+str(i))
    for j in range(i+1,R+1):
        print("j="+str(j))
        if (i * j) % 2019 < result:
            result = (i * j) % 2019
print(result)

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

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

input = sys.stdin.readline


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

    if r // 2019 * 2019 >= 1:
        print(0)
    else:
        num = [i for i in range(l, min(r + 1, l + 2019))]
        min_ = 2019
        for i, n in enumerate(num):
            for j in num[i + 1 :]:
                min_ = min([n * j % 2019, min_])
        print(min_)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


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

    if r // 2019 >= 1:
        print(0)
    else:
        l = l % 2019
        r = r % 2019
        num = [i for i in range(l, r + 1)]
        min_ = 2019
        for i, n in enumerate(num):
            for j in num[i + 1 :]:
                min_ = min([n * j % 2019, min_])
        print(min_)


if __name__ == "__main__":
    main()

import sys

input = sys.stdin.readline


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

    if r // 2019 >= 1:
        print(0)
    else:
        num = [i for i in range(l, min(r + 1, l + 2019))]
        min_ = 2019
        for i, n in enumerate(num):
            for j in num[i + 1 :]:
                min_ = min(n * j % 2019, min_)
        print(min_)


if __name__ == "__main__":
    main()


import sys

input = sys.stdin.readline


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

    if r // 2019 >= 1:
        print(0)
    else:
        print(1)


if __name__ == "__main__":
    main()


import sys
import math
import itertools

input = sys.stdin.readline


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

    if r - l >= 2019:
        print(0)
        return
    else:
        num = [i for i in range(l, min(l + 2019, r + 1))]
        min_ = 2019
        for i, n in enumerate(num):
            for j in num[i + 1 :]:
                min_ = min([n * j % 2019, min_])
    print(min_)


if __name__ == "__main__":
    main()


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):
N,M=list(map(int,input().split()))
if M-N>2018 or (N%2019>M%2019):
    print(0)
else:

    N=N%2019
    M=M%2019
    ans=2018
    for i in range(N,M+1):
        for j in range(i,M+1):
            ans=min(ans,(i*j)%2019)
    print(ans)

N,M=list(map(int,input().split()))
if M-N>2018 or (N%2019>M%2019):
    print(0)
else:


    ans=2018
    for i in range(N,M+1):
        for j in range(i+1,M+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):
from fractions import gcd


l, r = map(int, input().split())
lr_ans = []
if r - l + 1 >= 2019:
    print(2)
    exit()
for i in range(l, min(l+2019+1, r+1)):
    lr_ans.append(i%2019)
lr_ans.sort()
print(int((lr_ans[0]*lr_ans[1])/gcd(lr_ans[0], lr_ans[1])))

from fractions import gcd


l, r = map(int, input().split())
lr_ans = []
if r - l + 1 >= 2019:
    print(0)
    exit()
for i in range(l, min(l+2019+1, r+1)):
    lr_ans.append(i%2019)
lr_ans.sort()
print(int((lr_ans[0]*lr_ans[1])/gcd(lr_ans[0], lr_ans[1])))

from fractions import gcd


l, r = map(int, input().split())
lr_ans = []
if r - l  >= 2019:
    print(0)
    exit()
for i in range(l, r+1):
    lr_ans.append(i%2019)
lr_ans.sort()
print(int((lr_ans[0]*lr_ans[1])/gcd(lr_ans[0], lr_ans[1])))

from fractions import gcd


l, r = map(int, input().split())
lr_ans = []
for i in range(l, r+1):
    lr_ans.append(i%2019)
lr_ans.sort()
print(int(lr_ans[0]*lr_ans[1]/gcd(lr_ans[0], lr_ans[1])))

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

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Runtime Error

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

Submission attempts (in order):
l, r = list(map(int,input().split()))
Set = set([l%2019])
for i in range(r-l):
	Set.add((l+1+i)%2019)
List = list(Set)
answer = (l * r) % 2019
k = 0
for i in range(len(List)):
	for j in range(len(List)):
		if(i < j):
			if(k == 0 or (i >= 45 and j >= 46))
				if(answer > (List[i] * List[j])% 2019):
					answer = (List[i] * List[j])% 2019
					k = 1
print(answer)

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

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())
m=min(R-L,2020)
i=2020
j=2020
for n in range(L,L+m+1):
    if i>j:
        i=min(i,n%2019)
    else:
        j=min(j,n%2019)
    print(n,i,j)
print((i*j)%2019)

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

Verdicts: Wrong Answer

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

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

if R-L > 2019:
  print (0)
else:
  mod1 = L%2019
  print ("mod1", mod1)
  mod2 = R%2019
  print("mod2", mod2)
  if mod2 < mod1:
    print (0)
  else:
    modmin =2019 -1
    for i in range(L,R+1):
      for j in range(i+1,R+1):
        mod3 = (i*j)%2019
#        print (i,j,mod3)
        if mod3 == 0:
          print(0)
          sys.exit()
        elif modmin > mod3:
          modmin = mod3
    
    print(modmin)

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

#if R-L > 2019:
#  print (0)
#else:
#  mod1 = L%2019
#  mod2 = R%2019
#  if mod2 < mod1:
#    print (0)
#    sys.exit()
#  else:
  modmin =2019 -1
  for i in range(L,R):
    for j in range(i+1,R+1):
      mod3 = (i*j)%2019
      if mod3 =0:
        print(0)
        sys.exit()
      elif modmin > mod3:
        modmin = mod3

  print(modmin)
  

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

#if R-L > 2019:
#  print (0)
#else:
#  mod1 = L%2019
#  mod2 = R%2019
#  if mod2 < mod1:
#    print (0)
#    sys.exit()
#  else:
modmin =2019 -1
for i in range(L,R):
  for j in range(i+1,R+1):
    mod3 = (i*j)%2019
    if mod3 == 0:
      print(0)
      sys.exit()
    elif modmin > mod3:
      modmin = mod3

print(modmin)


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

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

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

        if result == 0:
            break

    print(result)


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

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

else:
    result = 2019
    for i in range(num, r-l+num):
        for j in range(i+1, r-l+num+1):
            result = min(result, i*j%2019)

    print(result)

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 -*-
from itertools import combinations
print(673*3)
def solve():
    L, R = map(int, input().split())
    l, r = L%2019, R%2019
    if R-L >= 2019-1 or l >= r or l == 0:
        return '0'
    elif R-L >= 673-1 or ((R-L >= 3-1 or L%3 >= R%3 or L%3 == 0) and L%673 >= R%673) or ((R-L >= 3-1 or L%3 >= R%3 or L%3 == 0) and L%673 == 0):
        return '0'
    elif R-L == 1:
        return str((L*R)%2019)
    else:
        return str(min((i*j)%2019 for i, j in combinations(range(L,R+1),r=2)))

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


# -*- coding: utf-8 -*-
from itertools import combinations
def solve():
    L, R = map(int, input().split())
    l, r = L%2019, R%2019
    if R-L >= 2019-1 or l >= r or l == 0:
        return '0'
    elif R-L >= 673-1 or ((R-L >= 3-1 or L%3 >= R%3 or L%3 == 0) and L%673 >= R%673) or ((R-L >= 3-1 or L%3 >= R%3 or L%3 == 0) and L%673 == 0):
        return '0'
    elif R-L == 1:
        return str((L*R)%2019)
    else:
        return str(min((i*j)%2019 for i, j in combinations(range(L,R+1),r=2)))

if __name__ == '__main__':
    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())
li=[]
for i in range(L,R):
  for j in range(i+1,R+1):
      if i*j>=2019**2:
        break
      mod=(i*j)%2019
      li.append(mod)
      if mod==0:
        break
print(min(li))


L,R=map(int,input().split())
li=[]
for i in range(L,R):
  for j in range(i+1,R+1):
    while i*j<2019**2:
      mod=(i*j)%2019
      li.append(mod)
      if mod==0:
        break
print(min(li))


L,R=map(int,input().split())
R=min(R, L+2019)
li=[]
for i in range(L,R):
  for j in range(i+1,R+1):
      mod=(i*j)%2019
      li.append(mod)
      if mod==0:
        break
print(min(li))

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())
import numpy as np
if r-l+1 >= 2019 or 3 <= r-l+1 <= 673:
  print(0)
else:
  k = sorted(np.mod(np.array([i for i in range(l,r+1)]),2019))
  print((k[0] * k[1])%2019)

l,r = map(int, input().split())
import numpy as np
MOD = 2019
if r-l+1 >= 673:
  print(0)
else:
  k = sorted(np.mod(np.array([i for i in range(l,r+1)]),MOD))
  print(k)
  print((k[0]*k[1])%MOD)

l,r = map(int, input().split())
import numpy as np
import itertools
MOD = 2019
if r-l+1 >= 673:
  print(0)
else:
  k = [i for i in range(l,r+1)]
  can = [0] * ((r-l+1)*(r-l)//2)
  for idx,(m,n) in enumerate(itertools.combinations(k,2)):
    can[idx] = (m*n)%MOD
  print(min(can))

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 itertools
L,R = map(int,input().split())
if R-L >= 2018:
  print(0);exit()
li = [i%2019 for i in range(L,R+1)]
li = list(set(li))
if 0 in li or 3 in li or 673 in li:
  print(0);exit()
pro = []
for i,j in itertools.combinations(li,2):
  pro.append(i*j%2019)
print(min(pro))

import itertools
L,R = map(int,input().split())
if R-L >= 2018:
  print(0);exit()
li = [i%2019 for i in range(L,R+1)]
li = list(set(li))
if 0 in li or (3 in li and 673 in li):
  print(0);exit()
pro = []
for i,j in itertools.combinations(li,2):
  pro.append(i*j%2019)
print(min(pro))

Verdicts: Wrong Answer

Accepted