+ 1

input format 1@10@-1#10@2@10#-1@10@-1 @ for different column element And # for new row output 2

Two cities X and Y (Both should be green in color) can communicate with each other if they are directly connected to each other or they are connected to cities X1 and Y1 respectively such that X1 and Y1 are connected. Two cities are said to be directly connected if they share an edge or a corner. So city at (3,1) can communicate to city at (2, 1), (1, 1), (1, 2), (2, 2) and (4, 2). These all connected parts cumulatively form a communication zone. government can satablize communication in red regions but it would cause some cost and every red every red region may have a different cost. in fact there is no use of stablizing red zones communication because they are very less populated area. government concern is to connect the various communication zones. challange is to connect various communication zone in least possible cost.

13th Oct 2018, 6:53 AM
Rishabh mishra
Rishabh mishra - avatar
1 Odpowiedź
0
The question and description seem unrelatable. So do the input and output in question. I suppose Dijkstra's algorithm (one of the shortest path algorithms, and actually the only one I know) can be used to solve the problem in the description if I have understood the problem correctly. Please properly phrase question with layman description.
17th Oct 2018, 5:44 PM
Rugved Modak
Rugved Modak - avatar