結果
問題 | No.2492 Knapsack Problem? |
ユーザー | flygon |
提出日時 | 2023-10-06 21:22:34 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 103 ms / 2,000 ms |
コード長 | 370 bytes |
コンパイル時間 | 292 ms |
コンパイル使用メモリ | 87,176 KB |
実行使用メモリ | 72,560 KB |
最終ジャッジ日時 | 2023-10-06 21:22:36 |
合計ジャッジ時間 | 2,318 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 96 ms
71,584 KB |
testcase_01 | AC | 95 ms
71,732 KB |
testcase_02 | AC | 99 ms
71,600 KB |
testcase_03 | AC | 97 ms
71,728 KB |
testcase_04 | AC | 98 ms
71,728 KB |
testcase_05 | AC | 97 ms
71,664 KB |
testcase_06 | AC | 97 ms
71,808 KB |
testcase_07 | AC | 97 ms
71,764 KB |
testcase_08 | AC | 97 ms
71,688 KB |
testcase_09 | AC | 101 ms
72,440 KB |
testcase_10 | AC | 103 ms
72,560 KB |
testcase_11 | AC | 100 ms
72,408 KB |
ソースコード
import sys sys.setrecursionlimit(5*10**5) input = sys.stdin.readline from collections import defaultdict, deque, Counter from heapq import heappop, heappush from bisect import bisect_left, bisect_right from math import gcd n,m = map(int,input().split()) ans = -1 for i in range(n): v,w = map(int,input().split()) if w <= m: ans = max(ans, v) print(ans)