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

建议使用的浏览器:

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

1696:Help the People Been Trapped

题目描述
Full Score of Fear, the Movie 12 of Detective Conan has been published recently.


Before going to the concert, Conan had been attacked and was unconscious. But Ran wasn’t aware of Conan’s disappearance. Then they went into the odeum, and the concert started.
Suddenly, the bombs in the odeum blasted and the whole building was on fire. All the audiences are trapped in the odeum, include Mouri Ran and Haibara Ai. Thousands of people are in danger now.

After the explosion, some walls have collapsed and blocked the way. Now Conan gets a map from the police, and he knows the location of all the hindrances. Also, he knows that Ran is a karate superior, and she can destroy some hindrances. (Horrific) As destroying the hindrance is a hard job, Conan wants to find a way to get out of the odeum crossing the least number of hindrances.

But the odeum is so large that it’s not an easy work to find that way. Can you help Conan and the people trapped in the odeum?
输入解释
The input consists of several test cases. The first line of the input is the number of the cases. There are no more than 20 cases.
Each case contains an integer M on its first line, which is the number of the hindrances. 0<=M<=4000.
The next m lines describe m hindrances each. Each line contains four integers in each, x1, y1, x2, y2, means that there is a hindrance from (x1, y1) to (x2, y2). The hindrances will not cross each other, but they can meet at the end point.
The last line contains two integers, x, y, means that the people are trapped at point (x, y). You can assume that this point will not be on any of the hindrances.
Every coordinate is between -10,000 and 10,000.
输出解释
For each case, print the least number of hindrances need to be destroyed. (If you need to cross an end point, it should be counted multiple times; look at the second sample for more details) Use the format in the sample.
输入样例
3
0
0 0
12
0 0 2 0
2 0 4 0
0 2 2 2
2 2 4 2
0 4 2 4
2 4 4 4
0 0 0 2
0 2 0 4
2 0 2 2
2 2 2 4
4 0 4 2
4 2 4 4
1 1
6
0 2 1 0
0 2 -1 0
1 0 -1 0
0 2 -2 -1
0 2 2 -1
-2 -1 2 -1
0 1
输出样例
Case 1: Need to destroy 0 hindrances.
Case 2: Need to destroy 1 hindrances.
Case 3: Need to destroy 2 hindrances.
来自杭电HDUOJ的附加信息
Recommend wangye

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

源链接: HDU-1696

最后修改于 2020-10-25T22:47:17+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)