hiho week 66 register

Ended

Participants:488

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-06 13:03:48

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 <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <queue>
using namespace std;
char g[101][101];
int N,M,startX,startY,step[101][101];
int dri[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
bool flag;
typedef struct {
        int x;
        int y;
        }Node;
queue<Node> q;
void dfs(){
    Node a,s;
    int x,y;
    memset(step,-1,sizeof(step));
    a.x=startX;
    a.y=startY;
    step[a.x][a.y]=0;
    q.push(a);
    while(!q.empty()){
        s=q.front();
        q.pop();
        if(g[s.x][s.y]=='.'||g[s.x][s.y]=='H'){
        for(int i=0;i<4;i++){
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX