結果

問題 No.2492 Knapsack Problem?
ユーザー hiro1729
提出日時 2023-09-06 19:00:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 205 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 61,696 KB
最終ジャッジ日時 2024-07-26 15:34:06
合計ジャッジ時間 1,795 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 3 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

n, w = map(int, input().split())
V = [0] * n
W = [0] * n
for i in range(n):
	V[i], W[i] = map(int, input().split())
maxw = 0
ans = -1
for i in range(n):
	if W[i] <= w:
		maxw = W[i]
		ans = V[i]
print(ans)
0