# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
552599 | QwertyPi | Bali Sculptures (APIO15_sculpture) | C++14 | 73 ms | 95012 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>
#define int long long
#define INF (1LL << 60)
using namespace std;
const int N = 2001;
int dp[N][N], dp2[N];
int s[N], A[N];
vector<int> vals[N][N];
typedef uint32_t uint;
bool valid[N][N];
int n, a, b;
bool check(int mask){
for(int i = 0; i < n; i++){
for(int j = i; j < n; j++){
int v = s[j + 1] - s[i];
valid[i][j] = (v | mask) == mask;
}
}
if(n > 100){
fill(dp2 + 1, dp2 + n + 1, INF);
for(int i = 0; i < n; i++){
for(int j = 0; j <= i; j++){
dp2[i + 1] = min(dp2[i + 1], dp2[j] + valid[j][i]);
}
}
return dp2[n] <= b;
}else{
for(int i = 0; i <= n; i++){
for(int j = 0; j <= n; j++){
dp[i][j] = false;
# | 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... |