hiho week 55 register

Ended

Participants:378

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-21 20:31:18

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <iostream>
#include <algorithm>
#include <stack>
#include <unordered_map>
using namespace std;
const int _ = 20004, MAXM = 200005;
int Dfn[_], Low[_], Head[_];
int Next[MAXM], Edge[MAXM], Ans[MAXM], Dcg[MAXM];
stack<int> Sta;
unordered_map<int, int> Label;
void tarjan(int u, int p){
  static int cnt = 0;
  Dfn[u] = Low[u] = ++cnt;
  for(int e = Head[u]; e != 0; e = Next[e]){
    int num = (e + 1) / 2;
    int v = Edge[e];
    if(Dcg[num]){
      continue;
    }
    if(Dfn[v] == 0){
      Sta.push(num);
      tarjan(v, u);
      Low[u] = min(Low[u], Low[v]);
    }else if(v != p){
      Sta.push(num);
      Low[u] = min(Low[u], Dfn[v]);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX