走迷宫的贪心题
import java.io.IOException; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); String ssss = sc.nextLine(); char arr[][] = new char[n][m]; int sum = n * m - n - m + 1; //所有路线 for(int i = 0;i < n;i++){ String s = sc.nextLine(); for (int j = 0; j < m; j++) { arr[i][j] = s.charAt(j); if(arr[i][j] == '#')sum--; } } if(sum % 2 == 1){ System.out.println("niuniu"); }else System.out.println("niumei"); } }