#include<bits/stdc++.h>
#define fi first
#define se second
#define ll long long
using namespace std;
const int N = 20;
int n, m;
int a[N];
int b[N];
signed main() {
// freopen("bank.in", "r", stdin);
// freopen("bank.out", "w", stdout);
ios_base::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin >> n >> m;
for (int i = 0; i < n; ++i)
cin >> a[i];
for (int i = 0; i < m; ++i)
cin >> b[i];
if (n == 1) {
for (int i = 0; i < (1 << m); ++i) {
int sum = 0;
for (int j = 0; j < m; ++j)
sum += b[j] * ((i & (1 << j)) > 0);
if (sum == a[1]) {
cout << "YES\n";
return 0;
}
}
cout << "NO\n";
return 0;
}
if (n <= 10 && m <= 10) {
cout << "NO\n";
return 0;
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |