Question: Need urgent help in JAVA ce Problem Statement The Kingdom of Code Land consists of M bidirectional roads connecting M+1 cities such that one can

Need urgent help in JAVA

Need urgent help in JAVA ce Problem Statement The Kingdom of Code

Land consists of M bidirectional roads connecting M+1 cities such that one

can get from any city to any other city. Road i connects

ce Problem Statement The Kingdom of Code Land consists of M bidirectional roads connecting M+1 cities such that one can get from any city to any other city. Road i connects cities A and B. The king wants to guard the kingdom against any possible attack, so he wants to put some guardians on some roads. The ih road needs G guardians to protect it. When guarding a road between two cities, both cities become safe The king wants to assign the minimum guardians possible such that all cities become safe. Your task is to help the king find the minimum number of guardians he needs. Note: It is given that if there are M roads then M+1 cities will be present in the kingdom Cities are numbered from 1 to M+1. Input Format The first line contains an integer, M. denoting the number of roads in the kingdom. Each line i of the M subsequent lines (where 0 si

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!