文件名称:贪心1004
介绍说明--下载内容均来自于网络,请自行研究使用
Were Tian Ji lives in nowadays, he will certainly laugh at himself. Even more, were he sitting in the ACM contest right now, he may discover that the horse racing problem can be simply viewed as finding the maximum matching in a bipartite graph. Draw Tian's horses on one side, and the king's horses on the other. Whenever one of Tian's horses can beat one from the king, we draw an edge between them, meaning we wish to establish this pair. Then, the problem of winning as many rounds as possible is just to find the maximum matching in this graph. If there are ties, the problem becomes more complicated, he needs to assign weights 0, 1, or -1 to all the possible edges, and find a maximum weighted perfect matching...(For each input case, output a line containing a single number, which is the maximum money Tian Ji will get, in silver dollars.)
相关搜索: ACM
(系统自动生成,下载前可以参看下载内容)
下载文件列表
文件名 | 大小 | 更新时间 |
---|---|---|
贪心1004.cpp | 1485 | 2018-04-26 |
题目.txt | 2985 | 2018-04-26 |