結果

問題 No.2492 Knapsack Problem?
ユーザー hiro1729hiro1729
提出日時 2023-09-06 19:00:41
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 205 bytes
コンパイル時間 339 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 75,788 KB
最終ジャッジ日時 2023-10-06 20:50:03
合計ジャッジ時間 2,565 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,424 KB
testcase_01 AC 73 ms
71,536 KB
testcase_02 AC 74 ms
71,292 KB
testcase_03 AC 74 ms
71,316 KB
testcase_04 AC 74 ms
71,500 KB
testcase_05 AC 73 ms
71,492 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
権限があれば一括ダウンロードができます

ソースコード

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