# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
63156 | khsoo01 | Building Bridges (CEOI17_building) | C++11 | 206 ms | 17336 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 X first
#define Y second
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
const ll N = 100005, L = 18, inf = 1e18;
ll n, def, h[N], a[N], d[N];
ll val (pll &P, ll V) {return P.X*V+P.Y;}
bool valid (pll &A, pll &B, pll &C) {
return (B.Y-A.Y) * (B.X-C.X) < (C.Y-B.Y) * (A.X-B.X);
}
struct hull {
vector<pll> v;
void upd (pll P) {
for(ll i=v.size();i--;) {
if(v[i].X != P.X) break;
else v.pop_back();
}
for(ll i=v.size();i-->1;) {
if(valid(v[i-1], v[i], P)) break;
else v.pop_back();
}
v.push_back(P);
}
ll get (ll P) {
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... |