# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
123841 | FutymyClone | Building Bridges (CEOI17_building) | C++14 | 135 ms | 66532 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;
const int maxn = 1e6 + 5;
int n, h[N], w[N];
long long dp[N], f[N];
struct Line {
int a;
long long b;
Line (int a = 0, long long b = inf): a(a), b(b) {}
long long f (int x) {
return 1LL * a * x + b;
}
} node[maxn << 2];
struct LiChaoTree {
void add (int i, int l, int r, Line val) {
if (node[i].f(l) >= val.f(l) && node[i].f(r) >= val.f(r)) {
node[i] = val;
return;
}
if (node[i].f(l) <= val.f(l) && node[i].f(r) <= val.f(r)) return;
int mid = l + r >> 1;
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... |