# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
340082 | wildturtle | One-Way Streets (CEOI17_oneway) | C++17 | 487 ms | 43376 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;
long long a,b,c,d,i,e,f,g,n,m,k,l,t,q;
long long disc[500005],low[500005],A[500005],B[500005],C[500005],D[500005],E[500005];
long long P[22][500005],br[500005],ans[500005],in[500005],out[500005];
vector < pair <long long , long long > > v[500005];
void dfs(long long x,long long y) {
t++;
disc[x]=t; low[x]=t;
for(long long i=0;i<v[x].size();i++) {
if(v[x][i].first==x) continue;
if(disc[v[x][i].first]==0) {
P[0][v[x][i].first]=x; D[v[x][i].first]=D[x]+1; E[v[x][i].first]=v[x][i].second;
dfs(v[x][i].first,x);
low[x]=min(low[x],low[v[x][i].first]);
if(low[v[x][i].first]>disc[x]) br[v[x][i].first]=1;
}
else {
if(P[0][v[x][i].first]==x) br[v[x][i].first]=0;
if(v[x][i].first!=P[0][x]) low[x]=min(low[x],disc[v[x][i].first]);
}
}
}
int LCA(int u, int v) {
if(D[u]<D[v]) swap(u, v);
for(int k = 18 - 1; ~k; k--)
if (D[P[k][u]]>=D[v]) u=P[k][u];
if(u==v) return u;
for (int k=18-1; ~k; k--)
if(P[k][u]!=P[k][v]) { u=P[k][u]; v=P[k][v]; }
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... |