# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
566189 | shahriarkhan | One-Way Streets (CEOI17_oneway) | C++14 | 2 ms | 2644 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 ;
//1 = L
//2 = B
//3 = R
const int MX = 1e5 + 5 , LG = 25 ;
int bridge[MX] , par[MX] , up[MX][LG] , vis[MX] , depth[MX] , ans[MX] , low[MX] , tin[MX] , tout[MX] , timer = 0 , sub[MX] ;
vector<pair<int,int> > adj[MX] , edges ;
void dfs(int s , int p)
{
if(vis[s]) return ;
up[s][0] = p , par[s] = p , vis[s] = 1 , depth[s] = depth[p] + 1 , tin[s] = ++timer , low[s] = tin[s] ;
for(int i = 1 ; i < LG ; ++i)
{
up[s][i] = up[up[s][i-1]][i-1] ;
}
for(pair<int,int> t : adj[s])
{
if(t.first==p) continue ;
if(vis[t.first]) low[s] = min(low[s],tin[t.first]) ;
else
{
dfs(t.first,s) ;
low[s] = min(low[s],low[t.first]) ;
if(low[t.first]>tin[s]) bridge[t.second] = 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... |