hiho week 185 register

Ended

Participants:167

Verdict:Accepted
Score:100 / 100
Submitted:2018-01-14 00:17:44

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 <bits/stdc++.h>
using namespace std;
int MAP[505][505],vis[505][505];
int x[505],y[505],n,m;
int mx[] = {0,0,1,-1};
int my[] = {1,-1,0,0};
struct Node
{
    int x,y,p;
};
bool operator < (Node s,Node b)
{
    return s.p > b.p;
}
int bfs(int sx,int sy,int ex,int ey)
{
    memset(vis,0,sizeof(vis));
    priority_queue<Node>q;
    while(!q.empty())
        q.pop();
    Node s;
    s.x = sx;
    s.y = sy;
    s.p = 0;
    vis[sx][sy] = 1;
    q.push(s);
    while(!q.empty())
    {
        Node a = q.top();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX