結果

問題 No.2386 Udon Coupon (Easy)
ユーザー flygonflygon
提出日時 2023-07-21 21:29:39
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 52 ms / 2,000 ms
コード長 498 bytes
コンパイル時間 137 ms
コンパイル使用メモリ 81,656 KB
実行使用メモリ 65,288 KB
最終ジャッジ日時 2023-10-21 21:19:28
合計ジャッジ時間 2,968 ms
ジャッジサーバーID
(参考情報)
judge12 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
55,508 KB
testcase_01 AC 39 ms
55,508 KB
testcase_02 AC 40 ms
55,508 KB
testcase_03 AC 39 ms
55,508 KB
testcase_04 AC 38 ms
55,508 KB
testcase_05 AC 39 ms
55,508 KB
testcase_06 AC 39 ms
55,508 KB
testcase_07 AC 47 ms
63,164 KB
testcase_08 AC 38 ms
55,508 KB
testcase_09 AC 39 ms
55,508 KB
testcase_10 AC 44 ms
61,960 KB
testcase_11 AC 48 ms
61,752 KB
testcase_12 AC 47 ms
62,772 KB
testcase_13 AC 48 ms
63,104 KB
testcase_14 AC 45 ms
62,888 KB
testcase_15 AC 52 ms
65,272 KB
testcase_16 AC 52 ms
64,880 KB
testcase_17 AC 48 ms
62,964 KB
testcase_18 AC 46 ms
64,356 KB
testcase_19 AC 43 ms
61,588 KB
testcase_20 AC 45 ms
62,612 KB
testcase_21 AC 47 ms
62,968 KB
testcase_22 AC 47 ms
64,568 KB
testcase_23 AC 46 ms
64,492 KB
testcase_24 AC 42 ms
61,824 KB
testcase_25 AC 44 ms
62,536 KB
testcase_26 AC 44 ms
62,912 KB
testcase_27 AC 45 ms
63,120 KB
testcase_28 AC 47 ms
64,508 KB
testcase_29 AC 44 ms
62,004 KB
testcase_30 AC 48 ms
63,780 KB
testcase_31 AC 49 ms
62,272 KB
testcase_32 AC 46 ms
61,588 KB
testcase_33 AC 46 ms
63,152 KB
testcase_34 AC 48 ms
64,580 KB
testcase_35 AC 47 ms
62,708 KB
testcase_36 AC 49 ms
65,288 KB
testcase_37 AC 49 ms
64,940 KB
testcase_38 AC 49 ms
64,656 KB
testcase_39 AC 46 ms
62,212 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

n = int(input())
a,b,c = map(int,input().split())
dp = [0]*(n+1)
for i in range(3,n+1):
    if i >= 3:
        dp[i] = max(dp[i-3] + a, dp[i])
    if i >= 5:
        dp[i] = max(dp[i-5] + b, dp[i])
    if i >= 10:
        dp[i] = max(dp[i-10] + c, dp[i])
    
print(dp[-1])
0