結果
問題 | No.2259 Gas Station |
ユーザー |
|
提出日時 | 2023-09-08 11:32:58 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 481 bytes |
コンパイル時間 | 1,865 ms |
コンパイル使用メモリ | 125,520 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-26 04:49:50 |
合計ジャッジ時間 | 2,495 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
//moshasu #include <iostream> #include <vector> #include <cmath> #include <map> #include <set> #include <iomanip> #include <queue> #include <algorithm> #include <numeric> #include <deque> #include <complex> #include <cassert> using namespace std; using ll = long long; int main(){ ll L, R, C, ans=1e18, mi; cin >> L >> R >> C; mi = min(R, L+1000); for (ll i=L; i<=mi; i++) ans = min(ans, (i*C+999)/1000 * 1000 - i*C); cout << ans << endl; return 0; }