結果

問題 No.2492 Knapsack Problem?
ユーザー june19312
提出日時 2023-10-06 21:24:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 53 ms / 2,000 ms
コード長 197 bytes
コンパイル時間 327 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 62,988 KB
最終ジャッジ日時 2024-07-26 15:41:15
合計ジャッジ時間 1,475 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

N,W = map(int,input().split())

bag = []

for i in range(N):
    v,w = map(int,input().split())
    bag.append([v,w])

ans = -1

for a,b in bag:
    if b <= W:
        ans = max(ans,a)

print(ans)
0