# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
155052 | aer0park | Split the sequence (APIO14_sequence) | C++14 | 2028 ms | 85368 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 f first
#define s second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
ll cnt,sz,n,k,p[100006],dp[100002][5];
int sv[100002][202],st[100005],v[100006];
vector<int> anw;
double get(ll a,ll b,ll q)
{
a=st[a],b=st[b];
if(p[a]==p[b]) return -1e15;
return (double)(p[b]*p[b]-p[a]*p[a]+dp[a][q%2]-dp[b][q%2])/(double)(p[b]-p[a]);
}
void push(ll x,ll d)
{
st[sz]=x;
while(sz>=2&&get(sz,sz-1,d)<get(sz-1,sz-2,d))
sz--,st[sz]=x;
sz++;
}
ll val(ll x,ll d)
{
# | 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... |