# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
137073 | thebes | One-Way Streets (CEOI17_oneway) | C++14 | 235 ms | 31420 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 MN = 1e5+5, LG = 19;
int N, M, Q, S, i, x, y, vis[MN][2], sp[MN][LG], cmp[MN], st[MN], nxt, ans[MN], u[MN], d[MN], dep[MN], cnt, vs[MN];
vector<pair<int,int>> adj[MN], cadj[MN];
stack<int> s;
pair<int,int> ree[MN];
string ans2;
void dfs(int n,int id){
vis[n][0]=vis[n][1]=++nxt;
st[n]=1; s.push(n);
for(auto v : adj[n]){
if(v.second==id) continue;
if(!vis[v.first][0]){
dfs(v.first, v.second);
vis[n][1]=min(vis[n][1],vis[v.first][1]);
}
else if(st[v.first]){
vis[n][1]=min(vis[n][1],vis[v.first][0]);
}
}
if(vis[n][0]==vis[n][1]){
S++;
while(s.size()&&s.top()!=n){
int x = s.top(); s.pop();
cmp[x] = S; st[x] = 0;
}
int x = s.top(); s.pop();
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... |