Lang:Java
Edit12345678910111213141516171819202122232425262728293031import java.util.*;public class Main {private final static class Point{public int x;public int y;public Point(int x, int y) {this.x = x;this.y = y;}@Overridepublic int hashCode() {return x << 16 + y;}@Overridepublic boolean equals(Object p) {if (!(p instanceof Point)) return false;return (this.x == ((Point)p).x && this.y == ((Point)p).y);}public final static int distance(Point p1, Point p2) {return Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y);}}private final static boolean detected(int K, Point[] dragon, Point cur) {for (int i = 0; i < dragon.length; i++) {if (Point.distance(cur, dragon[i]) < K) return true;}return false;}private final static boolean canEscape(int N, int M, int K, Point[] dragon, Point start, Point end) {