hiho week 66 register

Ended

Participants:488

Verdict:Accepted
Score:100 / 100
Submitted:2015-10-08 13:06:20

Lang:Java

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
import java.util.LinkedList;
import java.util.Scanner;
public class Main
{
    public static void main(String args[])
    {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt() , m = scan.nextInt();
        char map[][] = new char[n][m];
        int sx = -1 , sy = -1;
        for (int i = 0 ; i < n ; i++)
        {
            String s = scan.next();
            map[i= s.toCharArray();
            for (int j = 0 ; j < m ; j++)
                if (map[i][j== 'H')
                {
                    sx = i;
                    sy = j;
                }
        }
        
        int dis[][] = new int[n][m];
        for (int i = 0 ; i < n ; i++)
            for (int j = 0 ; j < m ; j++)
                dis[i][j= 10001;      
        
        dis[sx][sy= 0;
        LinkedList<Integer> bfs = new LinkedList<Integer>();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX