結果

問題 No.2386 Udon Coupon (Easy)
ユーザー lloyzlloyz
提出日時 2023-07-21 21:30:56
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 373 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 81,676 KB
実行使用メモリ 63,416 KB
最終ジャッジ日時 2023-10-21 21:21:21
合計ジャッジ時間 2,698 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,416 KB
testcase_01 AC 32 ms
53,416 KB
testcase_02 AC 31 ms
53,416 KB
testcase_03 AC 32 ms
53,416 KB
testcase_04 AC 31 ms
53,416 KB
testcase_05 AC 31 ms
53,416 KB
testcase_06 AC 31 ms
53,416 KB
testcase_07 AC 41 ms
61,412 KB
testcase_08 AC 31 ms
53,416 KB
testcase_09 AC 33 ms
53,416 KB
testcase_10 AC 39 ms
60,224 KB
testcase_11 AC 39 ms
60,016 KB
testcase_12 AC 40 ms
63,080 KB
testcase_13 AC 42 ms
63,412 KB
testcase_14 AC 40 ms
61,152 KB
testcase_15 AC 45 ms
63,400 KB
testcase_16 AC 41 ms
63,012 KB
testcase_17 AC 40 ms
61,228 KB
testcase_18 AC 40 ms
62,488 KB
testcase_19 AC 38 ms
59,852 KB
testcase_20 AC 40 ms
60,880 KB
testcase_21 AC 40 ms
61,220 KB
testcase_22 AC 39 ms
60,644 KB
testcase_23 AC 38 ms
60,568 KB
testcase_24 AC 38 ms
60,092 KB
testcase_25 AC 40 ms
60,804 KB
testcase_26 AC 41 ms
61,176 KB
testcase_27 AC 40 ms
61,384 KB
testcase_28 AC 41 ms
62,640 KB
testcase_29 AC 39 ms
60,272 KB
testcase_30 AC 37 ms
59,852 KB
testcase_31 AC 37 ms
60,540 KB
testcase_32 AC 37 ms
59,852 KB
testcase_33 AC 40 ms
61,416 KB
testcase_34 AC 39 ms
62,708 KB
testcase_35 AC 38 ms
60,976 KB
testcase_36 AC 42 ms
63,416 KB
testcase_37 AC 40 ms
61,016 KB
testcase_38 AC 39 ms
62,788 KB
testcase_39 AC 41 ms
62,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a, b, c = map(int, input().split())

DP = [-1 for _ in range(n + 1)]
DP[n] = 0
for i in range(n, -1, -1):
    if DP[i] == -1:
        continue
    if i - 3 >= 0:
        DP[i - 3] = max(DP[i - 3], DP[i] + a)
    if i - 5 >= 0:
        DP[i - 5] = max(DP[i - 5], DP[i] + b)
    if i - 10 >= 0:
        DP[i - 10] = max(DP[i - 10], DP[i] + c)
print(max(DP))
0