HDU - 5988The 2016 ACM-ICPC Asia Qingdao Regional ContestG - Coding Contest Minimum Fee Flow

Very clever way to build

The meaning of the question: There are n areas, each area has some number of people si and food bi, there are m directional paths between the areas, and each path has a number of people passing the upper limit ci. Wires are laid between the paths. Whenever someone passes through the path, there is a probability that pi will touch the wire, but the first person to pass through must not touch the wire. Find the minimum probability that everyone touches the wire after getting the food through the path.

Solution: The probability of not touching the wire is better to find, and then the probability of not touching the wire on a route is (1-p1)*(1-p2)..., the minimum cost flow cannot be multiplied, So the cost of building an edge becomes log(1-p), then multiplication becomes addition, and then the minimum value is required. Since log(1-p) is less than 0, we take -log(1-p), and then After running the minimum cost flow, exp(-ans) is the answer. There is no probability for the first person. Then we split the edge greater than 1 into two edges, one of which has a flow of 1 and a cost of 0.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325301032&siteId=291194637