# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
995519 | abczz | Construction of Highway (JOI18_construction) | C++17 | 1036 ms | 37432 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 <iostream>
#include <vector>
#include <array>
#include <algorithm>
#define ll long long
using namespace std;
vector <ll> adj[100000];
array <ll, 2> edge[100000];
vector <ll> dfn;
vector <array<ll, 2>> V;
array <ll, 2> R[100000];
ll n, a, b, x, l, r, d, t, f, C[100000], D[100000], T[100000], bl[100000][17];
struct SegTree{
vector <ll> st{vector <ll>(400000, 0)};
void update(ll id, ll l, ll r, ll q) {
if (l == r) {
st[id] = T[dfn[l]];
return;
}
ll mid = (l+r)/2;
if (q <= mid) update(id*2, l, mid, q);
else update(id*2+1, mid+1, r, q);
st[id] = max(st[id*2], st[id*2+1]);
}
ll query(ll id, ll l, ll r, ll ql, ll qr) {
if (qr < l || r < ql) return -1e18;
else if (ql <= l && r <= qr) return st[id];
ll mid = (l+r)/2;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |