結果
問題 | No.2099 [Cherry Alpha B] Time Machine |
ユーザー |
![]() |
提出日時 | 2022-10-17 02:27:14 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 431 bytes |
コンパイル時間 | 1,414 ms |
コンパイル使用メモリ | 167,584 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-27 19:30:50 |
合計ジャッジ時間 | 11,831 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 64 WA * 8 |
ソースコード
/** * @FileName a.cpp * @Author kanpurin * @Created 2022.10.17 02:27:08 **/ #include "bits/stdc++.h" using namespace std; typedef long long ll; int main() { int t;cin >> t; int x,a,y,b;cin >> x >> a >> y >> b; ll ans = 1000000000; for (int i = 0; i <= 10000000; i++) { ll j = max(0LL,((ll)a*i-t+b-1)/b); ans = min(ans,(x-a)*i+(y+b)*j+t); } cout << ans << endl; return 0; }