当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6731:Angle Beats

题目描述
Given n points $P_1$, $P_2$, .... , $P_n$ on 2D plane and q queries. In i-th query, a point $A_i$ is given, and you should determine the number of tuples (u, v) that 1 $\leq$ u < v $\leq$ n and $A_i$ , $P_u$, $P_v$ form a non-degenerate right-angled triangle.
输入解释
The first line contains two positive integers n, q (2 ≤ n ≤ 2 000, 1 ≤ q ≤ 2 000), denoting the numberof given points and the number of queries.
Next n lines each contains two integers xi , yi (|xi|, |yi| ≤ $10^9$), denoting a given point Pi.
Next q lines each contains two integers xi , yi (|xi|, |yi| ≤ $10^9$), denoting a query point Ai.
It is guaranteed that the input n + q points are all pairwise distinct.
输出解释
Output q lines each contains a non-negative integer, denoting the answer to corresponding query.
输入样例
4 2
0 1
1 0
0 -1
-1 0
0 0
1 1
输出样例
4
3

提示
For query (0, 0), the 4 right-angled triangles are
� {(0, 0),(0, 1),(1, 0)} 
� {(0, 0),(0, 1),(-1, 0)} 
� {(0, 0),(0,-1),(1, 0)} 
� {(0, 0),(0,-1),(-1, 0)}
For query (1, 1), the 3 right-angled triangles are
� {(1, 1),(0, 1),(1, 0)} 
� {(1, 1),(0, 1),(0,-1)} 
� {(1, 1),(1, 0),(-1, 0)}
来自杭电HDUOJ的附加信息
Recommend chendu

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 642ccpcQHD

源链接: HDU-6731

最后修改于 2020-10-25T23:33:52+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
20000/15000MS(Java/Others) 131072/131072K(Java/Others)