結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー みここみここ
提出日時 2022-12-12 03:44:51
言語 C++17
(gcc 11.2.0 + boost 1.78.0)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 474 ms
使用メモリ 6,952 KB
最終ジャッジ日時 2022-12-12 03:45:10
合計ジャッジ時間 15,885 ms
ジャッジサーバーID
(参考情報)
judge16 / judge10
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 2 ms
5,152 KB
testcase_01 AC 2 ms
5,156 KB
testcase_02 AC 1 ms
5,156 KB
testcase_03 AC 117 ms
4,900 KB
testcase_04 AC 10 ms
4,904 KB
testcase_05 AC 219 ms
5,160 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 194 ms
4,900 KB
testcase_09 AC 178 ms
4,900 KB
testcase_10 AC 188 ms
4,904 KB
testcase_11 AC 127 ms
4,904 KB
testcase_12 AC 136 ms
4,904 KB
testcase_13 AC 111 ms
5,156 KB
testcase_14 AC 11 ms
4,900 KB
testcase_15 AC 219 ms
4,904 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 159 ms
4,904 KB
testcase_19 AC 140 ms
4,900 KB
testcase_20 AC 88 ms
5,156 KB
testcase_21 AC 123 ms
4,900 KB
testcase_22 AC 201 ms
4,904 KB
testcase_23 AC 74 ms
4,904 KB
testcase_24 AC 200 ms
4,904 KB
testcase_25 AC 74 ms
4,900 KB
testcase_26 AC 162 ms
5,160 KB
testcase_27 AC 74 ms
4,900 KB
testcase_28 AC 111 ms
5,156 KB
testcase_29 AC 11 ms
4,904 KB
testcase_30 AC 246 ms
4,904 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 110 ms
4,904 KB
testcase_34 AC 11 ms
4,900 KB
testcase_35 AC 218 ms
4,900 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 140 ms
4,900 KB
testcase_39 AC 124 ms
5,156 KB
testcase_40 AC 160 ms
5,156 KB
testcase_41 AC 85 ms
5,152 KB
testcase_42 AC 145 ms
4,900 KB
testcase_43 AC 90 ms
4,904 KB
testcase_44 AC 96 ms
4,904 KB
testcase_45 AC 171 ms
4,900 KB
testcase_46 AC 125 ms
4,900 KB
testcase_47 AC 93 ms
4,900 KB
testcase_48 AC 111 ms
4,900 KB
testcase_49 AC 10 ms
4,904 KB
testcase_50 AC 240 ms
4,900 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 AC 11 ms
4,900 KB
testcase_54 AC 60 ms
4,900 KB
testcase_55 AC 111 ms
5,156 KB
testcase_56 AC 327 ms
4,904 KB
testcase_57 AC 354 ms
4,904 KB
testcase_58 AC 327 ms
4,900 KB
testcase_59 AC 326 ms
5,152 KB
testcase_60 AC 327 ms
5,156 KB
testcase_61 AC 340 ms
4,904 KB
testcase_62 AC 338 ms
4,900 KB
testcase_63 AC 326 ms
4,904 KB
testcase_64 AC 246 ms
5,152 KB
testcase_65 AC 328 ms
5,156 KB
testcase_66 AC 282 ms
5,156 KB
testcase_67 AC 327 ms
4,904 KB
testcase_68 AC 326 ms
4,904 KB
testcase_69 AC 327 ms
4,904 KB
testcase_70 AC 327 ms
5,156 KB
testcase_71 AC 326 ms
4,900 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