当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。
Given a set of points with integer coordinates xi, yi, i = 1...N, your program must find all the squares having each of four vertices in one of these points.
Input file contains integer N followed by N pairs of integers xi yi.
Constraints
-104 ≤ xi, yi ≤ 104, 1 ≤ N ≤ 2000. All points in the input are different.
Output file must contain a single integer — number of squares found.
Sample input 1 4 0 0 4 3 -3 4 1 7 Sample input 2 9 1 1 1 2 1 3 2 1 2 2 2 3 3 1 3 2 3 3
Sample output 1 1 Sample output 2 6
时间上限 | 内存上限 |
3000 | 65536 |