結果

問題 No.2386 Udon Coupon (Easy)
ユーザー かとぅー ☆かとぅー ☆
提出日時 2023-09-05 14:44:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 121 ms / 2,000 ms
コード長 370 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 77,992 KB
最終ジャッジ日時 2023-09-05 14:44:09
合計ジャッジ時間 6,050 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
71,300 KB
testcase_01 AC 74 ms
71,352 KB
testcase_02 AC 77 ms
71,584 KB
testcase_03 AC 80 ms
71,592 KB
testcase_04 AC 75 ms
71,448 KB
testcase_05 AC 77 ms
71,496 KB
testcase_06 AC 108 ms
71,544 KB
testcase_07 AC 109 ms
77,952 KB
testcase_08 AC 76 ms
71,440 KB
testcase_09 AC 76 ms
71,232 KB
testcase_10 AC 88 ms
76,672 KB
testcase_11 AC 84 ms
76,420 KB
testcase_12 AC 86 ms
77,472 KB
testcase_13 AC 87 ms
77,728 KB
testcase_14 AC 90 ms
77,620 KB
testcase_15 AC 87 ms
77,864 KB
testcase_16 AC 87 ms
77,456 KB
testcase_17 AC 121 ms
77,676 KB
testcase_18 AC 86 ms
76,828 KB
testcase_19 AC 87 ms
76,252 KB
testcase_20 AC 88 ms
77,092 KB
testcase_21 AC 94 ms
77,728 KB
testcase_22 AC 93 ms
77,088 KB
testcase_23 AC 92 ms
77,224 KB
testcase_24 AC 86 ms
76,608 KB
testcase_25 AC 89 ms
77,116 KB
testcase_26 AC 91 ms
77,808 KB
testcase_27 AC 88 ms
77,992 KB
testcase_28 AC 91 ms
77,084 KB
testcase_29 AC 86 ms
76,516 KB
testcase_30 AC 90 ms
76,376 KB
testcase_31 AC 88 ms
76,912 KB
testcase_32 AC 85 ms
76,324 KB
testcase_33 AC 90 ms
77,888 KB
testcase_34 AC 85 ms
77,044 KB
testcase_35 AC 86 ms
77,108 KB
testcase_36 AC 91 ms
77,844 KB
testcase_37 AC 94 ms
77,668 KB
testcase_38 AC 84 ms
76,992 KB
testcase_39 AC 86 ms
76,656 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A, B, C = map(int, input().split())
dp = [-1 for i in range(N + 1)]
dp[0] = 0
for i in range(N):
    if dp[i] != -1:
        if i+3 <= N:
            dp[i+3] = max(dp[i] + A , dp[i+3])    
        if i + 5 <= N:
            dp[i+5] = max(dp[i] + B , dp[i+5])    
        if i+10<= N:
            dp[i+10] = max(dp[i] + C , dp[i+10])    

print(max(dp))
0