# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
794625 | 2023-07-26T16:58:35 Z | nguyennehehe | Bank (IZhO14_bank) | C++14 | 2 ms | 340 KB |
#include<bits/stdc++.h> using namespace std; const int N = 20; int n, m, a[N], b[N]; void sub1() { bool good = false; for (int s = 1; s < (1 << m); ++s) { int sum = 0; for (int i = 0; i < m; ++i) { if (s >> i & 1) sum += b[i]; } good |= sum == a[0]; } cout << (good ? "YES" : "NO"); } signed main() { ios::sync_with_stdio(false); cin.tie(nullptr); freopen("bank.in", "r", stdin); freopen("bank.out", "w", stdout); 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) sub1(); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 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 | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 340 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |