結果
| 問題 | No.3670 Fast Knapsack |
| コンテスト | |
| ユーザー |
harurun
|
| 提出日時 | 2026-08-06 03:17:28 |
| 言語 | C++23(gcc16) (gcc 16.1.0 + boost 1.92.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 2,267 ms |
| コンパイル使用メモリ | 354,272 KB |
| 実行使用メモリ | 9,752 KB |
| 最終ジャッジ日時 | 2026-09-04 22:05:50 |
| 合計ジャッジ時間 | 7,724 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | RE * 25 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
bitset<100001> C;
void solve(){
ll N,S;
cin>>N>>S;
C.reset();
vector<ll> A(N);
for(ll i=0;i<N;i++){
cin>>A[i];
}
C.set(0);
for(ll i:A){
C|=C<<i;
}
for(ll i=S;i>=0;i--){
if(C.test(i)){
cout<<i<<"\n";
return;
}
}
}
int main(){
ll T;
cin>>T;
while(T--){
solve();
}
}
harurun