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

Автор renegade_warrior, история, 8 лет назад, По-английски

http://codeforces.com/gym/100253/attachments M — Winnie-the-Pooh Needs Help . How can i solve this ?

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

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

Removing each edge and doing bfs is too costly. In stead, we remove each vertex and do BFS finding shortest and second shortest path to each node via a different children from root. Here's my code : http://ideone.com/sCOHAQ