# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
32107 | minimario | Split the sequence (APIO14_sequence) | C++14 | 549 ms | 113120 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;
const int MAX = 1<<17;
typedef long long ll;
typedef pair<ll, ll> pll;
#define f first
#define s second
pll line[MAX];
int orig[MAX];
int ct = 0;
int ptr = 0;
bool bad(pll l0, pll l1, pll l2) {
return (l1.s-l0.s)*(l0.f-l2.f) >= (l0.f-l1.f)*(l2.s-l0.s);
}
ll f(pll l, ll x) {
return l.f * x + l.s;
}
void add(pll l, int i) {
while (ct >= 2 && ptr < ct && bad(line[ct-1], line[ct], l)) {
ct--;
}
ptr = min(ptr, ct);
ct++;
line[ct] = 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... |