結果

問題 No.2492 Knapsack Problem?
ユーザー mymelochanmymelochan
提出日時 2023-10-06 21:27:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 112 ms / 2,000 ms
コード長 592 bytes
コンパイル時間 413 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 76,772 KB
最終ジャッジ日時 2023-10-06 21:27:16
合計ジャッジ時間 2,279 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
71,888 KB
testcase_01 AC 90 ms
71,896 KB
testcase_02 AC 94 ms
71,644 KB
testcase_03 AC 88 ms
71,816 KB
testcase_04 AC 92 ms
71,688 KB
testcase_05 AC 89 ms
71,364 KB
testcase_06 AC 92 ms
72,096 KB
testcase_07 AC 112 ms
72,232 KB
testcase_08 AC 93 ms
72,188 KB
testcase_09 AC 100 ms
76,772 KB
testcase_10 AC 99 ms
76,708 KB
testcase_11 AC 98 ms
76,700 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#############################################################

import sys
sys.setrecursionlimit(10**7)

from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations

ipt = sys.stdin.readline

def iin():
    return int(ipt())
def lmin():
    return list(map(int,ipt().split()))

MOD = 998244353
#############################################################

N,W = lmin()

ans = -1
for i in range(N):
    v,w = lmin()
    if w <= W:
        ans = max(ans,v)

print(ans)
0