# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101292 | 2019-03-18T07:45:32 Z | arman_ferdous | Bali Sculptures (APIO15_sculpture) | C++17 | 3 ms | 256 KB |
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { int n, A, B; ll arr[22]; scanf("%d %d", &n, &A, &B); for(int i = 0; i < n; i++) scanf("%lld", &arr[i]); ll ans = (1ll<<62); for(int mask = 0; mask < (1<<n); mask++) { ll here = 0, cnt = 0; for(int i = 0; i < n; ) { ll sum = 0; for(int j = i; j < n; j++, i++) { sum += arr[j]; if(mask>>j&1) { i++; cnt++; break; } } here |= sum; } if(A <= cnt && cnt <= B) ans = min(ans, here); } printf("%lld\n", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 256 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |