D
D
Dmitry Belousov2017-10-30 20:34:45
Programming
Dmitry Belousov, 2017-10-30 20:34:45

How to create a network if connected servers are known?

A large software company has nn servers. They are networked with mm wires. A wire connects two servers together.
The AA and BB servers are in the same local network if the signal from the AA server can reach the BB server through the working wires, possibly passing through intermediate servers. If a server can only connect to itself, then it is considered to represent a local network on its own.
Rodents appeared in the data center of the company, which began to gnaw through the wires. While your partner went to get rodent repellers, you were instructed to calculate the damage to the company. You need to answer how many local networks in the company arose after the removal of each wire. Example:
Input:
3 - number of servers
3 - number of wires
1 2 - wires themselves
2 3
1 3
2 - number of broken wires
1 2 - broken wires
Output:
1 2 The
question is: how to create a network if connected servers are known?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question