PAT (Advanced Level) Questions Guide - The Ninth [Dijkstra + DFS]

一、1018 Public Bike Management

1. Question restatement

Hangzhou has a public bicycle service, which provides great convenience for tourists from all over the world. It is possible to rent a bicycle at any station and return it to other stations in the city. The Public Bicycle Management Center (PBMC) constantly monitors the real-time capacity of all stations. A workstation is said to be in perfect condition if it is just half full. If a station is full or empty, PBMC collects or dispatches bicycles to adjust the condition of the station to its optimum condition. Also, all the stations along the way are tuned to perfection. When reporting a problem site, PBMC will always choose the shortest path to that site. If there is more than one shortest path, the one that requires the least number of bikes to be sent from the PBMC will be chosen.

2. Sample Input

10 3 3 

Guess you like

Origin blog.csdn.net/m0_51339444/article/details/132257944