結果

問題 No.2492 Knapsack Problem?
ユーザー ShirotsumeShirotsume
提出日時 2023-10-06 21:21:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 354 bytes
コンパイル時間 345 ms
コンパイル使用メモリ 87,056 KB
実行使用メモリ 75,076 KB
最終ジャッジ日時 2023-10-06 21:21:08
合計ジャッジ時間 2,453 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
74,488 KB
testcase_01 AC 113 ms
75,076 KB
testcase_02 AC 109 ms
74,912 KB
testcase_03 AC 109 ms
74,976 KB
testcase_04 AC 111 ms
74,988 KB
testcase_05 AC 109 ms
74,912 KB
testcase_06 AC 110 ms
74,984 KB
testcase_07 AC 111 ms
74,852 KB
testcase_08 AC 111 ms
74,860 KB
testcase_09 AC 111 ms
74,728 KB
testcase_10 AC 134 ms
74,996 KB
testcase_11 AC 112 ms
74,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

n, w = mi()
ans = -1
for _ in range(n):
    x, y = mi()
    if y <= w:
        ans = max(ans, x)
print(ans)
0