# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
552599 | QwertyPi | Bali Sculptures (APIO15_sculpture) | C++14 | 73 ms | 95012 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |