当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3512:Perfect matching

题目描述
Given the complete bipartite graph. Each part of this graph has N vertices, i.e. the graph is balanced. An integer number (called a weight) assigns to each vertex. The weight of the edge is defined as the product of weights of vertices which connected by this edge.
It is well known, a matching in a graph is a set of edges without common vertices. A matching is perfect, if it covers all vertices of a graph.
Write a program to find a perfect match of the given bipartite graph with the maximal weight of the matching edges minimal.
输入解释
The input consists of multiple cases.
For each testcase,there will be exactly three lines;
The first line contains one integer number N (1 ≤ N ≤ 105). The second line consist of N integer numbers, not exceeded 109 by absolute value. The i-th number in line denotes a weight of i-th vertex of first part of a graph. In the third line, weights of vertices of second part are presented.

输出解释
The answer specified above.
输入样例
3
1 2 3
9 10 11
输出样例
27
来自杭电HDUOJ的附加信息
Recommend zhouzeyong

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3512

最后修改于 2020-10-25T23:04:17+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)