# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
656391 | HaYoungJoon | Building Bridges (CEOI17_building) | C++14 | 2 ms | 340 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>
#define ll long long
using namespace std;
const ll INF = 1e18;
const int maxV = 1e6 + 1;
int n;
struct line {
ll A,B;
};
ll getVal(line X, ll y) {
return X.A*y + X.B;
}
line t[4*maxV];
void update(int v, int tl, int tr, line X) {
if (tl == tr) {
if (getVal(X,tl) < getVal(t[v],tl)) t[v] = X;
return;
}
int tm = (tl + tr)/2;
if (t[v].A < X.A) swap(t[v],X);
if (getVal(t[v],tm) > getVal(X,tm)) {
swap(t[v],X);
update(2*v,tl,tm,X);
} else {
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... |