結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,068 KB
testcase_01 AC 23 ms
10,068 KB
testcase_02 AC 23 ms
10,076 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 23 ms
10,068 KB
testcase_06 AC 23 ms
10,076 KB
testcase_07 AC 312 ms
17,672 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 52 ms
10,728 KB
testcase_12 AC 233 ms
15,696 KB
testcase_13 AC 288 ms
17,348 KB
testcase_14 AC 253 ms
16,352 KB
testcase_15 AC 286 ms
17,336 KB
testcase_16 AC 215 ms
15,364 KB
testcase_17 WA -
testcase_18 AC 127 ms
12,728 KB
testcase_19 WA -
testcase_20 AC 213 ms
15,024 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 193 ms
14,684 KB
testcase_26 AC 261 ms
16,640 KB
testcase_27 AC 297 ms
17,640 KB
testcase_28 AC 157 ms
13,672 KB
testcase_29 AC 99 ms
12,040 KB
testcase_30 AC 40 ms
10,520 KB
testcase_31 WA -
testcase_32 AC 45 ms
10,704 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 227 ms
15,648 KB
testcase_36 AC 294 ms
17,352 KB
testcase_37 AC 222 ms
15,688 KB
testcase_38 AC 180 ms
14,348 KB
testcase_39 AC 134 ms
13,028 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],0))
0