結果
問題 | No.2317 Expression Menu |
ユーザー | miho-4 |
提出日時 | 2023-05-26 21:59:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 406 bytes |
コンパイル時間 | 286 ms |
コンパイル使用メモリ | 86,844 KB |
実行使用メモリ | 116,180 KB |
最終ジャッジ日時 | 2023-08-26 11:31:59 |
合計ジャッジ時間 | 26,188 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 70 ms
71,008 KB |
testcase_01 | AC | 71 ms
71,360 KB |
testcase_02 | AC | 72 ms
71,432 KB |
testcase_03 | WA | - |
testcase_04 | AC | 922 ms
90,704 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | TLE | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
testcase_26 | -- | - |
testcase_27 | -- | - |
testcase_28 | -- | - |
testcase_29 | -- | - |
testcase_30 | -- | - |
testcase_31 | -- | - |
testcase_32 | -- | - |
testcase_33 | -- | - |
testcase_34 | -- | - |
testcase_35 | -- | - |
testcase_36 | -- | - |
testcase_37 | -- | - |
testcase_38 | -- | - |
testcase_39 | -- | - |
ソースコード
n,x,y=map(int,input().split()) L=[list(map(int,input().split())) for _ in range(n)] d=dict() d[(0,0)]=0 S={(0,0)} ans=0 for a,b,c in L: nx={(0,0)} for A,B in S: v=d[(A,B)] if A+a<=x and B+b<=y: ans=max(ans,v+c) nx.add((A+a,B+b)) if (A+a,B+b) not in d: d[(A+a,B+b)]=v+c else: if d[(A+a,B+b)]<v+c: d[(A+a,B+b)]=v+c S|=nx # print(S) print(ans)