結果
| 問題 | No.2492 Knapsack Problem? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-06 21:21:03 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 1 ms / 2,000 ms |
| + 341µs | |
| コード長 | 240 bytes |
| 記録 | |
| コンパイル時間 | 278 ms |
| コンパイル使用メモリ | 72,540 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-24 12:30:58 |
| 合計ジャッジ時間 | 1,367 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include<iostream>
#include<cassert>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N,W;
cin>>N>>W;
int ans=-1;
for(;N--;)
{
int v,w;cin>>v>>w;
if(w<=W)ans=max(ans,v);
}
cout<<ans<<endl;
}