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

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

I need help with problem Intercity from SEERC 2013. link to problem

Could anyone provide some insight? Thank you!

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

»
12 лет назад, скрыть # |
 
Проголосовать: нравится +8 Проголосовать: не нравится

As far as i remember, an optimal solution always consists of only either new or old edges. It can be proved like this: the edge between the first and the N'th city is either new or old(for our convenience, let's think, that it is old). So, this edge is a way from the first to the N'th city. If there is another way, that contains an old edge, then it isn't shorter than just an old edge from 1 to N.

»
12 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

Never mind.