結果

問題 No.2492 Knapsack Problem?
ユーザー lloyzlloyz
提出日時 2023-10-06 21:25:12
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 34 ms / 2,000 ms
コード長 236 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-26 15:41:29
合計ジャッジ時間 1,196 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

n, w = map(int, input().split())
V, W = [], []
for i in range(n):
    vv, ww = map(int, input().split())
    V.append(vv)
    W.append(ww)
ans = -1
for i in range(n):
    if W[i] <= w:
        ans = max(ans, V[i])
print(ans)
0