Блог пользователя ayushrocker92

Автор ayushrocker92, 9 лет назад, По-английски

how to solve this problem??

  • Проголосовать: нравится
  • +2
  • Проголосовать: не нравится

»
9 лет назад, # |
Rev. 3   Проголосовать: нравится +1 Проголосовать: не нравится

You can do this by binary searching the answer which is checked valid by:

1.making a graph with cost sqrt(|x_j-x_i-L|) — R * b_j and always x_j > x_i.

2.In this graph,find shortest path from x0 to xn (take x0 as a dummy start).

i)if this value is -ve this means the mid(of binary search) is greater than the optimal value.

ii)if +ve this is opposite the above,thus take the necessary steps in else of binary search.

3.Once you get the optimal value you backtrace the waiting pts you took.

For further reading Editorial's comment

His submission for this method Submission

EDIT:Congrats for becoming the Training and Placement Representative