Bessie the cow is competing in a cross-country skiing event at the winter Moolympic games. She starts out at a speed of 1 meter per second. However, as she becomes more tired over time, she begins to slow down. Each time Bessie slows down, her speed decreases: she moves at 1/2 meter per second after slowing down once, then 1/3 meter per second after slowing down twice, and so on. You are told when and where Bessie slows down, in terms of a series of events. An event like this: T 17 means that Bessie slows down at a specific time -- here, 17 seconds into the race. An event like this: D 10 means that Bessie slows down at a specific distance from the start -- in this case, 10 meters. Given a list of N such events (1
Bessie the cow is competing in a cross-country skiing event at the winter Moolympic games. She starts out at a speed of 1 meter per second. However, as she becomes more tired over time, she begins to slow down. Each time Bessie slows down, her speed decreases: she moves at 1/2 meter per second after slowing down once, then 1/3 meter per second after slowing down twice, and so on. You are told when and where Bessie slows down, in terms of a series of events. An event like this: T 17 means that Bessie slows down at a specific time -- here, 17 seconds into the race. An event like this: D 10 means that Bessie slows down at a specific distance from the start -- in this case, 10 meters. Given a list of N such events (1 <= N <= 10,000), please compute the amount of time, in seconds, for Bessie to travel an entire kilometer. Round your answer to the nearest integer second (0.5 rounds up to 1).
标签: HBC24566露营 数据结构 STL 广度优先搜索(BFS) 搜索[USACO 2014 Jan B]Bessie Slows Down题解