# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
35491 | imaxblue | One-Way Streets (CEOI17_oneway) | C++14 | 769 ms | 44788 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 <iostream>
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int, int>
#define pb push_back
#define x first
#define y second
#define lb lower_bound
#define mp make_pair
int n, m, p, com[100005], pre[100005], num[100005], c, a, b;
int par[20][100005], d[100005], one[100005], dir[100005];
vector<pii> st[100005];
vector<pii> v[100005], w[100005];
vector<int> vis;
void dfs(int N, int P){
if (num[N]!=0) return;
num[N]=(pre[N]=++c);
//if (num[N]==1) exit(2);
vis.pb(N);
for (int l=0; l<v[N].size(); ++l){
if (v[N][l].x==P) {P=-1; continue;}
dfs(v[N][l].x, N);
pre[N]=min(pre[N], pre[v[N][l].x]);
}
if (pre[N]==num[N]){
int t=-1;
do{
t=vis.back(); vis.pop_back();
com[t]=N;
//cout << N << ' ' << t << endl;
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... |