Strange thing happen in binary search?? PLEASE HELP!!

Revision en2, by rover1, 2019-11-03 15:27:46

Recently i was doing this (https://codeforces.me/contest/448/problem/D) question and got stuck when my solution goes in infinite loop then i see the correct solution and notice the difference and dry run my code, then i realize my code is incorrect. Now i want to know why this happen.. link to correct solution -- https://codeforces.me/contest/448/submission/7139620 what i have done is instead of writing l = x+1 i have written l=x Please HELP..

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English rover1 2019-11-03 15:27:46 1062
en1 English rover1 2019-11-03 15:25:42 1477 Initial revision (published)