結果

問題 No.2386 Udon Coupon (Easy)
ユーザー ikomaikoma
提出日時 2023-07-21 21:30:48
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 1,339 ms
コンパイル使用メモリ 81,500 KB
実行使用メモリ 63,220 KB
最終ジャッジ日時 2023-10-21 21:21:11
合計ジャッジ時間 3,830 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
53,392 KB
testcase_01 AC 31 ms
53,392 KB
testcase_02 AC 31 ms
53,392 KB
testcase_03 AC 31 ms
53,392 KB
testcase_04 AC 30 ms
53,392 KB
testcase_05 AC 33 ms
53,392 KB
testcase_06 AC 33 ms
53,392 KB
testcase_07 AC 44 ms
63,220 KB
testcase_08 AC 30 ms
53,412 KB
testcase_09 AC 31 ms
53,412 KB
testcase_10 AC 39 ms
62,024 KB
testcase_11 AC 38 ms
59,636 KB
testcase_12 AC 39 ms
60,636 KB
testcase_13 AC 37 ms
60,968 KB
testcase_14 AC 41 ms
62,952 KB
testcase_15 AC 39 ms
60,956 KB
testcase_16 AC 37 ms
60,568 KB
testcase_17 AC 41 ms
63,028 KB
testcase_18 AC 38 ms
60,044 KB
testcase_19 AC 39 ms
61,652 KB
testcase_20 AC 40 ms
60,500 KB
testcase_21 AC 41 ms
63,024 KB
testcase_22 AC 45 ms
62,456 KB
testcase_23 AC 44 ms
62,380 KB
testcase_24 AC 40 ms
61,892 KB
testcase_25 AC 40 ms
60,424 KB
testcase_26 AC 40 ms
62,976 KB
testcase_27 AC 39 ms
61,004 KB
testcase_28 AC 37 ms
60,196 KB
testcase_29 AC 40 ms
62,072 KB
testcase_30 AC 41 ms
61,664 KB
testcase_31 AC 41 ms
62,340 KB
testcase_32 AC 38 ms
61,652 KB
testcase_33 AC 41 ms
63,216 KB
testcase_34 AC 36 ms
60,264 KB
testcase_35 AC 39 ms
60,596 KB
testcase_36 AC 38 ms
60,972 KB
testcase_37 AC 44 ms
62,828 KB
testcase_38 AC 38 ms
60,344 KB
testcase_39 AC 36 ms
60,080 KB
権限があれば一括ダウンロードができます

ソースコード

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):
    if i-3>=0:
        dp[i] = max(dp[i], dp[i-3]+A)
    if i-5>=0:
        dp[i] = max(dp[i], dp[i-5]+B)
    if i-10>=0:
        dp[i] = max(dp[i], dp[i-10]+C)


print(dp[-1])
0