POJ 2002 Squares 解题报告 哈希
POJ 2002 Squares 解题报告 题意:给出平面中的点,求用这些点最多能构成多少个正方形。 解题思路:正常思路直接暴力肯定超时,看了别人的blog,其实就是用离散化的方法极大减小了遍历时间。其他地方就没什么难的了。还发现一点:new分配的类会自动初始化,malloc只分配空间,类构造函数没用,next指针还得自己赋成NULL。 # include <iostream> # include <math.h> # include <iomanip> # include <algorithm> # include <iostream> # include <math.h> # include <iomanip> # include <algorithm> # include <queue> # include <cstring> # include <string> # include <map> # include <stack> # include <stdio.h> # include <cstdio> # include <stdlib.h> # include <fstream> # include <iomanip> # pragma warning(disable:4996) # define INF 0x3f3f3f3f # define ll long