hiho week 52 register

Ended

Participants:214

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-01 22:10:55

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 <cstdio>
#include <cstring>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
int n,m,head[20005],cnt=0;
int low[20005],dfn[20005],c=0;
struct edge
{
    int n,t;
    edge(int a=0,int b=0):n(a),t(b){}
}e[200005];
inline void ins(int a,int b)
{
    e[cnt]=edge(head[a],b);
    head[a]=cnt++;
}
vector<int> ans1;
vector< pair<int,int> > ans2;
void dfs(int u,int p)
{
    ++c;
    dfn[u]=low[u]=c;
    int i,v,child=0;
    bool f=0;
    for(i=head[u];i!=-1;i=e[i].n)
    {
        v=e[i].t;
        if(v==p)continue;
        if(!dfn[v])
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX