結果
問題 | No.1463 Hungry Kanten |
ユーザー |
|
提出日時 | 2021-04-02 21:36:10 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 373 bytes |
コンパイル時間 | 1,562 ms |
コンパイル使用メモリ | 173,632 KB |
実行使用メモリ | 15,744 KB |
最終ジャッジ日時 | 2024-12-23 23:22:48 |
合計ジャッジ時間 | 2,579 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 17 WA * 3 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int n,k; cin>>n>>k; vector<int>a(n); for(int &i:a)cin>>i; set<uint64_t>ans; for(int i=0;i<(1<<n);i++){ if(__builtin_popcount(i)<k)continue; uint64_t se=1,wa=0; for(int j=0;j<n;j++){ if(i>>j&1){wa+=a[j];se*=a[j];} } ans.insert(wa),ans.insert(se); } cout<<ans.size()<<'\n'; }