# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
375523 | ritul_kr_singh | One-Way Streets (CEOI17_oneway) | C++17 | 147 ms | 22248 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;
//#define int long long
#define sp << " " <<
#define nl << "\n"
vector<vector<pair<int, int>>> g0, g1;
vector<int> id, low, dfsNum, st;
int dfsTimer = 1;
void tarjan(int u, int parentEdge){
dfsNum[u] = low[u] = dfsTimer++;
st.push_back(u);
for(auto e : g0[u]){
if(e.second==parentEdge) continue;
if(!dfsNum[e.first]) tarjan(e.first, e.second);
low[u] = min(low[u], low[e.first]);
}
if(low[u]==dfsNum[u]){
int v = -1;
while(v!=u){
v = st.back(); st.pop_back();
id[v] = u;
}
}
}
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... |