# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
465768 | koioi.org-dennisstar | Road Construction (JOI21_road_construction) | C++17 | 2288 ms | 812196 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 all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
struct node {
int l, r;
pair<ll, int> v;
node() : l(0), r(0), v(1e18, 0) {}
}nd[1<<25];
int nc;
void upd(int i, int i_, int s, int e, int t, ll v) {
if (s==e) {
nd[i].v={v, s};
return ;
}
int m=(s+e)/2;
if (t<=m) {
nd[i].l=++nc;
nd[i].r=nd[i_].r;
upd(nc, nd[i_].l, s, m, t, v);
}else {
nd[i].l=nd[i_].l;
nd[i].r=++nc;
upd(nc, nd[i_].r, m+1, e, t, v);
}
nd[i].v=min(nd[nd[i].l].v, nd[nd[i].r].v);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |