国际竞赛ACM北大教程经典例题1744 Elevator Stopping Plan.doc

国际竞赛ACM北大教程经典例题1744 Elevator Stopping Plan.doc

  1. 1、本文档共4页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
解题报告:Phone numbers 题目来源:POJ 1744, /JudgeOnline/showproblem?problem_id=1744 解法或类型: 二分 + 谈心 作者:张志强 Elevator Stopping Plan Time Limit:1S? Memory Limit:65536K Total Submit:414 Accepted:77 Description ZSoft Corp. is a software company in GaoKe Hall. And the workers in the hall are very hard-working. But the elevator in that hall always drives them crazy. Why? Because there is only one elevator in GaoKe Hall, while there are hundreds of companies in it. Every morning, people must waste a lot of time waiting for the elevator.Hal, a smart guy in ZSoft, wants to change this situation. He wants to find a way to make the elevator work more effectively. But its not an easy job. There are H floors in GaoKe Hall. It takes 4 seconds for the elevator to raise one floor. It seconds if the elevator goes from the 1 st floor to the?means:It costs (n-1)*4 nth floor without stop. And the elevator stops 10 second once. So, if the seconds (It is not?elevator stops at each floor, it will cost (n-1)*4+(n-2)*10 necessary to calculate the stopping time at nth floor). In another way, it takes seconds?20 seconds for the workers to go up or down one floor. It takes (n-1)*20 for them to walk from the 1 st floor to the nth floor. Obviously, it is not a good idea. So some people choose to use the elevator to get a floor which is the nearest to their office. After thinking over for a long time, Hal finally found a way to improve this situation. He told the elevator man his idea: First, the elevator man asks the people which floors they want to go. He will then design a stopping plan which minimize the time the last person need to arrive the floor where his office locates. For example, if the elevator is required to stop at the 4 th , 5 th and 10 th floor, the stopping plan would be: the elevator stops at 4 th and 10 th floor. Because the elevator will arrive 4 th second, then it will stop 10 seconds, then it will arrive 10 th?floor at 3*4=12 second. People who want to go 4 th floor will reach t

文档评论(0)

186****4595 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档