I was not able to solve the E problem in time of the contest, I'm dealing with a wrong answer in Test 2, In my solution, I'm always looking for the nearest room, I'm wondering if this greedy approach is wrong ?
Here come's my code:
How did you guys solved this problem ?
My solution.
it's dp. for each position of new step, we looking for nearest result with less position, or wih greater or equal check both of them.