結果

問題 No.2317 Expression Menu
ユーザー miho-4miho-4
提出日時 2023-05-26 22:10:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 379 ms / 2,000 ms
コード長 369 bytes
コンパイル時間 642 ms
コンパイル使用メモリ 87,276 KB
実行使用メモリ 78,092 KB
最終ジャッジ日時 2023-08-26 11:51:05
合計ジャッジ時間 13,113 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
75,208 KB
testcase_01 AC 79 ms
75,296 KB
testcase_02 AC 97 ms
76,412 KB
testcase_03 AC 294 ms
76,536 KB
testcase_04 AC 293 ms
76,536 KB
testcase_05 AC 318 ms
76,664 KB
testcase_06 AC 301 ms
76,264 KB
testcase_07 AC 316 ms
76,684 KB
testcase_08 AC 289 ms
76,492 KB
testcase_09 AC 297 ms
76,648 KB
testcase_10 AC 330 ms
76,612 KB
testcase_11 AC 309 ms
76,460 KB
testcase_12 AC 331 ms
78,032 KB
testcase_13 AC 304 ms
76,564 KB
testcase_14 AC 338 ms
76,260 KB
testcase_15 AC 291 ms
76,780 KB
testcase_16 AC 316 ms
76,612 KB
testcase_17 AC 327 ms
76,568 KB
testcase_18 AC 295 ms
76,732 KB
testcase_19 AC 330 ms
76,704 KB
testcase_20 AC 342 ms
76,704 KB
testcase_21 AC 288 ms
76,700 KB
testcase_22 AC 287 ms
76,776 KB
testcase_23 AC 379 ms
78,092 KB
testcase_24 AC 362 ms
78,016 KB
testcase_25 AC 350 ms
77,584 KB
testcase_26 AC 348 ms
78,048 KB
testcase_27 AC 347 ms
78,044 KB
testcase_28 AC 358 ms
77,964 KB
testcase_29 AC 370 ms
78,088 KB
testcase_30 AC 372 ms
77,952 KB
testcase_31 AC 359 ms
77,976 KB
testcase_32 AC 351 ms
77,740 KB
testcase_33 AC 77 ms
75,292 KB
testcase_34 AC 79 ms
75,200 KB
testcase_35 AC 80 ms
76,156 KB
testcase_36 AC 77 ms
75,228 KB
testcase_37 AC 77 ms
75,244 KB
testcase_38 AC 208 ms
76,396 KB
testcase_39 AC 212 ms
76,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,x,y=map(int,input().split())
L=[list(map(int,input().split())) for _ in range(n)]

C=[[-1]*301 for _ in range(301)]
C[0][0]=0
ans=0
for a,b,c in L:
  for i in range(x+1)[::-1]:
    for j in range(y+1)[::-1]:
      if 0<=C[i][j] and i+a<=x and j+b<=y:
        if C[i+a][j+b]<C[i][j]+c:
          C[i+a][j+b]=C[i][j]+c
for line in C:
  ans=max(ans,max(line))
print(ans)
0