hiho week 66 register

Ended

Participants:488

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-05 14:29:16

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 gox[4]={0,0,1,-1};
int goy[4]={1,-1,0,0};
struct point
{
    int x,y;
    int t;
    point (int _x=0,int _y=0,int _t=0)
    {
        x=_x;
        y=_y;
        t=_t;
    }
};
char maze[105][105];
int step[105][105];
queue<point>q;
void bfs(int x,int y)
{
    while (!q.empty())q.pop();
    q.push(point(x,y,0));
    step[x][y]=0;
    while (!q.empty())
    {
        point p=q.front();q.pop();
        for (int i=0;i<4;i++)
        {
            x=p.x+gox[i];
            y=p.y+goy[i];
            if (maze[x][y]=='.'&&step[x][y]==-1)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX