結果

問題 No.2386 Udon Coupon (Easy)
ユーザー 👑 MizarMizar
提出日時 2023-07-20 01:15:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 11,808 KB
実行使用メモリ 17,576 KB
最終ジャッジ日時 2023-10-20 03:06:03
合計ジャッジ時間 6,287 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,072 KB
testcase_01 AC 31 ms
10,072 KB
testcase_02 AC 31 ms
10,080 KB
testcase_03 AC 30 ms
10,072 KB
testcase_04 AC 29 ms
10,072 KB
testcase_05 AC 30 ms
10,072 KB
testcase_06 AC 31 ms
10,080 KB
testcase_07 AC 224 ms
15,200 KB
testcase_08 AC 30 ms
10,072 KB
testcase_09 AC 29 ms
10,072 KB
testcase_10 AC 77 ms
10,976 KB
testcase_11 AC 50 ms
10,728 KB
testcase_12 AC 174 ms
15,728 KB
testcase_13 AC 208 ms
17,312 KB
testcase_14 AC 194 ms
13,352 KB
testcase_15 AC 213 ms
15,464 KB
testcase_16 AC 164 ms
13,880 KB
testcase_17 AC 200 ms
13,616 KB
testcase_18 AC 100 ms
12,032 KB
testcase_19 AC 43 ms
10,340 KB
testcase_20 AC 157 ms
14,936 KB
testcase_21 AC 195 ms
14,672 KB
testcase_22 AC 125 ms
12,032 KB
testcase_23 AC 119 ms
11,768 KB
testcase_24 AC 61 ms
10,452 KB
testcase_25 AC 148 ms
14,672 KB
testcase_26 AC 195 ms
13,352 KB
testcase_27 AC 219 ms
17,576 KB
testcase_28 AC 119 ms
12,560 KB
testcase_29 AC 82 ms
10,976 KB
testcase_30 AC 42 ms
10,288 KB
testcase_31 AC 116 ms
11,768 KB
testcase_32 AC 45 ms
10,368 KB
testcase_33 AC 216 ms
13,880 KB
testcase_34 AC 130 ms
12,824 KB
testcase_35 AC 168 ms
15,464 KB
testcase_36 AC 218 ms
15,464 KB
testcase_37 AC 177 ms
12,824 KB
testcase_38 AC 142 ms
13,088 KB
testcase_39 AC 107 ms
13,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a,b,c = map(int,input().split())
dp = [0] * (n + 1)
for i in range(n + 1):
    dp[i] = max(
        dp[i -  1]     if i >= 1 else 0,
        dp[i -  3] + a if i >= 3 else 0,
        dp[i -  5] + b if i >= 5 else 0,
        dp[i - 10] + c if i >= 10 else 0,
    )
print(dp[n])
0