結果

問題 No.2386 Udon Coupon (Easy)
ユーザー komkompikomkompi
提出日時 2023-07-21 22:30:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 425 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 76,908 KB
最終ジャッジ日時 2023-10-21 22:29:48
合計ジャッジ時間 3,621 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,380 KB
testcase_01 AC 38 ms
53,380 KB
testcase_02 AC 38 ms
53,380 KB
testcase_03 AC 40 ms
53,380 KB
testcase_04 AC 38 ms
53,380 KB
testcase_05 AC 38 ms
53,380 KB
testcase_06 AC 38 ms
53,380 KB
testcase_07 AC 92 ms
76,908 KB
testcase_08 AC 35 ms
53,380 KB
testcase_09 AC 37 ms
53,380 KB
testcase_10 AC 48 ms
66,612 KB
testcase_11 AC 45 ms
62,308 KB
testcase_12 AC 59 ms
74,496 KB
testcase_13 AC 63 ms
76,744 KB
testcase_14 AC 62 ms
76,600 KB
testcase_15 AC 60 ms
76,732 KB
testcase_16 AC 54 ms
73,488 KB
testcase_17 AC 61 ms
76,616 KB
testcase_18 AC 53 ms
68,868 KB
testcase_19 AC 47 ms
62,144 KB
testcase_20 AC 56 ms
73,412 KB
testcase_21 AC 65 ms
76,708 KB
testcase_22 AC 56 ms
71,136 KB
testcase_23 AC 55 ms
71,060 KB
testcase_24 AC 46 ms
64,432 KB
testcase_25 AC 53 ms
71,292 KB
testcase_26 AC 61 ms
76,564 KB
testcase_27 AC 64 ms
76,772 KB
testcase_28 AC 52 ms
69,020 KB
testcase_29 AC 49 ms
66,660 KB
testcase_30 AC 47 ms
62,152 KB
testcase_31 AC 52 ms
68,976 KB
testcase_32 AC 47 ms
62,144 KB
testcase_33 AC 66 ms
76,804 KB
testcase_34 AC 54 ms
71,136 KB
testcase_35 AC 56 ms
73,508 KB
testcase_36 AC 66 ms
76,848 KB
testcase_37 AC 59 ms
74,788 KB
testcase_38 AC 52 ms
71,216 KB
testcase_39 AC 49 ms
68,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!

N=int(input())

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

dic={3:A,5:B,10:C}

dp=[-1]*(N+1)

dp[0]=0

for i in range(N):
    if dp[i]!=-1:
        for n,price in dic.items():
            if i+n<=N:
                dp[i+n]=max(dp[i+n],dp[i]+price)

print(max(dp))
0