rajshekhariitr123's blog

By rajshekhariitr123, history, 7 weeks ago, In English

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

Full text and comments »

  • Vote: I like it
  • -11
  • Vote: I do not like it