結果

問題 No.2259 Gas Station
コンテスト
ユーザー yukster714
提出日時 2023-04-19 21:31:30
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 376 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,464 ms
コンパイル使用メモリ 183,812 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2026-01-25 14:30:34
合計ジャッジ時間 14,342 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17 TLE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ll l, r, c; cin >> l >> r >> c;
    ll min_change = 999;
    for(ll x = l; x <= r; x++){
        ll change = 1000-x*c%1000;
        if(change == 1000)change =0;
        if(min_change > change){
            min_change = change;
        }
    }
    cout << min_change << endl;
    return 0;
}
0