結果

問題 No.2259 Gas Station
ユーザー gyozasukisukigyozasukisuki
提出日時 2023-04-07 21:41:05
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 740 bytes
コンパイル時間 1,569 ms
コンパイル使用メモリ 164,476 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-10 16:47:48
合計ジャッジ時間 3,783 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,812 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
6,944 KB
testcase_10 WA -
testcase_11 AC 2 ms
6,940 KB
testcase_12 WA -
testcase_13 AC 354 ms
6,944 KB
testcase_14 AC 354 ms
6,940 KB
testcase_15 AC 356 ms
6,944 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 334 ms
6,944 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

const int INF = 1e9;
using ll = long long;
using inv = vector<int>;
using stv = vector<string>;
using pint = pair<int,int>;
#define FOR(i,l,r) for(int i=(l); i<(r); i++)
#define rep(i,r) for(int i=0; i<(r); i++)
#define repl(i,r) for(long long i=0; i<(r); i++)
#define FORl(i,l,r) for(long long i=(l); i<(r); i++)
#define INFL ((1LL<<62)-(1LL<<31))
#define pb(x) push_back(x)
#define CIN(x) cin >> x



int main(){
    ll L,R,C; cin >> L >> R >> C;


    const ll MOD = 1000;

    ll ans = INFL;
    
    FORl(i,L,1e8){
      if(i > R) break;  
      ll num = (1000LL -((i*C)%MOD)+MOD)%MOD;
//        cout << num << endl;
        
        ans = min(ans, num);
    }
    cout << ans << endl;
}
0