# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
498475 | Nalrimet | Split the sequence (APIO14_sequence) | C++17 | 69 ms | 131076 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;
//#define int long long
#define ll long long
#define ld long double
#define pb push_back
#define S second
#define F first
//const int inf = 1e18;
const int N = 100005;
const ll inf = 1e18;
int n, y, k, par[N][205], k1, ind;
ll a[N], b[N], pref[N], suma, dp[N][205];
bool cut[N][205], used[N];
vector<int> ans;
ll f(int i, int j, int m){
// if(dp[m][j - 1] == -inf) return -inf;
// cout << i << ' ' << j << ' ' << m << '\n';
// cout << dp[m][j - 1] << ' ' << (pref[i] - pref[m]) << ' ' << (pref[n] - pref[i]) << '\n';
return dp[m][j - 1] + (pref[i] - pref[m]) * (pref[n] - pref[i]);
//
// (a - b) * (c - a)
// ac-a^2-bc+ab
// -(a * a) + (ab)
// a(b-a)
// pref[n] *
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... |