# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
102904 | beobeo | Split the sequence (APIO14_sequence) | C++14 | 1268 ms | 83568 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.
/* Problem URL: https://oj.uz/problem/view/APIO14_sequence
Tags: dp, convex hull optimization */
#include <iostream>
#include <vector>
#include <deque>
#include <stack>
#include <algorithm>
using namespace std;
const int N = 100005;
long long a[N];
struct Line {
long long a, b;
int idx;
long long GetCost(long long x) {
return a * (x - a) + b;
}
long long To(Line& rhs) {
long long lo = max(a, rhs.a);
long long hi = 1LL << 60;
while (lo < hi) {
long long mid = (lo + hi) / 2;
long long v1 = GetCost(mid);
# | 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... |