結果

問題 No.2386 Udon Coupon (Easy)
ユーザー やでな@競プロやでな@競プロ
提出日時 2023-10-08 21:42:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 280 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 87,316 KB
実行使用メモリ 77,980 KB
最終ジャッジ日時 2023-10-08 21:42:23
合計ジャッジ時間 4,996 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,556 KB
testcase_01 AC 73 ms
71,524 KB
testcase_02 AC 72 ms
71,400 KB
testcase_03 AC 76 ms
71,344 KB
testcase_04 AC 73 ms
71,148 KB
testcase_05 AC 69 ms
71,188 KB
testcase_06 AC 70 ms
71,396 KB
testcase_07 AC 84 ms
77,616 KB
testcase_08 AC 70 ms
71,192 KB
testcase_09 AC 69 ms
71,196 KB
testcase_10 AC 76 ms
76,708 KB
testcase_11 AC 75 ms
76,436 KB
testcase_12 AC 78 ms
77,456 KB
testcase_13 AC 82 ms
77,876 KB
testcase_14 AC 77 ms
77,528 KB
testcase_15 AC 81 ms
77,980 KB
testcase_16 AC 81 ms
77,340 KB
testcase_17 AC 79 ms
77,636 KB
testcase_18 AC 79 ms
76,856 KB
testcase_19 AC 81 ms
76,104 KB
testcase_20 AC 75 ms
77,192 KB
testcase_21 AC 78 ms
77,708 KB
testcase_22 AC 78 ms
77,052 KB
testcase_23 AC 77 ms
77,012 KB
testcase_24 AC 74 ms
76,572 KB
testcase_25 AC 76 ms
77,176 KB
testcase_26 AC 79 ms
77,624 KB
testcase_27 AC 77 ms
77,828 KB
testcase_28 AC 80 ms
77,088 KB
testcase_29 AC 77 ms
76,472 KB
testcase_30 AC 75 ms
76,316 KB
testcase_31 AC 82 ms
76,752 KB
testcase_32 AC 76 ms
76,100 KB
testcase_33 AC 79 ms
77,720 KB
testcase_34 AC 78 ms
77,172 KB
testcase_35 AC 75 ms
77,392 KB
testcase_36 AC 82 ms
77,836 KB
testcase_37 AC 78 ms
77,460 KB
testcase_38 AC 80 ms
77,376 KB
testcase_39 AC 78 ms
76,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [0]*(n+1)

for i in range(n):
    if i+3 <= n:
        dp[i+3] = max(dp[i+3],dp[i]+a)
    if i+5 <= n:
        dp[i+5] = max(dp[i+5],dp[i]+b)
    if i+10 <= n:
        dp[i+10] = max(dp[i+10],dp[i]+c)
        
print(max(dp))
0