結果

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

ソースコード

diff #

#include<iostream>
#include<cmath>

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