Submission #65150

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
651502018-08-06 18:37:40VahanSplit the sequence (APIO14_sequence)C++17
39 / 100
1321 ms132096 KiB
#include<iostream>
#include<deque>
#include<fstream>
using namespace std;
ifstream fin("./sequence/43");
long long d[100007][201],n,k,a[200000],A[200000];
long long i,j,cur;
deque<pair<long long,long long> > q;
bool bad(pair<long long,long long> x, pair<long long,long long> y, pair<long long,long long> z) {
long long p1=(y.first-z.first) * (y.second-x.second);
long long p2=(x.first-y.first) * (z.second-y.second);
return p1>=p2;
}
void addline(pair<long long,long long> x)
{
long long r=q.size()-1;
if(q.size()>=2 && bad(q[r-1],q[r],x))
{
q.pop_back();
r--;
}
q.push_back(x);
}
void setcur(long long x)
{
long long u=q.size()-1;
if (cur > u)
cur = u;
while (cur<u && q[cur + 1].first * x + q[cur + 1].second>=q[cur].first * x + q[cur].second)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...