Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Any help problem about Bridges

Правка en3, от SAFWAN.K, 2016-09-10 02:14:36

Hello All problem H.Bridges :http://codeforces.com/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

Теги graph, bridges

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский SAFWAN.K 2016-09-10 02:14:36 56 Tiny change: 'nks All.\n' -> 'nks All.\n\n\nUPD : Solved \n\nsolution : http://ideone.com/QIYU0x'
en2 Английский SAFWAN.K 2016-09-09 17:53:55 35 Tiny change: 'tion :\n\n1. run' -> 'tion :\n\ncode : http://ideone.com/86zKZk\n\n1. run'
en1 Английский SAFWAN.K 2016-09-09 17:50:05 522 Initial revision (published)