Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Блог пользователя SAFWAN.K

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

Hello All problem H.Bridges :http://codeforces.net/gym/100712/attachments

my solution :

code : http://ideone.com/86zKZk

  1. run Tarjan algorithm store each bridge edges in map

  2. make new graph without bridges edges

  3. run DFS on graph and give each component Unique id

  4. make graph from component IDs then get Longest path

  5. if there is no bridges in graph then answer is 0

else the answer will be #ofbridges — longest path.

my solution getting MLE any hint to pass it ?

Thanks All.

UPD : Solved

solution : http://ideone.com/QIYU0x

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