# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
123828 | FutymyClone | Building Bridges (CEOI17_building) | C++14 | 95 ms | 2936 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 N = 1e5 + 5;
const long long inf = 1LL << 62;
int n, h[N], w[N];
long long dp[N], f[N];
class ConvexHullTrick {
struct line {
long long m, b, value;
double xlo;
bool is_query, query_max;
line(long long m, long long b, long long v, bool is_query, bool query_max)
: m(m), b(b), value(v), xlo(-std::numeric_limits<double>::max()),
is_query(is_query), query_max(query_max) {}
double intersect(const line &l) const {
if (m == l.m) return std::numeric_limits<double>::max();
return (double)(l.b - b)/(m - l.m);
}
bool operator<(const line &l) const {
if (l.is_query) return query_max ? (xlo < l.value) : (l.value < xlo);
return m < l.m;
}
};
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... |