ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1876. Centipede's Morning

Clarification on the task
Posted by Aleksandr 24 Jan 2017 17:09
Please, correct me if I am wrong.
In the worst case, first of all our centipede will take 40 right slippers (40slip * 2sec)
After that it will take all of the remaining right slippers ((rightSlippers-40) * 2sec)
Then, because there are no right slippers left, it will take 40 left slippers(40slip * 1sec)
And finally take remaining left slippers and throw them away ((leftSlippers-40) * 2sec)
I guess I didn't understand the task correctly, may someone explain it to me?
Re: Clarification on the task
Posted by Aleksandr 24 Jan 2017 17:25
Update:

I guess I should of have searched a little more, I found what is the case.

If any of you are interested the solution is that there may be another situation where we have >40 left slippers, so first we take 39 right ones, then 40 left ones, throw remaining lefts away and take our last right. Depending on which one is longer, you may use this solution or the one I posted before.

P.S. of course you don't have to throw away the remaining slippers once all legs are dressed, my bad.