結果

問題 No.2386 Udon Coupon (Easy)
ユーザー とろちゃとろちゃ
提出日時 2023-07-21 21:32:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 2,000 ms
コード長 844 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 81,648 KB
実行使用メモリ 67,648 KB
最終ジャッジ日時 2023-10-21 21:22:09
合計ジャッジ時間 3,422 ms
ジャッジサーバーID
(参考情報)
judge10 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,424 KB
testcase_01 AC 38 ms
53,424 KB
testcase_02 AC 39 ms
53,424 KB
testcase_03 AC 39 ms
53,424 KB
testcase_04 AC 38 ms
53,424 KB
testcase_05 AC 38 ms
53,424 KB
testcase_06 AC 38 ms
53,424 KB
testcase_07 AC 57 ms
67,640 KB
testcase_08 AC 38 ms
53,424 KB
testcase_09 AC 41 ms
53,424 KB
testcase_10 AC 48 ms
62,360 KB
testcase_11 AC 47 ms
62,152 KB
testcase_12 AC 54 ms
65,072 KB
testcase_13 AC 55 ms
67,452 KB
testcase_14 AC 58 ms
67,384 KB
testcase_15 AC 56 ms
67,568 KB
testcase_16 AC 54 ms
65,132 KB
testcase_17 AC 56 ms
67,460 KB
testcase_18 AC 49 ms
62,560 KB
testcase_19 AC 47 ms
61,988 KB
testcase_20 AC 53 ms
65,064 KB
testcase_21 AC 56 ms
67,452 KB
testcase_22 AC 52 ms
64,828 KB
testcase_23 AC 52 ms
64,752 KB
testcase_24 AC 49 ms
62,228 KB
testcase_25 AC 52 ms
64,988 KB
testcase_26 AC 55 ms
67,408 KB
testcase_27 AC 56 ms
67,616 KB
testcase_28 AC 54 ms
64,760 KB
testcase_29 AC 51 ms
62,408 KB
testcase_30 AC 47 ms
61,988 KB
testcase_31 AC 53 ms
64,724 KB
testcase_32 AC 48 ms
61,988 KB
testcase_33 AC 57 ms
67,648 KB
testcase_34 AC 51 ms
64,828 KB
testcase_35 AC 53 ms
65,160 KB
testcase_36 AC 55 ms
67,584 KB
testcase_37 AC 57 ms
65,200 KB
testcase_38 AC 54 ms
64,908 KB
testcase_39 AC 49 ms
62,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit;pypyjit.set_param("max_unroll_recursion=-1")
# from bisect import *
# from collections import *
# from heapq import *
# from itertools import *
# from math import *
# from datetime import *
# from decimal import *  # PyPyだと遅い
# from string import ascii_lowercase,ascii_uppercase
# import numpy as np
import sys

# sys.setrecursionlimit(10**6) # PyPyだと遅い
INF = 10**18
MOD = 998244353
# MOD = 10**9 + 7
File = sys.stdin


def input():
    return File.readline()[:-1]


# ///////////////////////////////////////////////////////////////////////////


N = int(input())
A, B, C = map(int, input().split())

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

print(max(dp))
0