Friday, October 3, 2014

ACM 1876. Centipede's Morning / Утро сороконожки

 There are 2 cases which can be "the worst", the first case if as follows, he gets out only the right shoes until all the right shoes are over and then he will take the left shoes and finish which gived total of 2*b+40 moves. Or he might take out 39 right shoes in the beginning , wear them , then take all the left shoes and then take the last right shoe and finish which will give a total of 2*39+40+(a-40)*2+1=2*a+39


       FULL SOURCE CODE

No comments:

Post a Comment