結果

問題 No.2317 Expression Menu
ユーザー 👑 H20H20
提出日時 2023-05-26 21:48:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 422 ms / 2,000 ms
コード長 447 bytes
コンパイル時間 373 ms
コンパイル使用メモリ 87,304 KB
実行使用メモリ 78,228 KB
最終ジャッジ日時 2023-08-26 11:09:21
合計ジャッジ時間 14,971 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,392 KB
testcase_01 AC 74 ms
71,372 KB
testcase_02 AC 105 ms
77,984 KB
testcase_03 AC 337 ms
77,788 KB
testcase_04 AC 340 ms
78,072 KB
testcase_05 AC 383 ms
78,180 KB
testcase_06 AC 328 ms
77,960 KB
testcase_07 AC 369 ms
77,984 KB
testcase_08 AC 333 ms
77,912 KB
testcase_09 AC 345 ms
78,084 KB
testcase_10 AC 362 ms
77,908 KB
testcase_11 AC 358 ms
77,948 KB
testcase_12 AC 409 ms
78,080 KB
testcase_13 AC 365 ms
77,828 KB
testcase_14 AC 389 ms
77,896 KB
testcase_15 AC 337 ms
77,792 KB
testcase_16 AC 369 ms
77,616 KB
testcase_17 AC 400 ms
77,600 KB
testcase_18 AC 342 ms
77,928 KB
testcase_19 AC 381 ms
77,904 KB
testcase_20 AC 382 ms
77,984 KB
testcase_21 AC 333 ms
77,904 KB
testcase_22 AC 335 ms
77,980 KB
testcase_23 AC 422 ms
77,888 KB
testcase_24 AC 404 ms
78,008 KB
testcase_25 AC 395 ms
77,752 KB
testcase_26 AC 389 ms
77,936 KB
testcase_27 AC 391 ms
78,144 KB
testcase_28 AC 403 ms
78,228 KB
testcase_29 AC 413 ms
78,096 KB
testcase_30 AC 407 ms
77,984 KB
testcase_31 AC 396 ms
77,948 KB
testcase_32 AC 391 ms
77,976 KB
testcase_33 AC 74 ms
71,312 KB
testcase_34 AC 73 ms
71,576 KB
testcase_35 AC 81 ms
76,620 KB
testcase_36 AC 75 ms
71,540 KB
testcase_37 AC 76 ms
71,140 KB
testcase_38 AC 240 ms
77,492 KB
testcase_39 AC 233 ms
77,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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