Help in Topcoder DP problem

Правка en1, от purple_dreams, 2017-05-25 07:54:38

Here is the link: RoadOrFlightHard I got the solution but it takes dp[400000][40][2] which is very huge as far as memory is concerned. In the editorial they have added a line that city(i) calculation depends on city(i+1). I was not able to get that observation and I am not getting how to implement it. I saw one code but still did not understand. Thank You.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский purple_dreams 2017-05-25 07:54:38 464 Initial revision (published)