結果
問題 | No.2259 Gas Station |
ユーザー |
![]() |
提出日時 | 2023-04-07 21:26:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 396 bytes |
コンパイル時間 | 1,619 ms |
コンパイル使用メモリ | 166,916 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-02 18:59:14 |
合計ジャッジ時間 | 2,723 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h>using namespace std;using ll =long long;#define all(v) v.begin(),v.end()#define rep(i,a,b) for(int i=a;i<b;i++)#define rrep(i,a,b) for(int i=a;i>=b;i--)int main() {ll L,R,C;cin>>L>>R>>C;if(R-L<=1000) {ll ans=1000;for(ll j=L;j<=R;j++) {ll k=C*j%1000;if(k!=0) k=1000-k;ans=min(ans,k);}cout<<ans<<endl;}else cout<<0<<endl;}