# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
248481 | WhipppedCream | Split the sequence (APIO14_sequence) | C++17 | 1397 ms | 123004 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 ii pair<int, int>
#define X first
#define Y second
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vii vector< pair<int, int> >
typedef long long ll;
using namespace std;
int A[100005];
ll B[100005];
ll sum(int a, int b)
{
return B[b] - B[a-1];
}
ll dp[2][100005];
int opt[205][100005];
void solve(int k, int L, int R, int i, int j)
{
if(L> R) return;
int M = (L+R)/2;
ll best = -1e9;
int add = 0;
//printf("dp[%d][%d]:\n", k, M);
for(int p = max(i, 2); p<= min(j, M); p++)
{
ll here = dp[1-k%2][p-1] + sum(1, p-1)*sum(p, M);
//printf("p = %d %lld %lld = %lld\n", p, dp[k-1][p-1], sum(1, p-1)*sum(p, M), here);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |