# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101292 | arman_ferdous | Bali Sculptures (APIO15_sculpture) | C++17 | 3 ms | 256 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;
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 (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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |