結果
問題 | No.2492 Knapsack Problem? |
ユーザー |
![]() |
提出日時 | 2023-10-06 21:22:52 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 88 ms / 2,000 ms |
コード長 | 655 bytes |
コンパイル時間 | 190 ms |
コンパイル使用メモリ | 82,112 KB |
実行使用メモリ | 80,740 KB |
最終ジャッジ日時 | 2024-07-26 15:38:37 |
合計ジャッジ時間 | 1,858 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
from collections import defaultdict, deque, Counterimport copyfrom itertools import combinations, permutations, product, accumulate, groupby, chainfrom heapq import heapify, heappop, heappushimport mathimport bisectfrom pprint import pprintfrom random import randintimport sys# sys.setrecursionlimit(700000)input = lambda: sys.stdin.readline().rstrip('\n')inf = float('inf')mod1 = 10**9+7mod2 = 998244353def ceil_div(x, y): return -(-x//y)#################################################N, W = map(int, input().split())ans = -1for _ in range(N):v, w = map(int, input().split())if w <= W:ans = max(ans, v)print(ans)