# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1273035 | DeathIsAwe | Bali Sculptures (APIO15_sculpture) | C++20 | 0 ms | 0 KiB |
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define ll long long
ll dp1[2000][2000], arr[2000], n, a, b;
ll powfunc(int a) {
ll val = 1;
for (int i=0;i<a;i++) {
val *= 2;
}
return val;
}
bool solve(ll val) {
if (a != 1) {
} else {
ll limit = 0, groups = 1, sum = 0;
bool ans;
while (limit != n) {
sum = 0;
ans = false;
for (int i=limit;i<n;i++) {
sum += arr[i];
if ((sum & val) == sum) {
limit = i + 1;
ans = true;
}
}
if (!ans) return false;
groups += 1;
}
if (groups > b + 1) return false;
return true;
}
}