# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
197945 | songc | Split the sequence (APIO14_sequence) | C++14 | 344 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;
typedef long long LL;
typedef pair<LL,LL> pii;
int N, K;
LL S[101010];
int P[101010][220];
struct Line{
LL m, k;
int id;
};
bool popchk(Line a, Line b, Line c){
return ((__int128)b.k-c.k)*(b.m-a.m) <= ((__int128)a.k-b.k)*(c.m-b.m);
}
struct ConvHull{
vector<Line> V;
int p;
void push(Line l){
if (!V.empty() && V.back().m == l.m) return;
while (V.size()>2 && popchk(V[V.size()-2], V.back(), l)){
V.pop_back();
if (V.size() <= p) p--;
}
V.push_back(l);
}
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... |