結果

問題 No.2386 Udon Coupon (Easy)
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2023-07-21 21:48:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 81,684 KB
実行使用メモリ 63,356 KB
最終ジャッジ日時 2023-10-21 21:47:47
合計ジャッジ時間 3,175 ms
ジャッジサーバーID
(参考情報)
judge14 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,432 KB
testcase_01 AC 40 ms
53,432 KB
testcase_02 AC 39 ms
53,432 KB
testcase_03 AC 38 ms
53,432 KB
testcase_04 AC 44 ms
53,432 KB
testcase_05 AC 38 ms
53,432 KB
testcase_06 AC 38 ms
53,432 KB
testcase_07 AC 50 ms
63,348 KB
testcase_08 AC 39 ms
53,432 KB
testcase_09 AC 38 ms
53,432 KB
testcase_10 AC 48 ms
62,164 KB
testcase_11 AC 46 ms
59,712 KB
testcase_12 AC 47 ms
60,716 KB
testcase_13 AC 50 ms
61,052 KB
testcase_14 AC 51 ms
63,092 KB
testcase_15 AC 51 ms
61,236 KB
testcase_16 AC 51 ms
60,848 KB
testcase_17 AC 51 ms
63,168 KB
testcase_18 AC 48 ms
60,324 KB
testcase_19 AC 46 ms
61,792 KB
testcase_20 AC 48 ms
60,576 KB
testcase_21 AC 51 ms
63,160 KB
testcase_22 AC 46 ms
60,400 KB
testcase_23 AC 46 ms
60,324 KB
testcase_24 AC 47 ms
62,032 KB
testcase_25 AC 48 ms
60,500 KB
testcase_26 AC 51 ms
63,116 KB
testcase_27 AC 50 ms
61,080 KB
testcase_28 AC 49 ms
60,476 KB
testcase_29 AC 47 ms
62,212 KB
testcase_30 AC 43 ms
59,608 KB
testcase_31 AC 48 ms
62,480 KB
testcase_32 AC 46 ms
61,792 KB
testcase_33 AC 51 ms
63,356 KB
testcase_34 AC 48 ms
60,544 KB
testcase_35 AC 48 ms
60,672 KB
testcase_36 AC 50 ms
61,252 KB
testcase_37 AC 47 ms
60,772 KB
testcase_38 AC 49 ms
60,624 KB
testcase_39 AC 46 ms
60,164 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A,B,C = map(int,input().split())
dp = [0]*(n+1)

def calc(dp,x,y):
    
    for i in range(n):
        if i+x <= n:
            dp[i+x] = max(dp[i+x],dp[i]+y)
    return dp


for x,y in [[3,A],[5,B],[10,C]]:
    dp = calc(dp,x,y)
    # print(dp)
print(max(dp))
0