#leetcode1029. 两地调度
两地调度
有 2n 位候选人,第 i 位飞往 A、B 两城分别需要 costs[i][0] 与 costs[i][1]。必须各安排 n 人,求最低总费用。
输入输出样例
样例 1
输入
[[10,20],[30,200],[400,50],[30,20]]
输出
110
样例 2
输入
[[259,770],[448,54],[926,667],[184,139],[840,118],[577,469]]
输出
1859
数据范围
2 ≤ costs.length ≤ 100,长度为偶数;1 ≤ costs[i][j] ≤ 1000。
提示代码框架(C++14)
class Solution {
public:
int twoCitySchedCost(vector<vector<int>>& costs) {
}
};