| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1305489 | ElayV13 | Bali Sculptures (APIO15_sculpture) | C++20 | 1 ms | 576 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e18;
signed main(){
int n , l , r;
cin >> n >> l >> r;
vector < int > a(n);
for(int &i : a) cin >> i;
int res = INF;
for(int bit = 0;bit < (1 << n);bit++)
{
int cur_s = 0 , cur_res = 0 , tot = 1;
for(int i = 0;i < n;i++)
{
cur_s += a[i];
if((1 << i) & bit)
{
cur_res |= cur_s;
if(i != n - 1)
++tot;
cur_s = 0;
}
}
cur_res |= cur_s;
if(tot < l or tot > r) break;
res = min(res , cur_res);
}
cout << res << endl;
}
| # | 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... | ||||
