# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
569750 | erto | Regions (IOI09_regions) | C++17 | 3864 ms | 80872 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>
typedef long long int ll;
#define INF (1e9 + 7)
#define INF2 (998244353)
#define N (ll)2e5 + 5
using namespace std;
//#define int ll
int n, g, h, t1, t2, cur = 1, q, R;
int d[N], st[N], en[N], par[N][20], r[N];
vector<int> v[N], sts[N], ens[N], r2[N];
map<int, int> m[N];
void dfs(int x, int p){
st[x] = cur++;
sts[r[x]].push_back(cur - 1);
r2[r[x]].push_back(x);
par[x][0] = p;
for(int i = 1; i<=20; i++){
par[x][i] = par[par[x][i - 1]][i - 1];
}
for(auto u : v[x]){
if(u != p)dfs(u, x);
}
en[x] = cur++;
ens[r[x]].push_back(cur - 1);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |