結果
問題 | No.2317 Expression Menu |
ユーザー | cleantted |
提出日時 | 2023-02-19 01:46:59 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,437 ms / 2,000 ms |
コード長 | 1,256 bytes |
コンパイル時間 | 183 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 92,672 KB |
最終ジャッジ日時 | 2024-09-18 09:39:13 |
合計ジャッジ時間 | 35,484 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 144 ms
91,520 KB |
testcase_01 | AC | 135 ms
91,776 KB |
testcase_02 | AC | 233 ms
92,672 KB |
testcase_03 | AC | 848 ms
92,416 KB |
testcase_04 | AC | 832 ms
92,488 KB |
testcase_05 | AC | 791 ms
92,544 KB |
testcase_06 | AC | 884 ms
92,280 KB |
testcase_07 | AC | 845 ms
92,672 KB |
testcase_08 | AC | 865 ms
92,160 KB |
testcase_09 | AC | 878 ms
92,468 KB |
testcase_10 | AC | 839 ms
92,620 KB |
testcase_11 | AC | 878 ms
92,560 KB |
testcase_12 | AC | 851 ms
92,544 KB |
testcase_13 | AC | 858 ms
92,288 KB |
testcase_14 | AC | 885 ms
92,544 KB |
testcase_15 | AC | 862 ms
92,160 KB |
testcase_16 | AC | 838 ms
92,344 KB |
testcase_17 | AC | 772 ms
92,260 KB |
testcase_18 | AC | 832 ms
92,672 KB |
testcase_19 | AC | 906 ms
92,672 KB |
testcase_20 | AC | 897 ms
92,344 KB |
testcase_21 | AC | 805 ms
92,160 KB |
testcase_22 | AC | 842 ms
92,288 KB |
testcase_23 | AC | 1,371 ms
92,084 KB |
testcase_24 | AC | 1,397 ms
92,520 KB |
testcase_25 | AC | 1,414 ms
92,160 KB |
testcase_26 | AC | 1,375 ms
92,388 KB |
testcase_27 | AC | 1,437 ms
92,672 KB |
testcase_28 | AC | 1,384 ms
92,544 KB |
testcase_29 | AC | 1,390 ms
92,416 KB |
testcase_30 | AC | 1,369 ms
92,564 KB |
testcase_31 | AC | 1,434 ms
92,128 KB |
testcase_32 | AC | 1,376 ms
92,288 KB |
testcase_33 | AC | 135 ms
91,648 KB |
testcase_34 | AC | 135 ms
91,520 KB |
testcase_35 | AC | 139 ms
92,296 KB |
testcase_36 | AC | 128 ms
91,776 KB |
testcase_37 | AC | 133 ms
91,392 KB |
testcase_38 | AC | 721 ms
92,160 KB |
testcase_39 | AC | 1,370 ms
92,544 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 a, b, c in L: for x in reversed(range(X + 1)): for y in reversed(range(Y + 1)): if x + a <= X and y + b <= Y: dp[x + a][y + b] = max(dp[x + a][y + b], dp[x][y] + c) dp[x][y] = max(dp[x][y], dp[x][y]) print(max(max(v) for v in dp)) if __name__ == "__main__": main()