結果

問題 No.2386 Udon Coupon (Easy)
ユーザー satoyuyapyaasatoyuyapyaa
提出日時 2023-08-09 01:08:38
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 349 ms / 2,000 ms
コード長 347 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 18,688 KB
最終ジャッジ日時 2024-04-26 16:58:48
合計ジャッジ時間 8,156 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,624 KB
testcase_01 AC 29 ms
10,752 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 27 ms
10,624 KB
testcase_04 AC 27 ms
10,624 KB
testcase_05 AC 26 ms
10,752 KB
testcase_06 AC 27 ms
10,624 KB
testcase_07 AC 337 ms
18,688 KB
testcase_08 AC 29 ms
10,752 KB
testcase_09 AC 29 ms
10,752 KB
testcase_10 AC 102 ms
12,544 KB
testcase_11 AC 61 ms
11,520 KB
testcase_12 AC 258 ms
16,512 KB
testcase_13 AC 319 ms
18,432 KB
testcase_14 AC 284 ms
17,152 KB
testcase_15 AC 319 ms
18,304 KB
testcase_16 AC 247 ms
16,128 KB
testcase_17 AC 303 ms
17,664 KB
testcase_18 AC 141 ms
13,568 KB
testcase_19 AC 49 ms
11,264 KB
testcase_20 AC 231 ms
16,000 KB
testcase_21 AC 290 ms
17,408 KB
testcase_22 AC 181 ms
14,592 KB
testcase_23 AC 164 ms
14,208 KB
testcase_24 AC 77 ms
11,776 KB
testcase_25 AC 212 ms
15,360 KB
testcase_26 AC 289 ms
17,280 KB
testcase_27 AC 330 ms
18,688 KB
testcase_28 AC 175 ms
14,464 KB
testcase_29 AC 112 ms
12,800 KB
testcase_30 AC 46 ms
11,136 KB
testcase_31 AC 167 ms
14,208 KB
testcase_32 AC 54 ms
11,136 KB
testcase_33 AC 349 ms
18,688 KB
testcase_34 AC 186 ms
14,720 KB
testcase_35 AC 250 ms
16,512 KB
testcase_36 AC 325 ms
18,560 KB
testcase_37 AC 263 ms
16,512 KB
testcase_38 AC 202 ms
14,976 KB
testcase_39 AC 154 ms
13,824 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    n = int(input())
    a,b,c = map(int,input().split())

    dp = [0 for _ in range(n++11)]
    for i in range(n+1):
        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)
        dp[i+1] = max(dp[i+1],dp[i])


    print(dp[n])


if __name__ == '__main__':
    main()
0