結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー みここみここ
提出日時 2022-12-12 03:44:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 70,080 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-23 21:38:42
合計ジャッジ時間 13,984 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 1 ms
6,944 KB
testcase_03 AC 102 ms
6,944 KB
testcase_04 AC 10 ms
6,944 KB
testcase_05 AC 201 ms
6,944 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 178 ms
6,940 KB
testcase_09 AC 170 ms
6,940 KB
testcase_10 AC 170 ms
6,944 KB
testcase_11 AC 117 ms
6,940 KB
testcase_12 AC 128 ms
6,944 KB
testcase_13 AC 104 ms
6,940 KB
testcase_14 AC 9 ms
6,944 KB
testcase_15 AC 200 ms
6,944 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 146 ms
6,944 KB
testcase_19 AC 125 ms
6,944 KB
testcase_20 AC 80 ms
6,940 KB
testcase_21 AC 110 ms
6,940 KB
testcase_22 AC 189 ms
6,940 KB
testcase_23 AC 69 ms
6,944 KB
testcase_24 AC 187 ms
6,940 KB
testcase_25 AC 69 ms
6,944 KB
testcase_26 AC 155 ms
6,944 KB
testcase_27 AC 71 ms
6,944 KB
testcase_28 AC 106 ms
6,940 KB
testcase_29 AC 10 ms
6,944 KB
testcase_30 AC 209 ms
6,944 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 101 ms
6,940 KB
testcase_34 AC 10 ms
6,944 KB
testcase_35 AC 223 ms
6,944 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 121 ms
6,940 KB
testcase_39 AC 104 ms
6,940 KB
testcase_40 AC 147 ms
6,940 KB
testcase_41 AC 78 ms
6,944 KB
testcase_42 AC 135 ms
6,944 KB
testcase_43 AC 88 ms
6,944 KB
testcase_44 AC 91 ms
6,940 KB
testcase_45 AC 156 ms
6,940 KB
testcase_46 AC 117 ms
6,940 KB
testcase_47 AC 85 ms
6,944 KB
testcase_48 AC 100 ms
6,944 KB
testcase_49 AC 9 ms
6,940 KB
testcase_50 AC 196 ms
6,944 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 9 ms
6,940 KB
testcase_54 AC 53 ms
6,940 KB
testcase_55 AC 100 ms
6,940 KB
testcase_56 AC 296 ms
6,944 KB
testcase_57 AC 299 ms
6,940 KB
testcase_58 AC 300 ms
6,944 KB
testcase_59 AC 302 ms
6,940 KB
testcase_60 AC 305 ms
6,944 KB
testcase_61 AC 301 ms
6,944 KB
testcase_62 AC 296 ms
6,944 KB
testcase_63 AC 296 ms
6,944 KB
testcase_64 AC 221 ms
6,944 KB
testcase_65 AC 295 ms
6,940 KB
testcase_66 AC 229 ms
6,940 KB
testcase_67 AC 302 ms
6,944 KB
testcase_68 AC 298 ms
6,940 KB
testcase_69 AC 302 ms
6,940 KB
testcase_70 AC 306 ms
6,940 KB
testcase_71 AC 300 ms
6,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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(int i = 0; i <= abs(t) + a + b; i++)
    {
        ll d = t + b * i;
        if(d < 0)
        {
            continue;
        }
        int j = d / a;
        ans = min(ans, i * y + j * x + d % a);
    }
    cout << ans << endl;
}
0