当前位置 : 主页 > 编程语言 > java >

算法5

来源:互联网 收集:自由互联 发布时间:2021-06-28
奇妙 package com.company;import java.util.Scanner;public class Main { static int[][] next = new int[][]{{0,1},{1,0},{0,-1},{-1,0}}; static int[][] len = new int[101][101]; static int[][] a = new int[101][101]; static int m,n; public stati
奇妙
package com.company;

import java.util.Scanner;

public class Main {
    static int[][] next = new int[][]{{0,1},{1,0},{0,-1},{-1,0}};
    static int[][] len = new int[101][101];
    static int[][] a = new int[101][101];
    static int m,n;
    public static void main(String[] args){
        int i,j,Max;
        setZero(a);
        setZero(len);
        Scanner scan = new Scanner(System.in);
        m = scan.nextInt();
        n = scan.nextInt();
        scan.nextLine();


        for(i=0; i
 
  m-1||ty>n-1)
                continue;
            if(a[tx][ty]
 
网友评论