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):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

if __name__ == '__main__':
    main()

def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

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

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

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

print(ans)


Verdicts: Wrong Answer

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

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

if r-l >= 2018:
    print(0)
else:
    cand = []
    ans = float("inf")
    for i in range(l,r+1):
        cand.append(i%2019)
    cand = sorted(cand)
    for i in range(len(cand)):
        for j in range(i,len(cand)):
            ans = min(ans,cand[i]*cand[j]%2019)
    print(ans)


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

if r-l >= 2018:
    print(0)
else:
    cand = []
    ans = float("inf")
    for i in range(l,r+1):
        cand.append(i%2019)
    cand = sorted(cand)
    for i in range(len(cand)):
        for j in range(i+1,len(cand)):
            ans = min(ans,cand[i]*cand[j]%2019)
    print(ans)


Verdicts: Wrong Answer

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

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

dic = {}
for i in range(l, r + 1):
    remainder = i % 2019
    if remainder in dic.keys():
        break
    else:
        dic[remainder] = 1

l = list(dic.keys())
l.sort()

print(l)
print((l[0] * l[1]) % 2019)

import sys

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

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

ans = 2019
for i in range(l, r):
    for j in range(i + 1, r + 1):
        i %= 2019
        j %= 2019
        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):
#include <bits/stdc++.h>
#include <math.h>
using namespace std;


            
int main() {
    int L, R;
    cin >> L >> R;
  
    int range = R - L;
    vector<int> mod;
  
    if (range >= 2019) {
        cout << 0 << endl;
    } else {
        for (int i = 0; i < (range + 1); i++) {
            for (int j = 1; j <= (range - i); j++) {
                int ij = (L + i) * (L + i + j);
                mod.push_back(ij % 2019);
            }
        }
        vector<int>::iterator iter = min_element(mod.begin(), mod.end());
        cout << *iter << endl;
    }
  
    return 0;
}





import math

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

if (R-L) >= 2019:
  print(0)
else:
  l = L % 2019
  r = l + (R - L)
  if r >= 2019:
    print(0)
  else:
    all_e = []
    for i in range(r-l+1):
      for j in range(r-l-i):
        all_e.append((l+i)*(l+i+j+1))
    for i in range(len(all_e)):
      all_e[i] = all_e[i] % 2019
    print(min(all_e))

  

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

l = l % 2019
r = r % 2019
l = min(l,r)
r = max(l,r)
if r == l:
  print((r*l) %2019)
  exit()
for i in range(l,r+1):
  for j in range(i,r+1):
    if i != j:
      ans += [(i * j) %2019]
      
print(min(ans))


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


Verdicts: Runtime Error

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

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

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


Verdicts: Wrong Answer

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

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

mod = 2019
for i in range(1000):
  if L <= 3**i%(1e9+7) <= R or L <= 673**i%(1e9+7) <= R or L <= 3*673*i%(1e9+7) <= R or L <= 3*i%(1e9+7) <= R or L <= 673*i%(1e9+7) <= R or L <= 3*673**i%(1e9+7) <= R:
    print(0)
    exit()
else:
  print(min((L*(L+1))%mod, R*(R-1)%mod, R*L%mod))

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

mod = 2019
for i in range(500):
  if L <= 3**i%(1e9+7) <= R or L <= 673**i%(1e9+7) <= R or L <= 3*673*i%(1e9+7) <= R or L <= 3*i%(1e9+7) <= R or L <= 673*i%(1e9+7) <= R or L <= 3*673**i%(1e9+7) <= R:
    print(0)
    exit()
else:
  print(min((L*(L+1))%mod, R*(R-1)%mod, R*L%mod))

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

mod = 2019
for i in range(500):
  if L <= (3**i)%(1e9+7) <= R or L <= (673**i)%(1e9+7) <= R or L <= (3*673*i)%(1e9+7) <= R or L <= (3*i)%(1e9+7) <= R or L <= (673*i)%(1e9+7) <= R:
    print(0)
    exit()
else:
  print(min((L*(L+1))%mod, R*(R-1)%mod, R*L%mod))

mod = 2019
for i in range(100):
  if L <= 3**i <= R or L <= 673**i <= R or L <= 3*673*i <= R or L <= 3*i <= R or L <= 673*i <= R or L <= 3*673**i <= R:
    print(0)
    exit()
else:
  print(min((L*(L+1))%mod, R*(R-1)%mod, R*L%mod))

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

mod = 2019
for i in range(10000):
  if L <= (3*673*i)%(1e9+7) <= R or L <= (3*i)%(1e9+7) <= R or L <= (673*i)%(1e9+7) <= R:
    print(0)
    exit()
else:
  print(min((L*(L+1))%mod, R*(R-1)%mod, R*L%mod))

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

mod = 2019
ans = int(2*1e9+7)
for i in range(L,L+2019):
  ans = min(ans, i*(i+1)%mod)
for i in range(R, R-2020, -1):
  ans = min(ans, i*(i-1)%mod)
print(ans)

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

mod = 2019
for i in range(100):
  if L <= (3**i)%(1e9+7) <= R or L <= (673**i)%(1e9+7) <= R or L <= (3*673*i)%(1e9+7) <= R or L <= (3*i)%(1e9+7) <= R or L <= (673*i)%(1e9+7) <= R or L <= ((3*673)**i)%(1e9+7) <= R:
    print(0)
    exit()
else:
  print(min((L*(L+1))%mod, R*(R-1)%mod, R*L%mod))

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

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

if (R//2019-L//2019)>0: 
  print(0)
  exit(0)
  
if (R//673-L//673)>0:
  print(0)
  exit(0)
  
ll, rr = L//2019, R//2019
for i in range(1, 2018):
  for j in range(ll,rr+1):
    l_, r_ = j*2019+i,j*2019+i+1
    print('%d %d'%(l_,r_))
    if L<=l_ and r_<=R:
      print(((j*2019+i)*(j*2019+i+1))%2019)
      exit(0)

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

if R-L>=2018: print(0)
else:
  min_=2018
  for i in range(L,R):
    for j in range(i+1,R+1):
      min_=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):
import sys
L,R = map(int,input().split())
for i in range(L,R+1):
    if i%2019 = 0:
        print(0)
        sys.exit()
for i in range(l,r):
    for j in range(i+1,r+1):
            a = (i*j)%2019
            c.append(a)
print(min(c))


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


import sys
L,R = map(int,input().split())
for i in range(L,R+1):
    if i%2019 == 0:
        print(0)
        sys.exit()
l = L%2019
r = R%2019
c = []
for i in range(l,r):
    for j in range(i+1,r+1):
            a = (i*j)%2019
            c.append(a)
print(min(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):
l, r = map(int, input().split())

i_max =	min(r, l+2019)
mod_min = 2019
for i in range(l, i_max):
    j_max = min(r, i+2019)
    for	j in range(i+1, j_max+1):
	mod = (i*j) % 2019
        if mod < mod_min:
            mod_min = mod

print(mod_min)

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

i_max = min(r, l+2019)
mod_min = 2019
for i in range(l, i_max):
    j_max = min(r, i+2019)
    for j in range(i+1, j_max+1):
        mod = (i*j) % 2019
        if mod < mod_min:
            mod_min = mod

print(mod_min)


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 = [int(_) for _ in input().split()]

# L, R = [2019 * 2 - 2014, 2019 * 2 + 1]
LR_res = [L % 2019, R % 2019]
LR_res.sort()
l, r = LR_res
print(l, r)
ans = 2018
for i in range(l, r + 1):
    for j in range(i + 1, r + 1):
        ans = min(ans, (i * j) % 2019)
        # print(i,j)
        if ans == 0:
            print(ans)
            exit()

print(ans)

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

# L, R = [4 + 2019, 5 + 2019 ]
if L - R >= 2019:
    ans = 0
    print(ans)
else:
    ans = 2018
    for i in range(L, R + 1):
        for j in range(i + 1, R + 1):
            ans = min(ans, (i * j) % 2019)
            if ans == 0:
                print(ans)
                exit()

print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
a,s=map(int,input().split())
if s-a<2019:
  a=0
  for i in range(a,s):
      for f in range(i+1,s+1):
        a=max(a,((i%2019)*(f%2019))%2019)
  print(a)
else:
  print(2018)

a,s=map(int,input().split())
if s-a<2019:
  ans=0
  for i in range(a,s):
      for f in range(i+1,s+1):
        ans=max(ans,((i%2019)*(f%2019))%2019)
  print(ans)
else:
  print(2018)

a,s=map(int,input().split())
if s-a<2019:
  ans=0
  for i in range(a,s):
      for f in range(i+1,s+1):
        ns=max(ans,((i%2019)*(f%2019))%2019)
  print(a)
else:
  print(2018)

a,s=map(int,input().split())
if s-a<2019:
  ans=0
  for i in range(a,s):
      for f in range(i+1,s+1):
        ns=max(ans,((i%2019)*(f%2019))%2019)
  print(ans)
else:
  print(2018)

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

Verdicts: Wrong Answer

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())
ans = 2019
mod = 2019

if r//mod - l//mod >= 1:
  print(0)
  exit()
  
l = l%mod
r = r%mod

if r < l:
  print(0)
  exit()

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

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

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

Verdicts: Wrong Answer

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

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

mod = 2019
a = l%2019
b = l%2019

if r-l >= 2018:
  print(0)

else:
  if a < b:
    print(a*a+1)
  else:
    print(0)

l,r = map(int,input().split())
mod = 2019
a = l%mod
b = r%mod

if r-l >= 2018:
    print(0)

else:
    if a > b:
        print(0)
    else:
        t = (a*(a+1))%mod
        for x in range(a,b):
            for y in range(x+1,b+1):
                if (x*y)%mod < t:
                    t = (x*y)%mod
        print(t)

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

from collections import defaultdict

d = defaultdict(int)

for i in range(L,R+1):
  d[i%2019] += 1
  if d[0]>0 and len(d)>1:
    break

print(d)
cnt = 0
ans = list()

for k,v in sorted(d.items()):
  _v = v
  
  while _v > 0:
    cnt +=1
    ans += [k]
    _v -= 1
    if cnt >=2:
      print((ans[0]*ans[1])%2019)
      break
  if cnt >=2:
    break    


L,R = list(map(int,input().split()))
from itertools import combinations

numbers = [i for i in range(L,min(R+1,L+2019))]
ans = 2019
for conb in combinations(numbers,2):
  if ans > (conb[0]*conb[1])%2019:
     ans = (conb[0]*conb[1])%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
def input():
    return sys.stdin.readline().rstrip()

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

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

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc133","c",main)


#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

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

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

# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc133","c",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):
l,r = map(int,input().split())
if r-l>=2019:
  print(0)
  exit()
l = l%2019
r = r%2019
ans = 2018
for i in range(l):
  for j in range(r):
    ans = min(ans,i*j%2019)
print(ans)    

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
import itertools

L, R = map(int, input().split())
comb = itertools.combinations(range(L, R + 1), 2)
result = float('inf')
for a, b in comb:
    mod = a * b % 2019
    if mod == 0:
        result = 0
        break
    else mod < result:
        result = mod
print(result)

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

Verdicts: Runtime Error

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

Submission attempts (in order):
L, R = map(int, input().split())
L %= 2019
R %= 2019
if L > R:
    R += 2019

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

print(val)


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

    print(val)


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

    print(val)


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

module = []
for i in range(L, R):
    for j in range(i+1, R+1):
        print("({} * {}) mod 2019 = {}".format(i, j, (i * j) % 2019))
        if (i * j) % 2019 == 0:
            print("0")
            exit()
        else:
            module.append((i * j) % 2019)

if not module:
    print("0")
else:
    print(min(module))


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

module = []
for i in range(L, R):
    for j in range(i+1, R+1):
        #print("({} * {}) mod 2019 = {}".format(i, j, (i * j) % 2019))
        if (i * j) % 2019 == 0:
            print("0")
            exit()
        else:
            module.append((i * j) % 2019)

if not module:
    print("0")
else:
    print(min(module))


Verdicts: Wrong Answer

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

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

ans =[]
if R - L <= 2019:
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans.append(i*j%2019)
            if i*j% == 0 :
                exit()

print(min(ans))


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

ans =[]
    for i in range(L,R+1):
        for j in range(i+1,R+1):
            ans.append(i*j%2019)
            if i*j% 2019== 0 :
                exit()

print(min(ans))


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

ans =[]
for i in range(L,R+1):
    for j in range(i+1,R+1):
        ans.append(i*j%2019)
        if (i * j % 2019) == 0:
            break
    else:
        continue
    break

print(min(ans))

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

l_mod = l % 2019
r_mod = r % 2019

if l_mod >= r_mod:
    print(0)
else:
    min_val = 2020
    for i in range(r_mod - l_mod + 1):
        for j in range(r_mod - l_mod + 1):
            

#                 continue
#            print([l_mod+i,l_mod+j])
            min_val = min([min_val, ((l_mod+i)*(l_mod+j))%2019])
#            print(((l_mod+i)*(l_mod+j))%2019)
            
    print(min_val)

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

l_mod = l % 2019
r_mod = r % 2019

if l_mod >= r_mod:
    print(0)
else:
    min_val = 2020
    for i in range(r_mod - l_mod ):
        for j in range(r_mod - l_mod + 1):
            

#                 continue
#            print([l_mod+i,l_mod+j])
            min_val = min([min_val, ((l_mod+i)*(l_mod+j))%2019])
#            print(((l_mod+i)*(l_mod+j))%2019)
            
    print(min_val)

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

 
if r - l >= 2019:
    print(0)
else:
    l_mod = l % 2019
    r_mod = r % 2019
    min_val = 2020
    for i in range(r_mod - l_mod + 1):
        for j in range(r_mod - l_mod + 1):
            if i >= j:
                continue
            min_val = min([min_val, ((l_mod+i)*(l_mod+j))%2019])
            
    print(min_val)

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

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

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):
list1 = [int(i) for i in input().split()]
l = list1[0]
r = list1[1]
if (l// 2019 != r//2019):
	print(0)
else:
	max1 = 0 
	for i in range(l,l+2020):
		for j in range(i,l+2020):
			temp = (i%2019)*(j%2019)
			if temp > max1 :
				max1 = temp 
	print(max1)			

z = [int(i) for i in input().split()]
l = z[0]
r = z[1]
if l == 2019 or r == 2019 :
  print(0)
elif r < 2019 :
  print(l*(l+1))
elif r > 2019 and l > 2019 :
  flag = 0 
  if l - r >= 2019:
    for i in range(l,l+2020):
      if i%2019 == 0:
        number = i 
        flag = 1 
        break
  else :
    for i in range(l,r+1):
      if i % 2019 == 0 :
       	flag = 1 
        break
  if flag == 1 :
    print(0)
  else :
    print(l*(l+1)
   
      
  
  

z = [int(i) for i in input().split()]
l = z[0]
r = z[1]
if l == 2019 or r == 2019 :
  print(0)
elif r < 2019 :
  print(l*(l+1))
elif r > 2019 and l > 2019 :
  flag = 0 
  if l - r >= 2019:
    for i in range(l,l+2020):
      if i%2019 == 0:
        number = i 
        flag = 1 
        break
	if flag == 1 :
		print(0)
	else :
    	print((number%2019)*((number+1)%2019)    
  else :
    for i in range(l,r+1):
      if i % 2019 == 0 :
       	flag = 1 
        break
	  if flag == 1 :
	    print(0)
	  else :
	    print( (l%2019)*((l+1)%2019))

z = [int(i) for i in input().split()]
l = z[0]
r = z[1]
if l == 2019 or r == 2019 :
  print(0)
elif r < 2019 :
  max1 = 0 
  for i in range(l,r+1):
    for j in range(i,r+1):
      	temp = (i%2019)*(j%2019)
        if temp > max1:
          max1 = temp
  print(max1)        
                   
    
elif r > 2019 and l > 2019 :
  flag = 0 
  if l - r >= 2019:
    print(0)
  else:
    max1 = 0 
    for i in range(l,l+2020):
      for j in range(i,l+2020):
          temp = (i%2019)*(j%2019)
          if temp > max1:
            max1 = temp
    print(max1)        
                   
    
    
  

list1 = [int(i) for i in input().split()]
l = list1[0]
r = list1[1]
if (l// 2019 != r//2019):
	print(0)
else:
	max1 = 10000000000
	if l - r >= 2019:
		for i in range(l,l+2020):
			for j in range(i+1,l+2020):
				temp = ((i%2019)*(j%2019))%2019
				if temp < max1 :
					max1 = temp
	else :
		for i in range(l,r+1):
			for j in range(i+1,r+1):
				temp = ((i%2019)*(j%2019))%2019
			
				if temp < max1 :
					max1 = temp
		
	print(max1)			

Verdicts: Wrong Answer

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 = 2*(10**2)
R = 2*(10**5)

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

print(L)
print(R)

list = []
if L < R :
  for i in range(L,R):
      for j in range(i+1,R+1):
          list.append(i*j%2019)

else :
  for i in range(0,2018):
    for j in range(i+1,2019):
        list.append(i*j%2019) 

print(min(list)) 

d = list(map(int, input().split()))
L = d[0]
R = d[1]

a = L//2019
b = R//2019
c = L%2019
d = R%2019

list = []

if b-a >= 2:
  print(0)

elif b-a == 1:
  if d >= c:
    print(0)
  else:
    for i in range(c,d+2019):
      for j in range(i+1,d+2019+1):
        list.append(i*j%2019)
    print(min(list)) 

else :
  for i in range(c,d):
    for j in range(i+1,d+1):
        list.append(i*j%2019)
  print(min(list)) 

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 = []
if R - L >= 2018:
    print(0)
else:
    for i in range(L,R+1):
        l.append(i%2019)
    print(sorted(l))

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

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 <= 2019 and 2019 <= R:
    ans = 0

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

#                 j += 1
print(ans)

import sys

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

if L <= 2019 and 2019 <= R:
    ans = 0

else:
    ans = 2019
    for i in range(L, R):
        for j in range(L+1, R+1):
            if (i % 2019 == 0) or (j % 2019 == 0):
                ans = 0
                print(ans)
                sys.exit()
            tmp = (i*j) % 2019
            if tmp <= ans:
                ans = tmp
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 numpy as np

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

min_ = np.inf
for i in range(L, 4040):
    for j in range(i + 1, 4040 + 1):
        if (i * j) % 2019 <= min_:
            min_ = (i * j) % 2019
            if min_ == 0:
                print(min_)
                exit()

print(min_)


import numpy as np

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

min_ = np.inf
for i in range(L, R):
    for j in range(i + 1, R + 1):
        if (i * j) % 2019 <= min_:
            min_ = (i * j) % 2019
            if min_ == 0:
                print(min_)
                exit()

print(min_)


Verdicts: Wrong Answer

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

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

if((r*(r-1))<2019): # ok
    min = (l*(l+1)) % 2019
    print('a')

elif(int(((r-1)*r)/2019) == int((l*(l+1))/2019)): # ok
    min = (l * (l+1)) % 2019
    print('b')

elif((r-l)>2 and (int(l/673) != int(r/673))):
    min = 0
    print('c')

else:
    min = (l * (l+1)) % 2019
    print('d')



print(min)

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

min=10**9
if((r-l)>=2019):
    min = 0
else:
    for i in range(l, r):
        for j in range(l+1, r+1):
            if(i<j and l<j):
                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=map(int,input().split())
lst=[]
for i in range(l,l+min(4038,r-l+1)):
    lst.append(i%2019)
ans=0
for i in range(len(lst)-1):
    for j in range(i+1,len(lst)):
        tmp=i*j%2019
        if tmp>ans:ans=tmp
print(ans)

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

l,r=map(int,input().split())
if r-l>2019:
    print(0)
    exit()
lst=[]
for i in range(l,l+min(4038,r-l+1)):
    lst.append(i%2019)
ans=2018
for i in range(len(lst)-1):
    for j in range(i+1,len(lst)):
        tmp=lst[i]*lst[j]%2019
        if tmp<ans:ans=tmp
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())


M=[]
for i in range(L, R):
    for j in range(i+1, R+1):
        #print(i,j)
        M.append((i*j)%20119)
        if M[-1]==0:
			print(0)
		exit()
print(min(M))


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


M=[]
for i in range(L, R):
    for j in range(i+1, R+1):
        #print(i,j)
        M.append((i*j)%20119)
        if M[-1]==0:
            print(0)
            exit()
print(min(M))


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


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


Verdicts: Runtime Error

Wrong Answer

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

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

s = l % mod
e = r % mod

print(s,e)

for i in range(s,e):
    for j in range(i+1,e+1):
        #m = ((i % mod) * (j % mod)) % mod
        #m = (i * j) % mod
        m = i * j
        #print(i,j,m)

        if m < mod_min:
            mod_min = m

print(mod_min)

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


for i in range(l,r):
    for j in range(i,r+1):
        m = (i * j) % mod
        if m < mod_min:
            mod_min = m
        if mod_min == 0:
            break
    if mod_min == 0:
        break

print(mod_min)

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


for i in range(l,r):
    for j in range(i+1,r+1):
        m = (i * j) % mod
        if m < mod_min:
            mod_min = m
        if mod_min == 0:
            break
    if mod_min == 0:
        break

print(mod_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):
import sys
l,r=map(int,sys.stdin.readline().split())
r=min(r,l+673)
ans=2019
for i in range(l,r+1):
    for j in range(i,r+1):
        ans=min(ans,i*j&2019)
print(min)


import sys
l,r=map(int,sys.stdin.readline().split())
r_m=r%2019
l_m=l%2019
min=2019
retu=range(l_m,r_m+1)

for i in range(len(retu)):

    for j in range(i+1,len(retu)):
        s=retu[i]*retu[j]%2019
        print(i,j)
        if s<min:
            min=s
print(min)


import sys
l,r=map(int,sys.stdin.readline().split())
r_m=r%2019
l_m=l%2019
min=2019
if r-l>2019-r_m:
    print(0)
else:
    retu=range(l_m,r_m+1)

    for i in range(len(retu)):
        for j in range(i+1,len(retu)):
            s=retu[i]*retu[j]%2019
            if s<min:
                min=s
print("min=",min)


import sys
l,r=map(int,sys.stdin.readline().split())
r_m=r%2019
l_m=l%2019
min=2019
if r-l>2019-l_m:
    print(0)
else:
    retu=range(l_m,r_m+1)

    for i in range(len(retu)):

        for j in range(i+1,len(retu)):
            s=retu[i]*retu[j]%2019
            print(i,j)
            if s<min:
                min=s
print(min)


import sys
l,r=map(int,sys.stdin.readline().split())
r_m=r%2019
l_m=l%2019
min=2019
if r-l>2019-r_m:
    print(0)
else:
    retu=range(l_m,r_m+1)

    for i in range(len(retu)):
        for j in range(i+1,len(retu)):
            s=retu[i]*retu[j]%2019
            print(s)
            if s<min:
                min=s
print("min=",min)


import sys
l,r=map(int,sys.stdin.readline().split())
r=min(r,l+673)
ans=2019
for i in range(l,r+1):
    for j in range(i+1,r+1):
        ans=min(ans,(i*j)%2019)
print(ans)


Verdicts: Wrong Answer

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 sys
readline = sys.stdin.readline

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

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

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

import sys
readline = sys.stdin.readline

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

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

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

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

ans = 2019
for i in range(L, R):
  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):
l,r = map(int,input().split())
mod = 2019
r = (r%mod) + 2019*(r-l>=2019)
l = l%mod
ans = float("inf")
for i in range(l,r):
  for j in range(i+1,r+1):
    ans = (i*j)%mod
print(ans)

l,r = map(int,input().split())
mod = 2019
r = (r%mod) + 2019*(r-l>=2019)
l = l%mod
ans = float("inf")
for i in range(l,r+1):
  for j in range(i,r+1):
    ans = (i*j)%mod
print(ans)

l,r = map(int,input().split())
mod = 2019
r = (r%mod) + 2019*(r-l>=2019)
l = l%mod
ans = float("inf")
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

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+1)//p>=0:
    print(0)
else:
    c = L%p
    d = c+1
    print(c*d)

L, R = map(int, input().split())
p = 2019
ret = p-1
if (R-L+1)//p<=0:
    for i in range(L, R):
        for j in range(i+1, R+1):
            ret = min(i*j%p, ret)
            if ret==0:
                print(0)
                break
        else:
            continue
        break
    else:
        print(ret)
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,R = list(map(int,input().split()))

dif = R - L
_L, _R = L%2019,R%2019

print(L,R,_L,_R)
if _R < _L:
  print(0)
elif _L < _R and dif >= 2018: 
  print(0)
elif _L < _R and dif < 2018:
  print(_L*(_L+1)%2019)

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

dif = R - L
_L, _R = L%2019,R%2019

if _R < _L:
  print(0)
elif _L < _R and dif >= 2018: 
  print(0)
elif _L < _R and dif < 2018:
  _m = (L*(L+1)%2019)
  for i in range(L,R):
    for j in range(i,R):
      _m = min(_m,(i*j)%2019)
  print(_m)

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

dif = R - L
_L, _R = L%2019,R%2019

if _R < _L:
  print(0)
elif _L < _R and dif >= 2018: 
  print(0)
elif _L < _R and dif < 2018:
  _m = (L*(L+1)%2019)
  for i in range(L,R+1):
    for j in range(i,R+1):
      _m = min(_m,(i*j)%2019)
  print(_m)

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

dif = R - L
_L, _R = L%2019,R%2019

if _R < _L:
  print(0)
elif _L < _R and dif >= 2018: 
  print(0)
elif _L < _R and dif < 2018:
  _m = (L*(L+1)%2019)
  for i in range(L,R+1):
    for j in range(i+1,R+1):
      _m = min(_m,(i*j)%2019)
  print(_m)

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

MOD = 2019
ans = 2018

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

"""

R = min(R, L+(2019)) 
MOD = 2019
ans = 2018

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

print(ans)



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

MOD = 2019
ans = 2018

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



Verdicts: Runtime Error

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

Submission attempts (in order):
l,r=map(int,input().split())
an=(l*(l+1))%2019

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

print(an)

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

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

print(an)

Verdicts: Wrong Answer

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

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

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

print(ans)

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

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

print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
L,R = list(map(int, input().split()))
if R-L >= 2019:
  print(0)
elif:
  M=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      L=(i * j) % 2019
      if L<M:
        M=L
print(M)

L,R = list(map(int, input().split()))
if R - L >= 2019:
  print(0)
else:
  M=2019
  for i in range(L,R):
    for j in range(i+1,R+1):
      K=i * j % 2019
      if K < M:
        M = K
  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):
A,B=map(int,input().split())
mod = 2018
flag =0
for i in range(A,B):
  x = i % 2019
  for j in range(i+1,B+1):
    j = j % 2019
    mod = min(mod, (x*j)%2019)
    if mod = 0:
      flag = 1
      break
  if flag:
    break

print(mod)

A,B=map(int,input().split())
mod = 2018
flag =0
for i in range(A,B):
  x = i % 2019
  for j in range(i+1,B+1):
    j = j % 2019
    mod = min(mod, (x*j)%2019)
    if mod == 0:
      flag = 1
      break
  if flag:
    break

print(mod)

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):
#!/usr/bin/env python3

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


if __name__ == "__main__":
    main()


#!/usr/bin/env python3

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


if __name__ == "__main__":
    main()


#!/usr/bin/env python3

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


if __name__ == "__main__":
    main()


#!/usr/bin/env python3

def main():
    l, r = map(int, input().split())
    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:
                break
        if ans == 0:
            break
    print(ans)


if __name__ == "__main__":
    main()


Verdicts: 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):
#ABC133 C

L,R = map(int,input().split())
A = []
if R - L > 2019:
    print(0)
elif 2 <= R - L and R - L <= 2019:
    for i in range(L,R):
        for j in range(i+1,R+1):
            A.append((i*j)%2019)
    print(min(A))
elif R - L = 1:
    print((R*L)%2019)

print(1)

#ABC133 C

L,R = map(int,input().split())
A = []
if R - L > 2019:
    print(0)
elif 2 <= R - L and R - L <= 2019:
    for i in range(L,R):
        for j in range(i+1,R+1):
            A.append((i*j)%2019)
            print(min(A))
elif R - L = 1:
    print((R*L)%2019)

#ABC133 C

L,R = map(int,input().split())
A = []
if R - L > 2019:
    print(0)
elif 2 <= R - L and R - L <= 2019:
    for i in range(L,R):
        for j in range(i+1,R+1):
            A.append((i*j)%2019)
    print(min(A))
elif R - L == 1:
    print((R*L)%2019)

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 = map(int, input().split())
r = min(r, l+(2019*2))
ans = 2018

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

print(ans)

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

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
L,R=map(int,input().split())
a=L-1//2019
b=L%2019
c=R//2019
d=R%2019
if a!=c:
  print("0")
else:
  if b>=d:
    d=d+2019
  f=(b*d)%2019
  for i in range(b,d):
    for j in range(i+1,d+1):
      e=(i*j)%2019
      if e<f:
        f=e
      j=j+1
    i=i+1
  print(f)
      

L,R=map(int,input().split())
a=L-1//2019
b=L%2019
c=R//2019
d=R%2019
if a!=c:
  print("0")
else:
  f=(b*d)%2019
  for i in range(b,d-1):
    for j in range(i+1,d):
      e=(i*j)%2019
      if e<f:
        f=e
      j=j+1
    i=i+1
  print(f)

l,r=map(int,input().split())
a=(l-1)//2019
b=l%2019
c=r//2019
d=r%2019
if a<c:
  print("0")
else:
  if b>=d:
    d=d+2019
  e=(b*d)%2019
  for i in range(b,d):
    for j in range(i+1,d+1):
      f=(i*j)%2019
      if f<e:
        e=f
      j=j+1
    i=i+1
  print(e)


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

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


Verdicts: Wrong Answer

Accepted