# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
207499 | DystoriaX | Bali Sculptures (APIO15_sculpture) | C++14 | 1093 ms | 632 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;
int n, a, b;
int y[1010];
long long pref[1010];
long long ans = 1e18, sum = 0;
void rec(int depth, int last){
if(last > n){
if(a <= depth && depth <= b) ans = min(ans, sum);
return;
} else {
long long tp = sum;
for(int i = last; i <= n; i++){
sum |= (pref[i] - pref[last - 1]);
rec(depth + 1, i + 1);
sum = tp;
}
}
}
int main(){
scanf("%d%d%d", &n, &a, &b);
for(int i = 1; i <= n; i++) scanf("%d", &y[i]), pref[i] = pref[i - 1] + y[i];
rec(0, 1);
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... |