When submitting a solution in C++, please select either C++14 (GCC 6-32) or C++17 (GCC 7-32) as your compiler. ×

Is ternary search required in this question???

Revision en1, by codeanna, 2019-08-05 09:34:03

In this question https://www.hackerearth.com/problem/algorithm/rescuer-1/description/ 2 for finding the point on x axis say P,where the straight line (joining the two point) cuts on x axis, form a linear equation and put y=0,this will give P but in editorial they use terniary search for finding P and answer is not same. Is my approach correct?? Pls help? Thanks

Tags ternary search

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English codeanna 2019-08-05 09:34:03 412 Initial revision (published)