hiho week 320 register

Ended

Participants:37

Verdict:Accepted
Score:100 / 100
Submitted:2020-08-22 00:32:14

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.HashMap;
import java.util.LinkedList;
import java.util.Map;
import java.util.Scanner;
public class Main{
    static int[][] map;
    public static void main(String[] args) {
        Map hm = new HashMap();
        Scanner sc = new Scanner(System.in);
        int m = sc.nextInt();
        int n = sc.nextInt();
        int re=Integer.MAX_VALUE;
        map = new int[n][m];
        for(int j=0;j<m;j++){
            String s = sc.next();
            for(int i=0;i<n;i++){
                map[i][j]=Integer.valueOf(s.charAt(i));
            }
        }
        Node node = new Node(0,0,n-1,m-1);
        LinkedList<Node> list = new LinkedList();
        list.push(node);
        while(!list.isEmpty()){
            Node tmp = list.pop();
            int hash = tmp.xa*1000000+tmp.ya*10000+tmp.xb*100+tmp.yb;
            if((int)hm.getOrDefault(hash,Integer.MAX_VALUE)<=tmp.re){
                continue;
            }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX