結果

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

ソースコード

diff #

a,b = map(int, input().split())
ls=[]
c=0
f=False
for i in range(a):
    ls.append(list(map(int, input().split())))
for i in range(a):
    if ls[i][1]<=b:
        c=max(c,ls[i][0])
        f=True
if f==False:
    print(-1)
else:
    print(c)
0