# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
811770 | exodus_ | Bank (IZhO14_bank) | C++14 | 67 ms | 300 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int main() {
int N,M;
int pip[21];
cin >> N >> M;
vector<int>vek(M);
for(int i=1; i<=N; i++) {
cin >> pip[i];
}
for(int i=0; i<M; i++) {
cin >> vek[i];
}
bool ada=false;
for(int mask=0; mask<(1<<M); mask++) {
int sum = 0;
for(int i=0; i<M; i++) {
if((mask>>i)&1==true) sum+=vek[i];
}
if(sum==pip[1]) {
ada=true;
break;
}
}
if(ada) cout << "YES"; else cout << "NO";
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |