結果

問題 No.2099 [Cherry Alpha B] Time Machine
ユーザー keisuke6keisuke6
提出日時 2022-08-14 23:31:04
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 396 bytes
コンパイル時間 2,899 ms
コンパイル使用メモリ 241,324 KB
実行使用メモリ 5,196 KB
最終ジャッジ日時 2023-09-08 19:53:37
合計ジャッジ時間 37,348 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 430 ms
4,376 KB
testcase_01 AC 429 ms
4,380 KB
testcase_02 WA -
testcase_03 AC 429 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 429 ms
4,376 KB
testcase_08 AC 428 ms
4,380 KB
testcase_09 AC 428 ms
4,380 KB
testcase_10 AC 429 ms
4,380 KB
testcase_11 AC 429 ms
4,380 KB
testcase_12 AC 429 ms
4,376 KB
testcase_13 AC 430 ms
4,380 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 428 ms
4,376 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 429 ms
4,380 KB
testcase_23 AC 429 ms
4,376 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 429 ms
4,376 KB
testcase_28 AC 430 ms
4,376 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 430 ms
4,380 KB
testcase_33 AC 430 ms
4,380 KB
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 432 ms
4,376 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 AC 429 ms
4,376 KB
testcase_42 WA -
testcase_43 AC 430 ms
4,380 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 430 ms
4,380 KB
testcase_47 WA -
testcase_48 AC 430 ms
4,380 KB
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 AC 431 ms
4,384 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 432 ms
4,376 KB
testcase_57 WA -
testcase_58 WA -
testcase_59 AC 430 ms
4,380 KB
testcase_60 WA -
testcase_61 AC 431 ms
4,376 KB
testcase_62 WA -
testcase_63 AC 429 ms
4,380 KB
testcase_64 WA -
testcase_65 AC 429 ms
4,380 KB
testcase_66 WA -
testcase_67 AC 429 ms
4,376 KB
testcase_68 WA -
testcase_69 AC 428 ms
4,380 KB
testcase_70 WA -
testcase_71 AC 428 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
    long long T, X, A, Y, B;
    cin >> T >> X >> A >> Y >> B;
    long long ans = (T/A)*X + T%A;
    long long now = T - T%A;
    for(int i = 0; i < 2*(1e7); ++i) {
        now += A;
        long long wait = T - (now - ((now-T-1)/B+1)*B);
        ans = min(ans, (now/A)*X + (now-(T-wait))/B*Y + wait);
    }
    cout << ans << endl;
}
0