Pick-up sticks
题目:http://poj.org/problem?id=2653
Description
Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks, that is these sticks such that there is no stick on top of them. Stan has noticed that the last thrown stick is always on top but he wants to know all the sticks that are on top. Stan sticks are very, very thin such that their thickness can be neglected.
Input
Input consists of a number of cases. The data for each case start with 1 <= n <=
ACM计算几何:Pick-up sticks 解题策略

这篇博客探讨了ACM竞赛中的计算几何问题——Pick-up sticks(poj2653)。题目要求找出所有未被覆盖的棍子序号,作者分享了两种解题方法:一种是通过两层循环判断棍子相交,另一种是利用STL的set数据结构动态判断并更新最上面的棍子。文章提到,虽然初始的循环方法已经能通过,但作者计划后续研究使用set的方法来优化解决方案。
最低0.47元/天 解锁文章
1840

被折叠的 条评论
为什么被折叠?



