codeforces 2161C
Difference between en2 and en3, changed 63 character(s)
why the logic fails???↵


I separated the values equal to x from the array and sorted the rest...I took sum=0 and then I used left and right pointers...↵
I checked the left value,if it's >= next multiple of x(starting from 1) then I added up the left value in bonus coins and sum...else ↵
I checked the sum of left and right values...if that's >= next multiple of x...I added up the right value in bonus coins and **left and right values in sum** ...else↵
I just added the left value in sum...

problem link-https://mirror.codeforces.com/problemset/problem/2161/C

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English rajshekhariitr123 2026-03-10 16:57:16 63
en2 English rajshekhariitr123 2026-03-10 16:54:54 5
en1 English rajshekhariitr123 2026-03-10 16:54:03 508 Initial revision (published)