# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
43253 | hatuank97lhp | Bali Sculptures (APIO15_sculpture) | C++14 | 97 ms | 752 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 LL long long
using namespace std;
const int N = 2005;
LL n,sum[N], a,b,x, dp[N] ;
bool ok1( LL Mask ) {
memset(dp,0,sizeof(dp));
for(int i = 1; i <= n; ++ i) {
dp[i] = b + 1;
for(int j = 0; j < i; ++ j) {
if( ((sum[i] - sum[j]) & ~Mask) == 0 ) {
dp[i] = min( dp[i], dp[j] + 1 );
}
}
}
if( dp[n] <= b ) return 1;
return 0;
}
bool dp2[105][105];
bool ok2(LL Mask) {
memset(dp2,0,sizeof(dp2));
dp2[0][0] = 1;
for(int i = 1; i <= n; ++ i) {
for(int j = 1; j <= b; ++ j) {
for(int k = 0; k < i; ++ k){
if(dp2[k][j - 1] && ((sum[i] - sum[k]) & ~Mask) == 0) {
# | 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... |