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

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

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

Hello, I'm recently trying to understand this problem 1308 — Ant Network . I'm quite confused with a input that I saw in forum post that is

Input
1
5 5
0 1
1 2
2 3
3 4
4 0

Output
Case 1: 2 10

I have read the explanation about this case which was given by Leonardo Boshell. But still unable to understand how this output comes. Can anyone please explain me in details. It will be very helpful to me. Thanks in advance :)

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

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

One escape node isn't enough: if the earthquake destroys it, the other ants cannot get to an escape node.

Two escape nodes is enough: if the earthquake destroys one, the other is always reachable by the ants. How many ways to do this? There are 5 nodes and we need to choose 2: 5C2=10.