結果
| 問題 |
No.2232 Miser's Gift
|
| コンテスト | |
| ユーザー |
titia
|
| 提出日時 | 2023-03-03 22:52:27 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 258 bytes |
| コンパイル時間 | 301 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 21,536 KB |
| 最終ジャッジ日時 | 2024-09-17 23:59:35 |
| 合計ジャッジ時間 | 4,350 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | TLE * 1 -- * 54 |
ソースコード
N,W=map(int,input().split())
WV=[list(map(int,input().split())) for i in range(N)]
DP=[0]*(W+1)
for w,v in WV:
for i in range(W,-1,-1):
if i+w<=W and DP[i+w]<DP[i]+v:
DP[i+w]=DP[i]+v
for i in range(W):
print(DP[-1]-DP[-2-i]+1)
titia