"I want to ask a question" - Ask them all here!

Thanks a lot for your answer below :slight_smile:

1 Like

Now it works yayyyy ! @vijju123 Also, how did you come up with the testcase so quickly ?

Practice and experience :3

You can ask questions independently now using “Ask a Question” - use that :slight_smile:

No need to convert this into a question, since it makes really no point as i never get an answer :stuck_out_tongue: i got the logic though…

I am having exams dear, so I dont have any time at hand right now. And no, see what @admin said at top “Only ask here if you have less karma”.

Please search first on forum, this is a very commonly asked question.

Could’nt find the question of my type

Can u Tell where my code fails pls, I have’nt got any test-case error when I tried from my side.

Anyways, coming to the error, the scores per round are CUMULATIVE scores instead of individual scores. Meaning, New score= sum of score of all rounds till now. Lead and difference are calculated on this one.

Try to search better, because this question is so commonly asked, I think you are doing some mistake while searching.

ty, finally got that :slight_smile:

Did you check the editorial?

Probably no… You want me to upgrade this to a question?

Why Binary search? Just make an array which has all the distances upto {10}^{9} and iterate through it to find the closest possible distance. Use it in formula for the answer.

I will upgrade it to a question once you add more details of your approach.

If you are to use binary search only you can refer my solution. I used std::lower_bound instead of hard-coding binary search.

Already forwarded to @admin yesterday. They are looking into the issue. Thanks for reporting though :slight_smile:

@vijju123 I think that my approach is the most optimal approach. I calculate everything in O(1) tc and find the sum of n numbers <= N in Log(n) tc and O(1) spaceC . I did as everyone. my logic was correct.(atleset i thougt so )
So i needed to know where it fails .

@divik you used a Dp approach , i think . but I used BS to find the sum of natual numbers; less than equal to given N.
your appraoch is different than mine.

Can you give the reference link?

question link please.