# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
92092 | maruii | Construction of Highway (JOI18_construction) | C++17 | 799 ms | 22204 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>
using namespace std;
const int MAXN = 1000001;
const int SIZE = 1<<17;
#define ff first
#define ss second
int A[MAXN], B[MAXN], C[MAXN], dth[MAXN], prt[17][MAXN], dfn[MAXN], edfn[MAXN], dfnn;
vector<int> edge[100001];
void dfs(int x){
dfn[x] = ++dfnn;
for(auto &i: edge[x]){
prt[0][i] = x;
dth[i] = dth[x]+1;
dfs(i);
}
edfn[x] = dfnn;
}
struct ST{
int data[2*SIZE];
void update(int x, int v){
for(x+=SIZE; x; x>>=1)
data[x] = max(data[x], v);
}
int query(int s, int e){
int ret = 0;
for(s+=SIZE, e+=SIZE; s<=e; s>>=1, e>>=1){
if(s&1) ret = max(ret, data[s++]);
if(~e&1) ret = max(ret, data[e--]);
}
return ret;
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... |