hiho week 38 register

Ended

Participants:420

Verdict:Accepted
Score:100 / 100
Submitted:2015-03-23 10:31:35

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 <limits.h>
#include <memory.h>
#include <queue>
using namespace std;
#define MAXN 10005
#define MAXM 200010
#define MIN(a,b) ((a)<(b)?(a):(b))
#define MAX(a,b) ((a)>(b)?(a):(b))
int U[MAXM], V[MAXM], W[MAXM];
int gfirst[MAXN];
int gnext[MAXM];
bool vis[MAXN];
int bfs(int st, int T, int C, int K) {
    queue<pair<int,int> > Q;
    Q.push(make_pair(st, 0));
    vis[st] = true;
    while(!Q.empty()) {
        int u = Q.front().first;
        int k = Q.front().second;
        Q.pop();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX