| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1358299 | kantaponz | Bali Sculptures (APIO15_sculpture) | C++20 | 0 ms | 344 KiB |
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll inf = INT_MAX;
const int nx = 2005;
ll n, a, b, qs[nx];
int main() {
ios_base::sync_with_stdio(0), cin.tie(0);
ll l = 0, r = (1 << 30) - 1;
cin >> n >> a >> b;
for (int i = 1; i <= n; i++) {
cin >> qs[i];
qs[i] += qs[i - 1];
}
while (l < r) {
ll mid = (l + r) / 2;
bool dp[n + 2];
memset(dp, 0, sizeof dp);
dp[0] = 1;
for (int j = 0; j <= n; j++) {
for (int i = j + 1; i <= n; i++) {
ll val = qs[i] - qs[j];
if (!dp[j] || (val | mid) != mid) continue;
dp[i] = 1;
}
}
if (dp[n]) r = mid;
else l = mid + 1;
}
cout << l;
}| # | 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... | ||||
