# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
383055 | Nayna | Split the sequence (APIO14_sequence) | C++17 | 752 ms | 24736 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>
using namespace std;
typedef long long ll;
typedef pair<ll,ll>pii;
typedef pair<pii,pii>piii;
const int mxn = 1e4+5;
#define inf 1e16
#define all(v) v.begin(), v.end()
#define FAST ios_base::sync_with_stdio(0);cout.tie(0)
ll arr[mxn];
ll dp[mxn][205];
ll pre[mxn];
int dir[mxn][205];
int n, k;
ll solve(int pos, int x)
{
if(pos>n) {
return -inf;
}
if(x==k) return 0;
if(dp[pos][x]!=-1) return dp[pos][x];
ll sum = 0, ret = 0;
for(int i = pos; i < n; i++) {
sum+=arr[i];
ll tmp = max(ret, solve(i+1, x+1)+sum*pre[i+1]);
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |