結果
| 問題 | No.3670 Fast Knapsack |
| コンテスト | |
| ユーザー |
tau1235
|
| 提出日時 | 2026-09-04 22:41:28 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 345 bytes |
| 記録 | |
| コンパイル時間 | 2,011 ms |
| コンパイル使用メモリ | 332,576 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-09-04 22:50:55 |
| 合計ジャッジ時間 | 10,819 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 11 TLE * 1 -- * 13 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
void solve(){
const int l=2e5+10;
int n,s;
cin>>n>>s;
bitset<l> bt;
bt[0]=1;
for (int i=0;i<n;i++){
int a;
cin>>a;
bt|=bt<<a;
}
for (int i=s;i>=0;i--){
if (bt[i]){
cout<<i<<endl;
return;
}
}
}
int main(){
int t;
cin>>t;
while (t--) solve();
}
tau1235