# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
213600 | MKopchev | Railway (BOI17_railway) | C++14 | 189 ms | 25332 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 nmax=1e5+42;
int n,m,k;
pair<int,int> edges[nmax];
vector<int> adj[nmax];
int SZ,want[nmax];
int in[nmax],out[nmax],t=0;
int up[20][nmax],height[nmax];
int lca(int u,int v)
{
if(height[u]<height[v])swap(u,v);
for(int st=19;st>=0;st--)
if(height[u]-(1<<st)>=height[v])u=up[st][u];
if(u==v)return u;
for(int st=19;st>=0;st--)
if(up[st][u]!=up[st][v])u=up[st][u],v=up[st][v];
return up[0][u];
}
void dfs(int node,int parent)
{
up[0][node]=parent;
t++;
in[node]=t;
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |