結果

問題 No.2317 Expression Menu
ユーザー prin_kemkemprin_kemkem
提出日時 2023-05-27 00:47:49
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 944 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,132 KB
実行使用メモリ 233,396 KB
最終ジャッジ日時 2023-08-26 14:38:41
合計ジャッジ時間 61,808 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 177 ms
81,156 KB
testcase_01 AC 181 ms
81,128 KB
testcase_02 AC 284 ms
87,384 KB
testcase_03 AC 1,704 ms
209,728 KB
testcase_04 AC 1,791 ms
210,808 KB
testcase_05 TLE -
testcase_06 AC 1,816 ms
205,036 KB
testcase_07 AC 1,955 ms
219,912 KB
testcase_08 AC 1,678 ms
210,188 KB
testcase_09 AC 1,912 ms
208,676 KB
testcase_10 AC 1,934 ms
216,156 KB
testcase_11 TLE -
testcase_12 AC 1,867 ms
211,560 KB
testcase_13 AC 1,807 ms
214,792 KB
testcase_14 TLE -
testcase_15 AC 1,806 ms
205,712 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 1,626 ms
202,048 KB
testcase_19 TLE -
testcase_20 TLE -
testcase_21 AC 1,729 ms
205,656 KB
testcase_22 AC 1,717 ms
203,336 KB
testcase_23 AC 1,777 ms
196,920 KB
testcase_24 AC 1,770 ms
196,504 KB
testcase_25 AC 1,839 ms
194,364 KB
testcase_26 AC 1,743 ms
192,244 KB
testcase_27 AC 1,798 ms
192,780 KB
testcase_28 AC 1,834 ms
194,764 KB
testcase_29 AC 1,779 ms
195,820 KB
testcase_30 AC 1,816 ms
196,004 KB
testcase_31 AC 1,699 ms
194,436 KB
testcase_32 AC 1,761 ms
193,208 KB
testcase_33 AC 184 ms
81,020 KB
testcase_34 AC 177 ms
80,956 KB
testcase_35 AC 183 ms
82,224 KB
testcase_36 AC 178 ms
80,956 KB
testcase_37 AC 184 ms
80,884 KB
testcase_38 AC 1,295 ms
153,032 KB
testcase_39 AC 1,241 ms
157,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict, deque, Counter
import copy
from itertools import combinations, permutations, product, accumulate, groupby
from heapq import heapify, heappop, heappush
import math
import bisect
from pprint import pprint
from random import randint
import sys
# sys.setrecursionlimit(700000)
input = lambda: sys.stdin.readline().rstrip('\n')
inf = float('inf')
mod1 = 10**9+7
mod2 = 998244353
def ceil_div(x, y): return -(-x//y)

#################################################

N, X, Y = map(int, input().split())
dp = [[-inf]*(Y+1) for _ in range(X+1)]
dp[0][0] = 0
for _ in range(N):
    a, b, c = map(int, input().split())
    ndp = [[dp[i][j] for j in range(Y+1)] for i in range(X+1)]
    for i in range(X):
        for j in range(Y):
            if i+a <= X and j+b <= Y:
                ndp[i+a][j+b] = max(ndp[i+a][j+b], dp[i][j]+c)
    dp = ndp
ans = 0
for i in range(X+1):
    ans = max(ans, max(dp[i]))
print(ans)
0