| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1325563 | rainy3218 | Bank (IZhO14_bank) | C++20 | 0 ms | 332 KiB |
#include <bits/stdc++.h>
using namespace std;
int a[25];
int b[25];
int dp[1005];
int main() {
int N, M;
cin >> N >> M;
for(int i = 1; i <= N; i++) cin >> a[i];
for (int i = 1; i <= M; i++) cin >> b[i];
dp[0] = 1;
for (int i = 1; i <= M; i++) {
for (int j = 1000; j >= b[i]; j--) {
dp[j] = dp[j - b[i]] | dp[j];
}
}
for(int i = 1; i <= N; i++) {
if(dp[a[i]] == 0) {
cout << "NO" << endl;
return 0;
}
}
cout << "YES" << endl;
return 0;
}
| # | 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... | ||||
