# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
656372 |
2022-11-07T05:58:13 Z |
the_ilyas |
Bank (IZhO14_bank) |
C++14 |
|
1 ms |
384 KB |
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
const int N = 100001;
int dp[N];
signed main(){
ios::sync_with_stdio(0); cin.tie(0);
int n, m; cin >> n >> m;
int A[n];
for(int i = 0; i < n; i++) {
cin >> A[i];
}
int M[m];
for(int i = 0; i < m; i++)
cin >> M[i];
dp[0] = 1;
for(int i = 1; i <= 10000; i++) {
for(int j = 0; j < m; j++) {
if(i - M[j] >= 0) {
dp[i] = dp[i - M[j]];
}
}
}
if(accumulate(dp, dp + N, 0) == n)
cout << "YES";
else
cout << "NO";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
324 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 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 |
1 ms |
324 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |