hiho week 119 register

Ended

Participants:2176

Verdict:Accepted
Score:100 / 100
Submitted:2016-10-08 22:01:38

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 <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
using namespace std;
const int Nmax = 402;
const int cmax = 0x7fffffff;
int deep[Nmax];
int c[Nmax][Nmax];
queue<int> Q;
int n, m, u, v, f;
int BFS() {
    int p;
    memset(deep, 0, sizeof(deep));
    Q.push(0);
    deep[0] = 1;
    while (!Q.empty()) {
        p = Q.front();
        Q.pop();
        for (int i = 1; i <= n+m+1; ++i) {
            if (!deep[i] && c[p][i]) {
                Q.push(i);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX