# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
497863 | 2021-12-24T02:11:51 Z | amukkalir | Bali Sculptures (APIO15_sculpture) | C++17 | 0 ms | 0 KB |
ll f (int rem, int idx) { // if(idx==n+1) return (rem==0)?0:INF; // if(rem<=0) return INF; ll &res = dp[rem][idx]; if(~res) return res; if(rem == 1) return res = p[n] - p[idx-1]; res = INF; for(int i=idx; i<=n; i++) { res = min(res, (p[i]-p[idx-1]) | f(rem-1, i+1)); } return res; }