結果
問題 | No.2317 Expression Menu |
ユーザー | cleantted |
提出日時 | 2023-02-19 01:44:09 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,616 ms / 2,000 ms |
コード長 | 1,313 bytes |
コンパイル時間 | 342 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 312,448 KB |
最終ジャッジ日時 | 2024-09-18 09:40:06 |
合計ジャッジ時間 | 46,886 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 138 ms
91,648 KB |
testcase_01 | AC | 136 ms
91,264 KB |
testcase_02 | AC | 241 ms
107,648 KB |
testcase_03 | AC | 1,376 ms
312,064 KB |
testcase_04 | AC | 1,361 ms
311,808 KB |
testcase_05 | AC | 1,385 ms
312,128 KB |
testcase_06 | AC | 1,375 ms
311,936 KB |
testcase_07 | AC | 1,380 ms
312,192 KB |
testcase_08 | AC | 1,383 ms
312,192 KB |
testcase_09 | AC | 1,370 ms
311,808 KB |
testcase_10 | AC | 1,360 ms
311,808 KB |
testcase_11 | AC | 1,340 ms
312,320 KB |
testcase_12 | AC | 1,375 ms
312,192 KB |
testcase_13 | AC | 1,360 ms
312,192 KB |
testcase_14 | AC | 1,336 ms
312,320 KB |
testcase_15 | AC | 1,372 ms
312,320 KB |
testcase_16 | AC | 1,382 ms
312,448 KB |
testcase_17 | AC | 1,402 ms
311,936 KB |
testcase_18 | AC | 1,362 ms
311,936 KB |
testcase_19 | AC | 1,430 ms
312,192 KB |
testcase_20 | AC | 1,390 ms
312,192 KB |
testcase_21 | AC | 1,326 ms
311,936 KB |
testcase_22 | AC | 1,328 ms
311,808 KB |
testcase_23 | AC | 1,451 ms
312,320 KB |
testcase_24 | AC | 1,444 ms
311,936 KB |
testcase_25 | AC | 1,425 ms
312,320 KB |
testcase_26 | AC | 1,439 ms
312,152 KB |
testcase_27 | AC | 1,451 ms
312,252 KB |
testcase_28 | AC | 1,443 ms
312,192 KB |
testcase_29 | AC | 1,450 ms
312,320 KB |
testcase_30 | AC | 1,616 ms
312,176 KB |
testcase_31 | AC | 1,436 ms
312,064 KB |
testcase_32 | AC | 1,428 ms
312,192 KB |
testcase_33 | AC | 134 ms
91,648 KB |
testcase_34 | AC | 134 ms
91,904 KB |
testcase_35 | AC | 136 ms
92,544 KB |
testcase_36 | AC | 138 ms
91,776 KB |
testcase_37 | AC | 138 ms
91,264 KB |
testcase_38 | AC | 1,031 ms
312,192 KB |
testcase_39 | AC | 1,030 ms
312,192 KB |
ソースコード
import sys from collections import deque, Counter from math import gcd, log10, pi, sqrt, ceil from bisect import bisect, bisect_left, bisect_right, insort from typing import Iterable, TypeVar, Union, Tuple, Iterator, List import copy import heapq import itertools import math import random from fractions import Fraction from functools import lru_cache, partial, cmp_to_key import operator input = sys.stdin.readline sys.setrecursionlimit(10000000) mod = 998244353 INF = 1 << 61 DIFF = 10 ** -9 DX = [1, 0, -1, 0, 1, 1, -1, -1] DY = [0, 1, 0, -1, 1, -1, 1, -1] def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(): return list(read_values()) def read_lists(N): return [read_list() for _ in range(N)] def main(): N, X, Y = read_values() L = read_lists(N) dp = [[[0] * (Y + 1) for _ in range(X + 1)] for _ in range(N + 1)] for k, (a, b, c) in enumerate(L): for x in range(X + 1): for y in range(Y + 1): if x + a <= X and y + b <= Y: dp[k + 1][x + a][y + b] = max(dp[k + 1][x + a][y + b], dp[k][x][y] + c) dp[k + 1][x][y] = max(dp[k + 1][x][y], dp[k][x][y]) print(max(max(v) for v in dp[N])) if __name__ == "__main__": main()