Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 siStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started