hiho week 66 register

Ended

Participants:488

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-06 15:50:17

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<cstdio>
#include<vector>
#include<cstring>
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
//#define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#pragma warning(disable:3399)
#endif
int M,N;
char map[101][101];
int step[101] [101];
vector< pair<int, int> > seq;
int dir[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
bool InMap(int x,int y){
    if((x>=1&&x<=N&&y>=1&&y<=M)
    &&(map[x][y]=='S'||map[x][y]=='.'))
        return true;
    else
        return false;
}
void BFS(int startX, int startY){
    step[startX][startY]=0;
    seq.push_back(make_pair(startX,startY));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX