# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1050777 | manhlinh1501 | Bali Sculptures (APIO15_sculpture) | C++17 | 211 ms | 71000 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;
using i64 = long long;
const i64 oo64 = LLONG_MAX;
const int MAXN = 2050;
int N, L, R;
int a[MAXN];
i64 ans = oo64;
namespace subtask1 {
bool is_subtask() {
return N <= 20;
}
void solution() {
if(is_subtask() == false) return;
for(int mask = 0; mask < (1 << N); mask++) {
vector<i64> b;
b.emplace_back(0);
int cb = (mask >> 0 & 1);
for(int i = 0; i < N; i++) {
if((mask >> i & 1) == cb)
b.back() += a[i + 1];
else {
b.emplace_back(a[i + 1]);
cb ^= 1;
}
}
i64 res = 0;
for(i64 x : b) res |= x;
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... |