# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
783779 | 2023-07-15T10:11:42 Z | nghiaaa | Bank (IZhO14_bank) | C++17 | 2 ms | 340 KB |
#include <bits/stdc++.h> using namespace std; #define int long long multiset<int> haha; int n,m; signed main() { ios_base::sync_with_stdio(false); cin.tie(0); freopen("bank.in","r",stdin); freopen("bank.out","w",stdout); cin>>n>>m; int check=0; for (int i=0;i<n;i++) { int ai; cin>>ai; haha.insert(ai); } int a[m+1]; for (int i=0;i<m;i++) cin>>a[i]; int BIT[22]; BIT[0]=1; for (int i=1;i<22;i++) BIT[i]=BIT[i-1]<<1; for (int mask=1;mask<BIT[m];mask++) { if (mask&check) continue; int sum=0; for (int i=0;i<m;i++) if (mask&BIT[i]) sum+=a[i]; if (haha.find(sum)!=haha.end()) { haha.erase(sum); //check|=mask; } } if (haha.size()) cout<<"NO"; else cout<<"YES"; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |