题目
746:Elevator Stopping Plan
总时间限制: 1000ms 内存限制: 65536kB
描述
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 means:It costs (n-1)*4seconds if the elevator goes from the 1 st floor to the nth floor without stop. And the elevator stops 10 second once. So, if the elevator stops at each floor, it will cost (n-1)4+(n-2)10seconds (It is not necessary to calculate the stopping time at nth floor). In another way, it takes 20 s

最低0.47元/天 解锁文章
1035

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



