# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1019824 | KasymK | Bali Sculptures (APIO15_sculpture) | C++17 | 1027 ms | 600 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 pb push_back
#define ll long long
#define ff first
#define ss second
#define all(v) v.begin(), v.end()
int main(){
ll n, a, b;
scanf("%lld%lld%lld", &n, &a, &b);
vector<ll> v(n);
for(ll &i : v)
scanf("%lld", &i);
ll ans = 1e18;
for(ll mk = 0; mk < (1ll<<n); ++mk){
ll sm = 0, cur = 0, x = 1;
for(ll i = 0; i < n; ++i){
sm += v[i];
if(mk>>i&1)
cur |= sm, sm = 0, x++;
}
cur |= sm;
if(a <= x and x <= b)
ans = min(ans, cur);
}
printf("%lld", 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... |