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

建议使用的浏览器:

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

2534:Falling cards

题目描述
It is hard to make the playing card stand on its edge, however, some patient person managed to put N of them upon the desk in such a way that each cards stands on its shorter edge. The top-down view of that desk with cards upon it can be represented with the set of line segments with coordinates (xi, yi) to (vi, wi). The segments do not intersect.

The first card falls flat on its side, causing all the cards in touch to fall down also. The angle between vector (x1, y1)-(v1, w1) and the falling direction of the first card is equal to 90 degrees (measured counter-clockwise). If card A touches card B, the direction of B's fall is chosen so that the continuation of the direction vector does not cross the line containing segment A. Input data are guaranteed to never contain:
  • a card falling exactly perpendicular to the other and
  • a falling card that touches more than one of still standing cards.

Your program must determine which cards will fall, and which shall remain standing.
输入解释
The first line of input file contains a numbers N H - the number of cards and the floating point height of a card. Each of the following N lines contains four floating-point numbers xi yi vi wi - coordinates of cards separated by spaces. 1 <= N <= 100, H > 0
输出解释
The output file must contain the list of fallen cards' numbers, sorted in increasing order and separated by spaces.
输入样例
3 100
10 10 50 40
10 0 50 30
20 90 20 20
输出样例
1 3

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

源链接: POJ-2534

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

共提交 0

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