# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1106092 | akzytr | Bank (IZhO14_bank) | C++17 | 2 ms | 592 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;
#define ll long long
#define arr array
#define vec vector
#define sz(a) ((int)(a).size())
void B() {
/*
Problem B: Bank
Subtask 1: n = 1, Normal knapsack, 1000
*/
int N, M;
cin >> N >> M;
int a[N];
int b[M];
for(int i = 0; i < N; i++) {
cin >> a[i];
}
for(int i = 0; i < M; i++) {
cin >> b[i];
}
assert(N = 1);
assert(M <= 10);
bitset<1002> g;
g[0] = 1;
for(int i : b) {
g |= (g << i);
}
cout << (g[a[0]] ? "YES" : "NO") << endl;
}
int main() {
B();
}
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... |