Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

binary search (l+r)/2 or (l+r+1)/2 , not a random choice?
Разница между en1 и en2, 1 символ(ов) изменены
binary search (l+r)/2 or (l+r+1)/2 i saw this on a topcoder article that one or the other will no give while loop↵
but on some test cases both might not as can be seen in submission [submission:76258234]
 is  where i changed (r+l)/2 to r+l+1/2↵
from this submission [submission:76258059] and my solution passed so how to decide which one will never give a while loop right now i just do it randomly one and if that doesnt pass i do other

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский 2020 2020-04-11 22:15:39 1 Tiny change: ':76258234]is where ' -> ':76258234] is where '
en1 Английский 2020 2020-04-11 22:14:18 492 Initial revision (published)