Comments

You can optimize the code a bit more. Since you're adding to your total sum of the array 1 item from left to right at a time, you can use your total at each loop to make a prefix sum array (let's call that s). That way, instead of processing the remaining sum one by one, you can use lower_bound() to find the very left position that has a number not smaller than x-sum (with lower_bound() returning an iterator, which you have to minus it by s to get the index). Add the number you just got to the number of cycles and you get the final answer. The similarity between my solution and yours is the cycles counting part, with the time complexity being O(n). The difference lies in the process of counting the exceed elements, mine has a time complexity of O(log(n)), better than your O(n), despite requiring O(n) time complexity to prepare the prefix sum array.

P.S. Maybe it's worse than your process because this solution requires you to do at least n loops to generate the prefix sum array before using the lower_bound() function, while yours require at most n loops to count the exceed elements.

Round announcement emails send information about every round, no matter what division is the most suitable for you to compete in. Plus, they can't judge the ability to solve a problem for every individual, so they don't send rounds for some specific divisions only. However, if they know you've already read a round's announcement at least a few hours before the round's starting time, they won't send emails about that round I think.

Oui Oui Oui Oui, it is Paris

On namkhanhvinacon → Is this acceptable?, 4 weeks ago
+1

Then why do you have to waste your time commenting on the blog?

+5

I think there's nothing wrong sharing opinions on posts about events like this. It's just a way people have a look at what they've achieved for the past year and hope for the best in the future. Posting blog entries and comments about events is totally normal. Codeforces isn't just an educational platform. We have side events and many entries not so related to CP out there. People deserve votes or contribution points if they have a positive or funny comment or entry. You're blaming people for commenting on popular blog entries and getting contribution points from that, but that's how people get contribution points.

0

I don't know if you're criticizing me or not, but my birthday happens only once a year, so please let me have a bit of fun in case you're criticizing me.

+1

YOOOO I just realized his birthday is the same as me! Happy Birthday Gennady!

0

You can also change your handle within 7 days after registration.

Not for me though

On QazLon → Why I am so unlucky, 7 weeks ago
0

I genuinely feel bad for you and QazLon

Auto comment: topic has been updated by LghtningBolt (previous revision, new revision, compare).

Auto comment: topic has been updated by LghtningBolt (previous revision, new revision, compare).

0

The code's output is: "as a tester i tested the round".

On QazLon → Why I am so unlucky, 2 months ago
0

moxoc agrees with you

On qwexd → Codeforces Round 1121 (Div. 2), 2 months ago
0

Guess I'll be doing Codeforces from midnight Monday, what a good way to start a week.

+6

Non — C++ users reading this blog: ._.

Auto comment: topic has been updated by LghtningBolt (previous revision, new revision, compare).

MrMoon agrees