# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
944832 | phoenix0423 | Tourism (JOI23_tourism) | C++17 | 5040 ms | 36688 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;
typedef long long ll;
typedef pair<ll, ll> pll;
#define fastio ios::sync_with_stdio(false), cin.tie(0);
#pragma GCC optimize("Ofast","unroll-loops")
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#define int long long
#define lowbit(x) x&-x
const int maxn = 2e5 + 5;
const int INF = 1e9 + 7;
int n, m, q;
vector<int> adj[maxn];
int dep[maxn], in[maxn], dfn = 0;
int succ[maxn][18];
int id[maxn];
void dfs(int pos, int prev){
succ[pos][0] = prev;
for(int i = 1; i < 18; i++) succ[pos][i] = succ[succ[pos][i - 1]][i - 1];
in[pos] = ++dfn;
id[dfn] = pos;
for(auto x : adj[pos]){
if(x == prev) continue;
dep[x] = dep[pos] + 1;
dfs(x, pos);
}
# | 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... |