結果

問題 No.2386 Udon Coupon (Easy)
ユーザー ニックネームニックネーム
提出日時 2023-07-21 21:30:07
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 357 ms / 2,000 ms
コード長 245 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 11,844 KB
実行使用メモリ 19,196 KB
最終ジャッジ日時 2023-10-21 21:20:08
合計ジャッジ時間 8,348 ms
ジャッジサーバーID
(参考情報)
judge13 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,008 KB
testcase_01 AC 29 ms
10,008 KB
testcase_02 AC 32 ms
10,016 KB
testcase_03 AC 30 ms
10,008 KB
testcase_04 AC 30 ms
10,008 KB
testcase_05 AC 29 ms
10,008 KB
testcase_06 AC 29 ms
10,016 KB
testcase_07 AC 354 ms
19,196 KB
testcase_08 AC 29 ms
10,008 KB
testcase_09 AC 30 ms
10,008 KB
testcase_10 AC 111 ms
12,196 KB
testcase_11 AC 64 ms
10,932 KB
testcase_12 AC 272 ms
16,956 KB
testcase_13 AC 342 ms
18,872 KB
testcase_14 AC 299 ms
17,612 KB
testcase_15 AC 346 ms
18,860 KB
testcase_16 AC 259 ms
16,360 KB
testcase_17 AC 311 ms
18,216 KB
testcase_18 AC 148 ms
13,196 KB
testcase_19 AC 52 ms
10,544 KB
testcase_20 AC 246 ms
16,020 KB
testcase_21 AC 309 ms
17,944 KB
testcase_22 AC 192 ms
14,464 KB
testcase_23 AC 178 ms
14,124 KB
testcase_24 AC 82 ms
11,272 KB
testcase_25 AC 228 ms
15,680 KB
testcase_26 AC 306 ms
17,900 KB
testcase_27 AC 357 ms
19,164 KB
testcase_28 AC 185 ms
14,140 KB
testcase_29 AC 116 ms
12,244 KB
testcase_30 AC 47 ms
10,460 KB
testcase_31 AC 178 ms
14,096 KB
testcase_32 AC 55 ms
10,644 KB
testcase_33 AC 356 ms
19,196 KB
testcase_34 AC 198 ms
14,736 KB
testcase_35 AC 268 ms
16,644 KB
testcase_36 AC 357 ms
18,876 KB
testcase_37 AC 264 ms
16,948 KB
testcase_38 AC 214 ms
15,080 KB
testcase_39 AC 155 ms
13,496 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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