# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
49306 | tmwilliamlin168 | Building Bridges (CEOI17_building) | C++14 | 102 ms | 47556 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll, ll>
#define fi first
#define se second
const int mxN=1e5, mxH=1e6, sts=1<<21;
int n;
ll h[mxN], pw[mxN+1];
pll st[sts];
void upd(pll nl, int i=1, int l=0, int r=mxH) {
// if(i==1)
// cout << nl.fi << " " << nl.se << endl;
int m=(l+r)/2;
if(nl.fi*m+nl.se<st[i].fi*m+st[i].se)
swap(nl, st[i]);
if(l==r)
return;
if(nl.fi*l+nl.se<st[i].fi*l+st[i].se)
upd(nl, 2*i, l, m);
else
upd(nl, 2*i+1, m+1, r);
}
ll qry(int x, int i=1, int l=0, int r=mxH) {
int m=(l+r)/2;
ll s=st[i].fi*x+st[i].se;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |