Submission #13128

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
131282015-01-31 14:32:57gs14004관광지 (IZhO14_shymbulak)C++14
0 / 100
1500 ms20704 KiB
#include <cstdio>
#include <vector>
#include <algorithm>
#include <deque>
#include <utility>
#include <queue>
using namespace std;
typedef pair<int,int> pi;
int n;
vector<int> graph[200005];
int low[200005], dfn[200005], piv;
int is_cyc[200005];
void dfs(int x, int pa){
low[x] = dfn[x] = ++piv;
for (int i=0; i<graph[x].size(); i++) {
if(graph[x][i] == pa) continue;
if(dfn[graph[x][i]]){
is_cyc[graph[x][i]] = 1;
low[x] = min(low[x],dfn[graph[x][i]]);
}
else{
dfs(graph[x][i],x);
low[x] = min(low[x],low[graph[x][i]]);
}
}
if(low[x] < dfn[x]) is_cyc[x] = 1;
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...