题意: 给出平面上n个点,问能在其中选出6个点,组成两个三角形,使得其互不相交 问有多少种选法 大致思路 考虑枚举一条直线,将所有得点分为左右两部分,其中有两个点在直线上, 以这两个点为顶点,分别统计左边有多少个三角形,右边有多少个三角形即可. 枚举直线时,枚举一个点,然后对其他点极角排序, 枚举另一个点,可快速算出该直线左右两边的点的数量(二分,叉积),组合一下即可. /* : . : i i . i : . i . i . i : . i . i i : . . . . . . . ..…
A point belongs to a triangle if it lies inside the triangle or on one of its sides. Two triangles are disjoint if there is no point on the plane that belongs to both triangles. You are given nn points on the plane. No two points coincide and no thre…
Little Petya likes to draw. He drew N red and M blue points on the plane in such a way that no three points lie on the same line. Now he wonders what is the number of distinct triangles with vertices in red points which do not contain any blue point…