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

Автор TheCreator, история, 20 месяцев назад, По-английски

Given a connected undirected graph consisting of N N nodes, determine how many connected components the graph will break into if each node is removed.

For example, consider a graph with the following undirected edges:

1-2, 1-3, 1-4, 4-5, 5-6, 4-6.

If we remove node 1, there will be 3 connected components. If we remove node 2, there will be 1 connected component. If we remove node 3, there will be 1 connected component. If we remove node 4, there will be 2 connected components. If we remove node 5, there will be 1 connected component. If we remove node 6, there will be 1 connected component.

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

»
20 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by TheCreator (previous revision, new revision, compare).

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

I am wrong, disregard :)

»
20 месяцев назад, скрыть # |
 
Проголосовать: нравится +11 Проголосовать: не нравится
»
20 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

This problem appeared in a recent Atcoder Beginner Contest, ABC334G: Christmas Color Grid 2 and ExplodingFreeze showed me an elegant way to compute this value.