### 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] Comments (8)
 » Atleast provide the link to the question.
•  » » Can you tell me from where can i get the link for a particular problem in codeforces! I am just new to this website!
•  » » You can now view the problem!
 » Auto comment: topic has been updated by code_warrior (previous revision, new revision, compare).
 » $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 :)
•  » » 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!
•  » » » This is the accepted code, for your reference :)
 » poor Vasya