# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
35170 | cheater2k | Bali Sculptures (APIO15_sculpture) | C++14 | 186 ms | 2212 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;
const int N = 2005;
int n, A, B;
long long a[N];
long long OR;
// ------------------------------------------------
bool dp[110][110];
bool check(int x) {
memset(dp, 0, sizeof dp);
long long t = (OR >> x);
dp[0][0] = 1;
for (int i = 1; i <= n; ++i) {
for (int gr = 1; gr <= B; ++gr) {
for (int j = 0; j < i; ++j) {
long long cur = ((a[i] - a[j]) >> x);
if ((t & cur) == cur) dp[i][gr] = max(dp[i][gr], dp[j][gr-1]);
}
}
}
for (int gr = A; gr <= B; ++gr) if (dp[n][gr]) return true;
return false;
}
void solve() {
for (int i = 49; i >= 0; --i) {
# | 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... |