hiho week 52 register

Ended

Participants:214

Verdict:Accepted
Score:100 / 100
Submitted:2015-06-28 22:30:49

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 <cstring>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
#define N 20000
#define M 200000
int hd[N],to[M],nt[M],num=0,dfn[N],low[N],visit[N]={0},parent[N];
int edge[M>>1],point[N],ne=0,np=0;
void conn(int u,int v) {
    to[num] = v;
    nt[num] = hd[u];
    hd[u] = num++;
}
void dfs(int u) {
    static int counter = 0;
    int children = 0;
    dfn[u] = low[u] = ++counter;
    visit[u] = 1;
    for(int i = hd[u]; i>-1; i = nt[i]) {
        int v = to[i];
        if(!visit[v]) {
            children++;
            parent[v] = u;
            dfs(v);
            low[u] = min(low[u],low[v]);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX