POJ 2674】的更多相关文章

POJ 2674 Linear world 题目大意: 一条线上N只蚂蚁,每只蚂蚁速度固定,方向和坐标不同,碰头后掉头,求最后掉下去那只蚂蚁的时间和名字. 注意两点: 相撞可视为擦肩而过,蚂蚁们不管掉不掉头它们的相对位置保持不变 这个题是大白上原来的蚂蚁相撞问题(POJ 1852)的加强版 如果只考虑最后掉下去那只蚂蚁的时间(即蚂蚁全部掉下的最长时间),那么可以认为这些蚂蚁相撞时直接擦肩而过. 但是该题还要求出最后掉下去那只蚂蚁的名字,这样看起来似乎要考虑每个蚂蚁相撞的情况,若记录获得最大值的蚂…
Linear world Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 2448   Accepted: 564 Description The Disc, being flat, has no real horizon. Any adventurous sailors who get funny ideas from staring at eggs and oranges for too long and set ou…
  Linear world 题目大意:一些人生活在线性世界中,到达线性世界两端就会消失,两个人的前进方向有两个,相遇会改变各自相遇方向,求最后一个人掉下的人的名字和时间. 其实这一题就是弹性碰撞的模型,所谓弹性碰撞的模型是两个物体相碰后会改变方向,但是可以看成是各自擦身而过,这个模型可以很快速求解与端点的问题 但是这一题还问你一个问题,就是你要找到这个人的名字,这个我一开始,没有想到,只能参考一下别人的代码了 http://www.cnblogs.com/gtarcoder/p/4908715…
Linear world Time Limit: 3000MS   Memory Limit: 65536K Total Submissions: 4426   Accepted: 1006 Description The Disc, being flat, has no real horizon. Any adventurous sailors who get funny ideas from staring at eggs and oranges for too long and set o…
弹性碰撞的题目一般都是指碰到就会掉转方向的一类题目,这里我们可以忽略掉头,仅仅看成擦肩而过,交换名字等等 题意:一条线上N只蚂蚁,每只蚂蚁速度固定,方向和坐标不同,碰头后掉头,求最后掉下去那只蚂蚁的名字. 思路: 如果只有一只蚂蚁,就可以计算了 但是如果题目很多只,这个时候就要用上弹性碰撞题目的解题技巧 到最远的那只,确定它前进的方 向 找到前进方向有多少只跟其方向相反(即交换了多少次名字) 最后交换名字的那一只就是ans 特别主要开始时,要通过position来区分往右还是左 解决题目的代码:…
POJ 1852 Ants POJ 2386 Lake Counting POJ 1979 Red and Black AOJ 0118 Property Distribution AOJ 0333 Ball POJ 3009 Curling 2.0 AOJ 0558 Cheese POJ 3669 Meteor Shower AOJ 0121 Seven Puzzle POJ 2718 Smallest Difference POJ 3187 Backward Digit Sums POJ 3…
Halloween treats Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 7644   Accepted: 2798   Special Judge Description Every year there is the same problem at Halloween: Each neighbour is only willing to give a certain total number of sweets…
Find a multiple Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 7192   Accepted: 3138   Special Judge Description The input contains N natural (i.e. positive integer) numbers ( N <= 10000 ). Each of that numbers is not greater than 15000…
The Pilots Brothers' refrigerator Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22286   Accepted: 8603   Special Judge Description The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a…
Flip Game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 37427   Accepted: 16288 Description Flip game is played on a rectangular 4x4 field with two-sided pieces placed on each of its 16 squares. One side of each piece is white and the…