# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
739914 |
2023-05-11T15:20:04 Z |
Desh03 |
Bank (IZhO14_bank) |
C++17 |
|
1 ms |
212 KB |
#include <bits/stdc++.h>
using namespace std;
bool dp[20][1001];
int main() {
int n, m;
cin >> n >> m;
vector<int> a(n), b(m);
for (int i = 0; i < n; i++) cin >> a[i];
for (int i = 0; i < m; i++) cin >> b[i];
dp[0][0] = 1;
for (int i = 0; i < m; i++)
for (int j = 0; j <= 1000; j++)
if (j + b[i] <= 1000)
dp[i][j + b[i]] |= dp[i][j];
for (int i = 0; i < n; i++)
if (!dp[i][a[i]]) {
cout << "NO\n";
return 0;
}
cout << "YES\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |