# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
368405 | cpp219 | Bali Sculptures (APIO15_sculpture) | C++14 | 256 ms | 32256 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
#define ld long double
#define fs first
#define sc second
using namespace std;
const ll N = 2e3 + 9;
const ll inf = 1e16 + 7;
typedef pair<int,int> LL;
ll n,a[N],A,B,sum,dp[N][N],b[N],ans = (1ll << 45) - 1;
ll dp1[N],mask;
ll f(ll pos,ll grp){
if (pos > n){
if (A <= grp&&grp <= B) return 1;
return 0;
}
if (dp[pos][grp] != -1) return dp[pos][grp];
ll ans = 0;
for (ll i = pos;i <= n;i++){
ll p = b[i] - b[pos - 1];
if ((mask | p) == mask) ans = max(ans,f(i + 1,grp + 1));
}
return dp[pos][grp] = ans;
}
void Sub4(){
for (ll i = 44;i >= 0;i--){
memset(dp,-1,sizeof(dp)); mask = ans - (1ll << i);
//cout<<f(1,0)<<" x "<<mask<<"\n"; //exit(0);
Compilation message (stderr)
# | 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... |