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]

# | User | Rating |
---|---|---|

1 | tourist | 3778 |

2 | Benq | 3592 |

3 | ecnerwala | 3521 |

4 | Um_nik | 3423 |

5 | jiangly | 3375 |

6 | Petr | 3342 |

7 | Radewoosh | 3337 |

8 | scott_wu | 3313 |

9 | maroonrk | 3265 |

10 | yosupo | 3259 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 202 |

2 | 1-gon | 200 |

3 | rng_58 | 194 |

4 | SecondThread | 193 |

5 | awoo | 187 |

6 | vovuh | 183 |

7 | Um_nik | 182 |

8 | antontrygubO_o | 177 |

9 | Ashishgup | 175 |

10 | -is-this-fft- | 171 |

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]

↑

↓

Codeforces (c) Copyright 2010-2021 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jan/19/2021 02:07:22 (i3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

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