Lang:Java
Edit12345678910111213141516171819202122232425262728293031import java.util.ArrayList;import java.util.HashMap;import java.util.Map;import java.util.Scanner;public class Main{static Scanner scanner;public static void main(String[] args) {Map<String, ArrayList<Node2>> map = new HashMap<String,ArrayList<Node2>>();scanner = new Scanner(System.in);int N = scanner.nextInt(),M = scanner.nextInt();for(int i = 0;i < N; i++){double x = scanner.nextDouble();double y = scanner.nextDouble();String geohash = Encode(x, y, 30);if(map.get(geohash) == null){map.put(geohash, new ArrayList<Node2>());}map.get(geohash).add(new Node2(x, y));}double dx = (double)180.0/Math.pow(2, 15);double dy = (double)360.0/Math.pow(2, 15);for(int i = 0; i < M; i++){int num = 0;double x = scanner.nextDouble();double y = scanner.nextDouble();for(int j = 0;j < 3;j++){for(int k = 0; k < 3;k++){double nx = x + (j-1)*dx;double ny = y + (k-1)*dy;