結果
| 問題 |
No.2259 Gas Station
|
| コンテスト | |
| ユーザー |
ripity
|
| 提出日時 | 2023-04-07 21:22:33 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 424 bytes |
| コンパイル時間 | 23,720 ms |
| コンパイル使用メモリ | 350,836 KB |
| 最終ジャッジ日時 | 2025-02-12 00:10:52 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
long long L, R, C;
cin >> L >> R >> C;
long long ans = 1000;
for( long long x = L; x <= min(R, L+1000LL); x++ ) {
ans = min(ans, (1000-x*C%1000)%1000);
}
cout << ans << endl;
}
ripity