hiho week 185 register

Ended

Participants:167

Verdict:Accepted
Score:100 / 100
Submitted:2018-01-20 18:40: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<cstring>
#include<queue>
using namespace std;
int n, m;
int a[505];
int b[505];
bool barrier[505][505] = { false };
bool visit[505][505];
int dis[505][505];
struct point
{
    int x;
    int y;
    point(int a, int b)
    {
        x = a;
        y = b;
    }
};
int bfs(int sx, int sy, int tx, int ty)
{
    queue<point>q;
    q.push(point(sx, sy));
    visit[sx][sy] = true;
    dis[sx][sy] = 0;
    while (!q.empty())
    {
        point t = q.front();
        q.pop();
        int x = t.x;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX