結果
| 問題 | No.2099 [Cherry Alpha B] Time Machine |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-12 03:46:09 |
| 言語 | C++17 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 70 ms / 2,000 ms |
| + 798µs | |
| コード長 | 496 bytes |
| 記録 | |
| コンパイル時間 | 976 ms |
| コンパイル使用メモリ | 81,268 KB |
| 実行使用メモリ | 9,784 KB |
| 最終ジャッジ日時 | 2026-10-17 11:58:21 |
| 合計ジャッジ時間 | 4,854 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 53 |
ソースコード
#include <iostream>
using namespace std;
typedef long long ll;
const ll INF = 1000000000000000000;
int main()
{
ll t, x, a, y, b;
cin >> t >> x >> a >> y >> b;
ll ans = INF;
for(ll i = 0; i <= abs(t) + a + b; i++)
{
ll d = t + b * i;
if(d < 0)
{
continue;
}
ll j = d / a;
if(j >= 1000000000)
{
continue;
}
ans = min(ans, i * y + j * x + d % a);
}
cout << ans << endl;
}