Submission #6313028


Source Code Expand

Copy
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
            ∧_∧  
      ∧_∧  (´<_` )  Welcome to My Coding Space!
     ( ´_ゝ`) /  ⌒i     @hamayanhamayan
    /   \     | |     
    /   / ̄ ̄ ̄ ̄/  |  
  __(__ニつ/     _/ .| .|____  
     \/____/ (u ⊃  
---------------------------------------------------------------------------------------------------*/














int L, R;
//---------------------------------------------------------------------------------------------------
int solve() {
	int ans = inf;
	rep(i, L, R) rep(j, i + 1, R + 1) {
		chmin(ans, (int)(1LL * i * j % 2019));
		if (ans == 0)return 0;
	}
	return ans;
}
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> L >> R;
	cout << solve() << endl;
}





Submission Info

Submission Time
Task C - Remainder Minimization 2019
User hamayanhamayan
Language C++14 (GCC 5.4.1)
Score 300
Code Size 1734 Byte
Status AC
Exec Time 2 ms
Memory 256 KB

Judge Result

Set Name All Sample
Score / Max Score 300 / 300 0 / 0
Status
AC × 16
AC × 2
Set Name Test Cases
All max_ans, max_range, max_val, min_diff_01, min_diff_02, min_diff_03, min_diff_04, min_diff_05, one_01, one_02, random_max_01, random_max_02, sample_01, sample_02, stride_zero_01, stride_zero_02
Sample sample_01, sample_02
Case Name Status Exec Time Memory
max_ans AC 1 ms 256 KB
max_range AC 1 ms 256 KB
max_val AC 1 ms 256 KB
min_diff_01 AC 1 ms 256 KB
min_diff_02 AC 1 ms 256 KB
min_diff_03 AC 1 ms 256 KB
min_diff_04 AC 1 ms 256 KB
min_diff_05 AC 1 ms 256 KB
one_01 AC 2 ms 256 KB
one_02 AC 1 ms 256 KB
random_max_01 AC 1 ms 256 KB
random_max_02 AC 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
stride_zero_01 AC 1 ms 256 KB
stride_zero_02 AC 1 ms 256 KB