結果

問題 No.2492 Knapsack Problem?
ユーザー otamay6otamay6
提出日時 2023-10-15 23:16:33
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 212 bytes
コンパイル時間 962 ms
コンパイル使用メモリ 77,720 KB
実行使用メモリ 4,372 KB
最終ジャッジ日時 2023-10-15 23:16:36
合計ジャッジ時間 2,142 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 WA -
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 WA -
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

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