codeforces 2161C

Правка en3, от rajshekhariitr123, 2026-03-10 16:57:16

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://codeforces.me/problemset/problem/2161/C

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский rajshekhariitr123 2026-03-10 16:57:16 63
en2 Английский rajshekhariitr123 2026-03-10 16:54:54 5
en1 Английский rajshekhariitr123 2026-03-10 16:54:03 508 Initial revision (published)