Question: Question 3 The output contains 2 space - separated numbers, the first number being the maximum number of cities in the even cleaniiness cities marathon
Question The output contains spaceseparated
numbers, the first number being the
maximum number of cities in the even
cleaniiness cities marathon path, and the
second number being the maximum number
of cities in the odd cleantiness cities
marathon path
Input Format For Custom Testing
Sample Case
Sample Input For Custom Testing
Sample Output
Explanation
Marathon path with even cleanliness score
cities: cities
Marathon path with odd cleanliness score
cities: cities
#include kunorderedmap
using namespace std;
checkmark int main
return ; Output
The output contains spaceseparated
numbers, the first number being the
maximum number of cities in the even
cleanliness cities marathon path, and the
second number being the maximum number
of cities in the odd cleantimess cities
marathon path
Input Format For Custom Testing
The first line contains n the number of
cities.
The second line contains integers A
AAn denoting the cleanliness
score of each city.
Next lines contain two integers and
denoting there is a road between city and
city
Sample Case
Sample Input For Custom Testing
There are cities in a country numbered
from to
These cities are connected using
bidirectional roads, such that it is possible to
go from any city to any other city using these
roads.
Each city has a cleanlliness score of its own
given by Ai
Now two marathons need to be organized
for the Go Green campaign but the path of
the marathon must contain cities with either
only even cleaniness score or an odd
cleaniness score.
you can travel a road between cities only
once in a marathon path.
You have to tell the maximum number of
cities included in the marathon path if the
cities were with even cleanliness score and if
int main
the cities were with odd cleanliness score.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
