# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
308032 | avengers | Split the sequence (APIO14_sequence) | C++14 | 15 ms | 7808 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;
using ll=long long int;
typedef struct Line{
ll p, q;
}line;
int n, k;
ll a[100005];
ll s[100005]={};
int track[205][100005];
line cht[100005];
ll sz=0;
ll now=0;
double cx(line a, line b)
{
return 1.0*(double)(b.q-a.q)/(a.p-b.p);
}
void insert(line v)
{
cht[sz]=v;
while(sz>1&&cx(cht[sz-2], cht[sz-1])>cx(cht[sz], cht[sz-1]))
{
cht[sz-1]=cht[sz];
sz--;
}
sz++;
}
pair <ll, ll> sol(ll x)
{
while(now<sz-1&&cx(cht[now], cht[now+1])<=x) now++;
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... |