Need help in solving MP3!!

Правка en1, от byee, 2019-08-22 01:54:20

Hi all, I am trying to solve this question,I got some logic and implemented it but getting WA on test case 11. Here is my code.

Don't know whats wrong with my logic or code as I have tried many cases by myself, for all of them I got the correct output.

Also please help me in understanding this submission for the same why he used prefix sum and how it is different from my logic. Please help me. Thanks.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский byee 2019-08-22 07:34:54 44
en2 Английский byee 2019-08-22 01:55:29 0 (published)
en1 Английский byee 2019-08-22 01:54:20 607 Initial revision (saved to drafts)