New binary search method
Разница между ru1 и ru2, 21 символ(ов) изменены
There is new method of binary search which may be exist but I didn't see it.↵
↵
Instead of using left and right, we can simply add new bit to our answer if it is possible:↵
↵
~~~~~↵
while bit > 0:↵
   if check(ans + 
plusbit): ↵
      ans += 
plusbit↵
   
plusbit /= 2↵
~~~~~↵
↵
Constant will be much smaller.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
ru2 Русский ColobocCodeforces 2024-12-04 13:38:04 21
ru1 Русский ColobocCodeforces 2024-12-04 13:37:13 321 Первая редакция (опубликовано)