結果

問題 No.2386 Udon Coupon (Easy)
ユーザー ikomaikoma
提出日時 2023-07-21 21:29:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 329 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,720 KB
実行使用メモリ 71,932 KB
最終ジャッジ日時 2023-10-21 21:18:30
合計ジャッジ時間 4,026 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
57,700 KB
testcase_01 AC 31 ms
53,352 KB
testcase_02 AC 46 ms
61,940 KB
testcase_03 AC 30 ms
53,352 KB
testcase_04 AC 31 ms
53,352 KB
testcase_05 AC 32 ms
53,352 KB
testcase_06 AC 40 ms
61,940 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N=int(input())
A,B,C=map(int,input().split())


dp = [0]*(N+1)

for i in range(1,N+1):
    for j in range(i-3+1):
        dp[i] = max(dp[i], dp[j]+A)
    for j in range(i-5+1):
        dp[i] = max(dp[i], dp[j]+B)
    for j in range(i-10+1):
        dp[i] = max(dp[i], dp[j]+C)
print(dp[-1])
0