結果

問題 No.2259 Gas Station
ユーザー srjywrdnprkt
提出日時 2023-04-22 02:50:58
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 470 bytes
コンパイル時間 914 ms
コンパイル使用メモリ 104,748 KB
最終ジャッジ日時 2025-02-12 12:51:12
ジャッジサーバーID
(参考情報)
judge3 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0