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

建议使用的浏览器:

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

3234:The Kylin Den

题目描述

As more and more people come to visit her in the den and got lost in it, Kylin Orange had started a rebuild project – turn all the walls into glass so that the dizzy visitors will clearly take in the spot they are heading to. And it was just finished. Contrary to her wish, however, things turns out to be more complex as the cheesy glass walls always reflect much of the light rather than let it all pass through. Thus the walls are actually transparent mirrors. As a result, when someone wants to locate a place in the den, he will see a bundle of it and gets lost even easier.

Anyway, to change it back can be another torturing labor which the exhausted Kylin does not want. She has to think about setting up some signposts. In the first place, she needs to know how many images (including the real one) of an object one can see from a particular place. There are two important rules of counting:

  1. Any light that is reflected by the same wall twice will be ignored as it is getting too faint to recognize.
  2. Light passes through exactly the fringes of some walls does not vanish.
输入解释

The input contains exactly one test case given as specified below:

Line 1Four integers xm, ym, xd and yd, suggesting the locations of the observer (xm, ym) and the object (xd, yd). The two locations can coincide with each other.
Line 2An integer N (0 < N < 9), the number of walls.
Line 3 – N + 2Four integers x1, y1, x2 and y2 on each line, giving the two ends of a wall (x1, y1) and (x2, y2). The wall satisfies exactly one of four conditions:
  1. x1 = x2
  2. y1 = y2
  3. x1 + y1 = x2 + y2
  4. x1y1 = x2y2

The walls does not intersect or touch each other. All coordinates are in the range (−104, 104) × (−104, 104).

输出解释

Output the number of images that are seen.

输入样例
0 0 0 0
2
-1 0 0 1
0 -1 1 0
输出样例
5

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3234

最后修改于 2020-10-29T06:56:28+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000 131072