結果

問題 No.2386 Udon Coupon (Easy)
ユーザー ニックネームニックネーム
提出日時 2023-07-21 21:27:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 260 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 11,828 KB
実行使用メモリ 17,688 KB
最終ジャッジ日時 2023-10-21 21:16:13
合計ジャッジ時間 8,517 ms
ジャッジサーバーID
(参考情報)
judge12 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,008 KB
testcase_01 AC 24 ms
10,008 KB
testcase_02 AC 25 ms
10,016 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 25 ms
10,008 KB
testcase_06 AC 29 ms
10,016 KB
testcase_07 AC 334 ms
17,612 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 55 ms
10,668 KB
testcase_12 AC 254 ms
15,636 KB
testcase_13 AC 325 ms
17,288 KB
testcase_14 AC 268 ms
16,292 KB
testcase_15 AC 308 ms
17,276 KB
testcase_16 AC 242 ms
15,304 KB
testcase_17 WA -
testcase_18 AC 136 ms
12,668 KB
testcase_19 WA -
testcase_20 AC 210 ms
14,964 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 208 ms
14,624 KB
testcase_26 AC 267 ms
16,580 KB
testcase_27 AC 320 ms
17,580 KB
testcase_28 AC 171 ms
13,612 KB
testcase_29 AC 107 ms
11,980 KB
testcase_30 AC 42 ms
10,460 KB
testcase_31 WA -
testcase_32 AC 46 ms
10,644 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 237 ms
15,588 KB
testcase_36 AC 321 ms
17,292 KB
testcase_37 AC 235 ms
15,628 KB
testcase_38 AC 182 ms
14,288 KB
testcase_39 AC 134 ms
12,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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