hiho week 54 register

Ended

Participants:493

Verdict:Accepted
Score:100 / 100
Submitted:2015-07-13 17:24:31

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>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define N 20005
#define M 200005
#define MIN(a,b) ((a) < (b) ? (a) : (b))
#define MAX(a,b) ((a) > (b) ? (a) : (b))
int n,m,head[N],ne,dfn[N],low[N],cnt,fa[N],inStack[N],in[N],cntSCC;
ll val[N],new_val[N],dis[N];
struct Edge{
    int v,next;
}e[M];
void add_edge(int u,int v){
    e[ne].v=v,e[ne].next=head[u],head[u]=ne++;
}
stack<int> st;
void tarjan(int u){
    dfn[u] = low[u] = ++cnt;
    st.push(u);
    inStack[u] = 1;
    for(int i = head[u];i != -1;i = e[i].next){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX