CF13D.Triangles
省选/NOI-
通过率:0%
时间限制:2.00s
内存限制:64MB
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 inside.
小Petya喜欢画画。他在平面上画了 N 个红色点和 M 个蓝色点,且任意三点不共线。现在他想知道:以红色点为顶点的、内部不包含任何蓝色点的三角形共有多少个?
输入格式
The first line contains two non-negative integer numbers N and M (0 ≤ N ≤ 500, 0 ≤ M ≤ 500) — the number of red and blue points respectively. The following N lines contain two integer numbers each — coordinates of red points. The following M lines contain two integer numbers each — coordinates of blue points. All coordinates do not exceed 109 by absolute value.
第一行包含两个非负整数 N 和 M(0 ≤ N ≤ 500,0 ≤ M ≤ 500),分别表示红色点和蓝色点的数量。接下来的 N 行每行包含两个整数,表示一个红色点的坐标。再接下来的 M 行每行包含两个整数,表示一个蓝色点的坐标。所有坐标的绝对值均不超过 109。
输出格式
Output one integer — the number of distinct triangles with vertices in red points which do not contain any blue point inside.
输出一个整数——顶点均为红点且内部不包含任何蓝点的互不相同的三角形的个数。
输入输出样例
输入#1
4 1 0 0 10 0 10 10 5 4 2 1
输出#1
2
输入#2
5 5 5 10 6 1 8 6 -6 -7 7 -1 5 -1 10 -4 -10 -8 -10 5 -2 -8
输出#2
7
输入解题思路,AI测评打分。不知道怎么写?