結果

問題 No.2386 Udon Coupon (Easy)
ユーザー mymelochanmymelochan
提出日時 2023-07-21 21:27:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 81,648 KB
実行使用メモリ 65,240 KB
最終ジャッジ日時 2023-10-21 21:17:02
合計ジャッジ時間 2,840 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
55,416 KB
testcase_01 AC 38 ms
55,416 KB
testcase_02 AC 38 ms
55,416 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 35 ms
55,416 KB
testcase_06 AC 36 ms
55,416 KB
testcase_07 AC 44 ms
65,240 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 45 ms
61,664 KB
testcase_12 AC 45 ms
62,656 KB
testcase_13 AC 45 ms
62,992 KB
testcase_14 AC 44 ms
62,800 KB
testcase_15 AC 41 ms
62,980 KB
testcase_16 AC 42 ms
62,588 KB
testcase_17 WA -
testcase_18 AC 42 ms
62,064 KB
testcase_19 WA -
testcase_20 AC 43 ms
62,524 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 44 ms
62,448 KB
testcase_26 AC 45 ms
62,824 KB
testcase_27 AC 44 ms
63,032 KB
testcase_28 AC 42 ms
62,216 KB
testcase_29 AC 43 ms
61,916 KB
testcase_30 AC 47 ms
63,676 KB
testcase_31 WA -
testcase_32 AC 44 ms
61,500 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 47 ms
62,620 KB
testcase_36 AC 45 ms
62,996 KB
testcase_37 AC 46 ms
64,836 KB
testcase_38 AC 43 ms
62,364 KB
testcase_39 AC 45 ms
62,100 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)

if dp[-1] == -inf:
    print(0)
else:
    print(dp[-1])
0