Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help modifiying the code in the picture to meet the following the requirements. I also included a picture with the input / output

I need help modifiying the code in the picture to meet the following the requirements. I also included a picture with the input/output.The code must print the output just like that. Given a network of n computers, a set of the pairs of computers that are initially connected, and a sequence of steps where connections are destroyed, one by one, calculate the connectivity (as defined in the problem specification above)after each connection is destroyed. The Input (must be read from standard input (no file i/o.use of file i/o will fail all the test cases and you will get zero): The first line of input contains three space separated integers, n (1==10^5),m (1=m =3 x 10^5),and d (1=d =m),representing the number of computers in the enemy network, the number of connections between pairs of computers in the enemy network, and the number of those connections which you will destroy, respectively.The computers are numbered 1 through n,inclusive, and the connections are numbered 1 through m respectively.The following m lines will each contain a pair of distinct integers, u and v (1=u,v =n ,u !=v),representing that computers u and v are connected, initially. (Note: we denote the first of these lines as connection 1,the second as connection 2,and so forth.)It is guaranteed that each of the pairs listed will be unique pairs;namely, the same two values of u and v will never appear on two different lines as separate connections. (Of course, many individual computers will be connected to more than one other computer, so a particular value u may appear on more than one of these m lines.)The following d lines will each contain a unique integer in between 1 and m,inclusive, representing a connection number that getsdestroyed. These will appear in the order that they get destroyed. The Output (standard console output): Output d+1 lines of output. The first line should be the initial connectivity of the network. The following d lines should have the connectivity of the network after each connection is destroy, one by one.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

How do you talk about your complaining customers?

Answered: 1 week ago