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

建议使用的浏览器:

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

5581:Infinity Point Sets

题目描述
This story comes from an ancient book written by an old frog philosopher.

When will be the end of the world? Perhaps the best way to understand is using geometry for a calculation.

At first, you should draw some points on a piece of paper. Each time you should choose two points and connect them with a segment. When there are two segments meet and produce a new point at the cross, you add that point to the paper, and try to connect it with previous ones as before.

You should do this again and again, keep drawing segments, and adding points if possible, until there are no new segments to draw. Then is the end of the world, the old frogs will die and a new age will begin.

As you can see, different sets of initial points lead to different results. For some sets of points, the end of the world will never come, we call those sets $Infinity$.

Now you are given $N$ points, and you need to find, among all the possible subsets of those $N$ points not including empty set, so there will be $2^N - 1$ sets in total), how many of them are not $Infinity$?
输入解释
First line contains an integer $T$, which indicates the number of test cases.

Every test case begins with an integers $N$, which indicates the numbers of points.

In the following $N$ lines, the $i^{th}$ line contains two intergers $x_i$ and $y_i$, indicating the coordinate of $i^{th}$ point is $(x_i, y_i)$.

$\cdot$ $1 \leq T \leq 10$.

$\cdot$ for 90% data, $1 \leq N \leq 100$.

$\cdot$ for 100% data, $1 \leq N \leq 1000$.

$\cdot$ $1 \leq x_i, y_i \leq 10^4$.

$\cdot$ there is no a pair of points with the same coordinate.
输出解释
For every test case, you should output `"Case #x: y", where $x$ indicates the case number and counts from $1$ and $y$ is the result.

Because $y$ could be very large, just mod it with $10^9 + 7$.
输入样例
2
4
0 0
0 2
2 2
2 0
5
0 0
0 2
2 2
2 0
1 2
输出样例
Case #1: 15
Case #2: 30
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5581

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

共提交 0

通过率 --%
时间上限 内存上限
10000/5000MS(Java/Others) 65536/65536K(Java/Others)