hiho week 53 register

Ended

Participants:396

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-04 21:48:48

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<stdio.h>
#define NMAX 20010
#define MMAX 100010
bool visitor[NMAX];
int low[NMAX],dfn[NMAX],parent[NMAX];
int head[NMAX],headq[NMAX];
int paths[MMAX<<1][4];//to,nextno,same,flag
int waitqueue[NMAX];
int N,M;
int p,id,q;
int res[NMAX],num;
char ch;void F(int &aa)
{
    aa=0;
    while(ch=getchar(),(ch<'0'||ch>'9')&&(ch!='-'));
    while(ch>='0'&&ch<='9') {aa=(aa<<3)+(aa<<1)+ch-'0';ch=getchar();}
}
void AddPath(int u,int v)
{
    paths[++p][0]=v;
    paths[p][1]=head[u];
    paths[p][2]=p+1;
    head[u]=p;
    
    paths[++p][0]=u;
    paths[p][1]=head[v];
    paths[p][2]=p-1;
    head[v]=p;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX