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

建议使用的浏览器:

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

7183:Fall with Intersection

题目描述
Alice and Bob are playing a game, the rules are as follow.

Initially, there is an infinite plane with $w$ straight lines. Alice and Bob now draw new lines in turn, $m$ rounds in total (so there will be $w+2m$ lines in the end). Alice goes first and they can not draw a line that already exists in the plane. After that, these lines will produce some intersections, if the number of intersections is odd, then Bob wins, otherwise, Alice wins. If multiple lines intersect at one point, this intersection will only be counted once.

The game has reached a white-hot stage, there have been $w+n$ lines on the plane. Now Alice and Bob are very focused and their brains are racing that all the decisions they make will be optimal.

All the straight lines should be in the form of $y=kx+b$, where $k$ and $b$ are integers, but there is no limitation of the range(except the first $w+n$ lines).

Fall is interesting with the final result. Can you tell him who will be the winner in the end?
输入解释
The first line contains a single integer T ($1\leq T \leq 100$), the number of test cases. For each test case:

The first line contains three integers, $w,m,n(0\leq w\leq 5,1\leq m\leq 500,\sum{m}\leq 1300, 0\leq n\leq 2m)$, with the same meaning as described above.

The next $w+n$ lines, each line contains two integers $k_i,b_i(-10^6\leq k_i,b_i\leq 10^6)$, representing the $i$-th line one the plane is $y=k_ix+b_i$.

It is guaranteed that $\forall i\neq j, k_i\neq k_j$ or $b_i\neq b_j$.
输出解释
For each test case, output a single line containing one string ("Alice'' or "Bob'', without quotation marks), representing the winner.
输入样例
2
1 2 3
1 1
1 5
0 1
0 5
1 2 2
1 1
1 5
0 1

输出样例
Alice
Alice
来自杭电HDUOJ的附加信息
Hint For the first test case, they have drawn 3 lines so it's Bob's turn to draw the last line. But whatever Bob draws, the number of intersections is always an even number.For the second test case, the third line should be drawn by Alice. She can draw a line $y=0x+5$ so that it would be the same as the first case.

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

源链接: HDU-7183

最后修改于 2022-09-15T06:17:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
12000/6000MS(Java/Others) 262144/262144K(Java/Others)