結果
問題 | No.2492 Knapsack Problem? |
ユーザー |
|
提出日時 | 2023-11-17 20:00:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 270 bytes |
コンパイル時間 | 1,616 ms |
コンパイル使用メモリ | 165,700 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-26 05:32:26 |
合計ジャッジ時間 | 2,065 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main(void){int n,W;cin >> n >> W;int ans=-1;while(n--){int v,w;cin >> v >> w;if(w<=W){if(v>ans)ans=v;}}cout << ans << endl;return 0;}