| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1368495 | serendipitous | Bali Sculptures (APIO15_sculpture) | C++20 | 343 ms | 452 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0); cin.tie(0);
int n, a, b; cin >> n >> a >> b;
vector<int> y(n); for(int &yi: y) cin >> yi;
ll min_beauty = LLONG_MAX;
for(int S = (1 << (n-1)); S < (1 << n); ++S) {
ll beauty = 0;
int x = 0;
for(int i = 0; i < n; ++i) {
if((S & (1 << i))) ++x;
}
if(x < a || x > b) continue;
ll sum = 0;
for(int i = 0; i < n; ++i) {
sum += y[n-1-i];
if(S & (1 << i)) {
beauty = beauty | sum;
sum = 0;
}
}
// cout << "subset" << S << " with beauty" << beauty << "\n";
min_beauty = min(beauty, min_beauty);
}
cout << min_beauty;
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
