結果

問題 No.2492 Knapsack Problem?
ユーザー otamay6
提出日時 2023-10-15 23:17:11
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 213 bytes
コンパイル時間 596 ms
コンパイル使用メモリ 77,112 KB
最終ジャッジ日時 2025-02-17 08:00:19
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cmath>

int main(void){
	int n,w;
	std::cin>>n>>w;
	int res = -1;
	while(n--){
		int v,e;
		std::cin>>v>>e;
		if(e <= w){
			res = std::max(res, v);
		}
	}
	std::cout<<res<<std::endl;
}
0