Why is 1 subtracted?

Правка en1, от CandidFlakes, 2023-07-25 13:43:46

I was trying to solve this question. After trying enough i finally read the tutorial and the solution code here. I almost got everything in the editorial but I am unable to understand why are we subtracting 1 in the solution code? ans += (i — 1) / (2 * a[0] — 1);

Теги lower bound, upper_bound

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский CandidFlakes 2023-07-26 20:28:47 112 Added some more detail to make my doubt clearer. (published)
en2 Английский CandidFlakes 2023-07-26 20:23:51 836 Tiny change: 'this code #include <' -> 'this code \n\n#include <' (saved to drafts)
en1 Английский CandidFlakes 2023-07-25 13:43:46 463 Initial revision (published)