Комментарии
На kiyotakaCodeforces Global Round 3, 7 лет назад
0

I got your approach,It's fine. but what 's wrong with mine?

На kiyotakaCodeforces Global Round 3, 7 лет назад
0

Can anybody please help to point out where I am going wrong in problem B it failed on 8th pretest

  1. Using the first flight from A to B I find the first flight from B to C using binary search .

  2. Now I have two options to cancel the flight

a. Cancel the flight from A to B and use the next Flight from A to B

b. Cancel the flight I found by binary search and
choose the next flight from B to C

  1. I find the time to reach C and which option between the above two gives higher value I go with that.

If in this process the next flight from B to C cannot be chosen I print -1.