# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
320010 | jungsnow | Building Bridges (CEOI17_building) | C++14 | 50 ms | 5348 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;
using ll = long long;
const int maxm = 1e6 + 1;
const int maxn = 100001;
const ll oo = 1e18;
struct line {
ll a, b;
line () {}
line (ll a, ll b) : a(a), b(b) {}
ll get(ll x) {
return a * x + b;
}
} it[4 * maxm];
struct lichaotree {
#define m ((l + r) >> 1)
void init() {
for (int i = 0; i < 4 * maxm; ++i) it[i].a = 0, it[i].b = oo;
}
void insert(int node, int l, int r, line u) {
bool lef = u.get(l) < it[node].get(l);
bool mid = u.get(m) < it[node].get(m);
if (mid) swap(u, it[node]);
if (l == r) return;
if (lef != mid) insert(node << 1, l, m, u);
else insert(node << 1 | 1, m + 1, r, u);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |