### code_warrior's blog

By code_warrior, history, 7 months ago,

This is the problem[This is the problem](http://Vasya and Good Sequences)Can someone explain me why it is so written in its tutorial that if the length of sequence is greater than 61 than we don't need to check the maximum condition![problem:1030E]

• +2

 » 7 months ago, # |   +9 Atleast provide the link to the question.
•  » » 7 months ago, # ^ |   0 Can you tell me from where can i get the link for a particular problem in codeforces! I am just new to this website!
•  » » 7 months ago, # ^ |   0 You can now view the problem!
 » 7 months ago, # |   0 Auto comment: topic has been updated by code_warrior (previous revision, new revision, compare).
 » 7 months ago, # |   0 $a_i > 0$, so every number has at least 1 bit set. So over a segment of length 61 or more, we are guaranteed to have a sum $S \geq 61$. Since the maximum value for $b_i$ is 61, we can be sure that this segment has $S \geq b_i$. Do comment back if you didn't understand something :)
•  » » 7 months ago, # ^ |   0 Ok, so it means that even in the worst case in a segment with more than 61 elements where only one element is 61 and all the rest 61 are 1,I will have my sum equal to or greater than 61 excluding the max (61). Thanks, for explaining!
•  » » » 7 months ago, # ^ |   0 This is the accepted code, for your reference :)
 » 7 months ago, # |   0 poor Vasya