hiho week 115 register

Ended

Participants:333

Verdict:Accepted
Score:100 / 100
Submitted:2016-09-14 15:00:57

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 <map>
#include <set>
#include <queue>
#include <cmath>
#include <ctime>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn = 500 + 10;
const int inf = 1000000;
int test, n, m, d[maxn], itr[maxn];
int c[maxn][maxn];
int que[maxn], head, tail;
bool find(int s, int t)
{
    memset(d, -1, sizeof(d));
    head = tail = 0;
    que[tail ++] = s;
    d[s] = 0;
    while (head < tail) {
        int i = que[head ++];
        for (int j = 1; j <= n; j ++)
        if (c[i][j] > 0 && d[j] == -1) {
            d[j] = d[i] + 1;
            que[tail ++] = j;
        }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX