結果
問題 | No.2317 Expression Menu |
ユーザー | cleantted |
提出日時 | 2023-02-19 01:41:20 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,032 ms / 2,000 ms |
コード長 | 1,309 bytes |
コンパイル時間 | 360 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 122,752 KB |
最終ジャッジ日時 | 2024-09-18 09:38:26 |
合計ジャッジ時間 | 33,601 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 157 ms
91,392 KB |
testcase_01 | AC | 160 ms
91,776 KB |
testcase_02 | AC | 227 ms
93,312 KB |
testcase_03 | AC | 1,018 ms
121,600 KB |
testcase_04 | AC | 1,009 ms
122,240 KB |
testcase_05 | AC | 1,014 ms
122,496 KB |
testcase_06 | AC | 1,006 ms
122,752 KB |
testcase_07 | AC | 1,021 ms
122,752 KB |
testcase_08 | AC | 1,022 ms
121,396 KB |
testcase_09 | AC | 1,007 ms
120,960 KB |
testcase_10 | AC | 1,019 ms
121,984 KB |
testcase_11 | AC | 1,015 ms
121,088 KB |
testcase_12 | AC | 1,018 ms
121,088 KB |
testcase_13 | AC | 1,032 ms
121,216 KB |
testcase_14 | AC | 1,017 ms
120,960 KB |
testcase_15 | AC | 1,016 ms
122,496 KB |
testcase_16 | AC | 1,019 ms
122,624 KB |
testcase_17 | AC | 1,032 ms
122,752 KB |
testcase_18 | AC | 1,007 ms
121,984 KB |
testcase_19 | AC | 1,021 ms
121,216 KB |
testcase_20 | AC | 1,018 ms
121,088 KB |
testcase_21 | AC | 1,014 ms
121,856 KB |
testcase_22 | AC | 1,007 ms
122,368 KB |
testcase_23 | AC | 921 ms
109,312 KB |
testcase_24 | AC | 911 ms
109,056 KB |
testcase_25 | AC | 912 ms
109,568 KB |
testcase_26 | AC | 909 ms
109,440 KB |
testcase_27 | AC | 912 ms
109,184 KB |
testcase_28 | AC | 913 ms
108,416 KB |
testcase_29 | AC | 908 ms
109,184 KB |
testcase_30 | AC | 917 ms
109,184 KB |
testcase_31 | AC | 917 ms
108,928 KB |
testcase_32 | AC | 902 ms
108,928 KB |
testcase_33 | AC | 156 ms
91,264 KB |
testcase_34 | AC | 153 ms
91,776 KB |
testcase_35 | AC | 161 ms
92,544 KB |
testcase_36 | AC | 158 ms
91,776 KB |
testcase_37 | AC | 158 ms
91,648 KB |
testcase_38 | AC | 561 ms
107,392 KB |
testcase_39 | AC | 571 ms
107,648 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: dp2 = [[0] * (Y + 1) for _ in range(X + 1)] for x in range(X + 1): for y in range(Y + 1): if x + a <= X and y + b <= Y: dp2[x + a][y + b] = max(dp2[x + a][y + b], dp[x][y] + c) dp2[x][y] = max(dp2[x][y], dp[x][y]) dp = dp2 print(max(max(v) for v in dp)) if __name__ == "__main__": main()