# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
795405 | Sami_Massah | LOSTIKS (INOI20_lostiks) | C++17 | 76 ms | 62164 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 = 1e6 + 12, lg = 21;
int n, st, en, h[maxn], pe[maxn], par[maxn][lg], kn[maxn], U[maxn], V[maxn];
vector <int> k[maxn], conn[maxn];
vector <int> pos, path, p1, p2, qe, d;
bitset <maxn> marked;
void dfs_set(int u){
marked[u] = 1;
for(int i = 0; i + 1 < lg; i++)
par[u][i + 1] = par[par[u][i]][i];
for(int e: conn[u]){
int v = u ^ U[e] ^ V[e];
// cout << v << endl;
if(!marked[v]){
// cout << u << "->" << v << endl;
h[v] = h[u] + 1;
par[v][0] = u;
pe[v] = e;
dfs_set(v);
}
}
}
int kpar(int u, int k){
for(int i = 0; i < k; i++)
if((k >> i) & 1)
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... |