結果

問題 No.2386 Udon Coupon (Easy)
ユーザー mymelochanmymelochan
提出日時 2023-07-21 21:28:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 745 bytes
コンパイル時間 160 ms
コンパイル使用メモリ 81,816 KB
実行使用メモリ 65,676 KB
最終ジャッジ日時 2023-10-21 21:17:40
合計ジャッジ時間 3,457 ms
ジャッジサーバーID
(参考情報)
judge9 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
55,532 KB
testcase_01 AC 45 ms
55,532 KB
testcase_02 AC 45 ms
55,532 KB
testcase_03 AC 45 ms
55,532 KB
testcase_04 AC 46 ms
55,532 KB
testcase_05 AC 46 ms
55,532 KB
testcase_06 AC 46 ms
55,532 KB
testcase_07 AC 80 ms
65,676 KB
testcase_08 AC 45 ms
55,532 KB
testcase_09 AC 45 ms
55,532 KB
testcase_10 AC 56 ms
64,484 KB
testcase_11 AC 54 ms
62,156 KB
testcase_12 AC 54 ms
63,032 KB
testcase_13 AC 54 ms
63,368 KB
testcase_14 AC 56 ms
65,412 KB
testcase_15 AC 56 ms
63,424 KB
testcase_16 AC 55 ms
63,032 KB
testcase_17 AC 56 ms
65,488 KB
testcase_18 AC 53 ms
62,508 KB
testcase_19 AC 53 ms
64,112 KB
testcase_20 AC 53 ms
63,016 KB
testcase_21 AC 57 ms
65,484 KB
testcase_22 AC 56 ms
64,904 KB
testcase_23 AC 56 ms
64,828 KB
testcase_24 AC 54 ms
64,348 KB
testcase_25 AC 55 ms
62,940 KB
testcase_26 AC 57 ms
65,436 KB
testcase_27 AC 55 ms
63,524 KB
testcase_28 AC 53 ms
62,660 KB
testcase_29 AC 57 ms
64,528 KB
testcase_30 AC 55 ms
64,116 KB
testcase_31 AC 54 ms
64,796 KB
testcase_32 AC 53 ms
64,112 KB
testcase_33 AC 57 ms
65,676 KB
testcase_34 AC 52 ms
62,732 KB
testcase_35 AC 54 ms
63,112 KB
testcase_36 AC 55 ms
63,440 KB
testcase_37 AC 57 ms
65,276 KB
testcase_38 AC 53 ms
62,808 KB
testcase_39 AC 52 ms
62,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#############################################################

import sys
sys.setrecursionlimit(10**7)

from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations

ipt = sys.stdin.readline

def iin():
    return int(ipt())
def lmin():
    return list(map(int,ipt().split()))

MOD = 998244353
#############################################################

N = iin()
A,B,C = lmin()

inf = 1<<60

dp = [-inf]*(N+1)
dp[0] = 0
for i in range(1,N+1):
    if i >= 3:
        dp[i] = max(dp[i],dp[i-3]+A)
    if i >= 5:
        dp[i] = max(dp[i],dp[i-5]+B)
    if i >= 10:
        dp[i] = max(dp[i],dp[i-10]+C)

print(max(dp))
0