problemscpp
A collection of my answers to algorithm problems in c++.
| 函数
leetcode::minimum_weighted_subgraph_with_the_required_paths 命名空间参考

LeetCode 6032. 得到要求路径的最小带权子图 更多...

class  Solution
 

函数

 TEST (minimum_weighted_subgraph_with_the_required_paths, case1)
 
 TEST (minimum_weighted_subgraph_with_the_required_paths, case2)
 
 TEST (minimum_weighted_subgraph_with_the_required_paths, case3)
 
 TEST (minimum_weighted_subgraph_with_the_required_paths, case4)
 

详细描述

LeetCode 6032. 得到要求路径的最小带权子图

函数说明

◆ TEST() [1/4]

leetcode::minimum_weighted_subgraph_with_the_required_paths::TEST ( minimum_weighted_subgraph_with_the_required_paths  ,
case1   
)

在文件 leetcode_test.cpp2218 行定义.

2218 {
2219 vector<vector<int>> edges = {{0, 2, 2}, {0, 5, 6}, {1, 0, 3}, {1, 4, 5}, {2, 1, 1}, {2, 3, 3}, {2, 3, 4}, {3, 4, 2}, {4, 5, 1}};
2220 ASSERT_EQ(9, Solution::minimumWeight(6, edges, 0, 1, 5));
2221 }

引用了 leetcode::minimum_weighted_subgraph_with_the_required_paths::Solution::minimumWeight().

◆ TEST() [2/4]

leetcode::minimum_weighted_subgraph_with_the_required_paths::TEST ( minimum_weighted_subgraph_with_the_required_paths  ,
case2   
)

在文件 leetcode_test.cpp2223 行定义.

2223 {
2224 vector<vector<int>> edges = {{0, 1, 1}, {2, 1, 1}};
2225 ASSERT_EQ(-1, Solution::minimumWeight(3, edges, 0, 1, 2));
2226 }

引用了 leetcode::minimum_weighted_subgraph_with_the_required_paths::Solution::minimumWeight().

◆ TEST() [3/4]

leetcode::minimum_weighted_subgraph_with_the_required_paths::TEST ( minimum_weighted_subgraph_with_the_required_paths  ,
case3   
)

在文件 leetcode_test.cpp2228 行定义.

2228 {
2229 vector<vector<int>> edges = {{4, 2, 20}, {4, 3, 46}, {0, 1, 15}, {0, 1, 43}, {0, 1, 32}, {3, 1, 13}};
2230 ASSERT_EQ(74, Solution::minimumWeight(5, edges, 0, 4, 1));
2231 }

引用了 leetcode::minimum_weighted_subgraph_with_the_required_paths::Solution::minimumWeight().

◆ TEST() [4/4]

leetcode::minimum_weighted_subgraph_with_the_required_paths::TEST ( minimum_weighted_subgraph_with_the_required_paths  ,
case4   
)

在文件 leetcode_test.cpp2233 行定义.

2233 {
2234 vector<vector<int>> edges = {{31, 64, 44}, {31, 6, 14}, {46, 21, 45}, {46, 65, 27}, {46, 30, 46}, {31, 0, 14}, {31, 29, 40}, {46, 95, 6}, {46, 73, 62}, {31, 74, 16}, {31, 55, 35}, {46, 40, 89}, {46, 57, 93}, {31, 90, 27}, {46, 58, 59}, {46, 12, 80}, {31, 44, 26}, {46, 67, 82}, {31, 8, 64}, {31, 23, 15}, {31, 7, 27}, {31, 94, 33}, {31, 86, 36}, {31, 33, 61}, {46, 88, 46}, {46, 69, 76}, {46, 39, 89}, {46, 53, 17}, {31, 75, 69}, {31, 72, 30}, {46, 83, 87}, {31, 35, 86}, {31, 62, 84}, {46, 51, 47}, {46, 66, 16}, {46, 50, 85}, {46, 81, 65}, {46, 36, 89}, {46, 60, 21}, {46, 10, 76}, {31, 18, 70}, {46, 3, 93}, {31, 47, 52}, {46, 16, 61}, {31, 15, 77}, {46, 28, 3}, {31, 93, 53}, {46, 43, 94}, {31, 38, 25}, {46, 1, 42}, {31, 22, 49}, {46, 45, 55}, {46, 99, 43}, {46, 24, 90}, {31, 9, 28}, {46, 13, 15}, {46, 27, 93}, {46, 49, 83}, {31, 71, 51}, {31, 59, 93}, {31, 91, 98}, {31, 54, 67}, {31, 25, 75}, {31, 68, 24}, {31, 76, 13}, {31, 41, 31}, {31, 19, 36}, {31, 87, 37}, {46, 17, 70}, {46, 97, 46}, {46, 61, 82}, {46, 79, 74}, {46, 85, 18}, {46, 14, 74}, {31, 32, 60}, {46, 84, 69}, {31, 34, 69}, {31, 4, 13}, {46, 70, 27}, {31, 48, 27}, {31, 11, 63}, {46, 5, 14}, {46, 37, 88}, {31, 96, 70}, {46, 52, 17}, {46, 42, 9}, {46, 20, 68}, {31, 77, 79}, {31, 80, 68}, {46, 78, 13}, {46, 26, 48}, {46, 2, 10}, {46, 63, 6}, {31, 89, 66}, {31, 56, 96}, {46, 92, 36}, {46, 98, 12}, {46, 82, 94}, {8, 82, 84}, {92, 82, 23}, {40, 82, 98}, {39, 82, 67}, {86, 82, 37}, {75, 82, 21}};
2235 ASSERT_EQ(132, Solution::minimumWeight(100, edges, 46, 31, 82));
2236 }

引用了 leetcode::minimum_weighted_subgraph_with_the_required_paths::Solution::minimumWeight().