hiho week 55 register

Ended

Participants:378

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-21 22:01: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],nt[M],to[M],num=0;
void conn(int u,int v) {
    nt[num] = hd[u];
    to[num] = v;
    hd[u] = num++;
}
int dfn[N],low[N];
int id[M>>1],idn=0,stk[M>>1],stn=0;
void group(int top) {
    int r=M;
    for(int i = top; i < stn; i++) r = min(r,stk[i]);
    for(int i = top; i < stn; i++) id[stk[i]] = r;
    stn = top;
    idn++;
}
void tarjan(int u,int parent=-1) {
    static int count = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX