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

LeetCode 1765. 地图中的最高点 更多...

class  Solution
 

函数

 TEST (map_of_highest_peak, case1)
 
 TEST (map_of_highest_peak, case2)
 

详细描述

LeetCode 1765. 地图中的最高点

函数说明

◆ TEST() [1/2]

leetcode::map_of_highest_peak::TEST ( map_of_highest_peak  ,
case1   
)

在文件 leetcode_test.cpp1102 行定义.

1102 {
1103 int input[2][2] = {{0, 1}, {0, 0}};
1104 auto vec_in = vector<vector<int>>();
1105 vec_in.resize(2);
1106 for(int i = 0; i < 2; i++) {
1107 vec_in[i] = vector(begin(input[i]), end(input[i]));
1108 }
1109 int output[2][2] = {{1, 0}, {2, 1}};
1110 auto vec_out = vector<vector<int>>();
1111 vec_out.resize(2);
1112 for(int i = 0; i < 2; i++) {
1113 vec_out[i] = vector(begin(output[i]), end(output[i]));
1114 }
1115 ASSERT_EQ(vec_out, Solution::highestPeak(vec_in));
1116 }

引用了 leetcode::map_of_highest_peak::Solution::highestPeak().

◆ TEST() [2/2]

leetcode::map_of_highest_peak::TEST ( map_of_highest_peak  ,
case2   
)

在文件 leetcode_test.cpp1118 行定义.

1118 {
1119 int input[3][3] = {{0, 0, 1}, {1, 0, 0}, {0, 0, 0}};
1120 auto vec_in = vector<vector<int>>();
1121 vec_in.resize(3);
1122 for(int i = 0; i < 3; i++) {
1123 vec_in[i] = vector(begin(input[i]), end(input[i]));
1124 }
1125 int output[3][3] = {{1, 1, 0}, {0, 1, 1}, {1, 2, 2}};
1126 auto vec_out = vector<vector<int>>();
1127 vec_out.resize(3);
1128 for(int i = 0; i < 3; i++) {
1129 vec_out[i] = vector(begin(output[i]), end(output[i]));
1130 }
1131 ASSERT_EQ(vec_out, Solution::highestPeak(vec_in));
1132 }

引用了 leetcode::map_of_highest_peak::Solution::highestPeak().