| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 846980 | vjudge1 | Bank (IZhO14_bank) | C++17 | 46 ms | 548 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;
void solve() {
int n, m;
cin >> n >> m;
vector<int> a(n), b(m);
for(int &x : a)
cin >> x;
for(int &y : b)
cin >> y;
for(int msk = 1 ; msk < (1 << m) ; ++msk) {
int sum = 0;
for(int i = 0 ; i < m ; ++i) {
if((msk >> i) & 1) {
sum += b[i];
}
}
if(sum == a[0]) {
cout << "YES\n";
return;
}
}
cout << "NO\n";
}
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#ifndef ONLINE_JUDGE
// freopen("input.txt", "r", stdin);
#else
#endif
int tc = 1, cs = 1;
// cin >> tc;
while(tc--){
solve();
}
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... | ||||
