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

  1. 太平洋大西洋水流问题
更多...

struct  myeq
 
struct  myhash
 
class  Solution
 

函数

 TEST (pacific_atlantic_waterflow, case1)
 
 TEST (pacific_atlantic_waterflow, case2)
 

详细描述

  1. 太平洋大西洋水流问题

函数说明

◆ TEST() [1/2]

leetcode::pacific_atlantic_waterflow::TEST ( pacific_atlantic_waterflow  ,
case1   
)

在文件 leetcode_test.cpp3719 行定义.

3719 {
3720 vector<vector<int>> heights = {{1, 2, 2, 3, 5}, {3, 2, 3, 4, 4}, {2, 4, 5, 3, 1}, {6, 7, 1, 4, 5}, {5, 1, 1, 2, 4}};
3721 const vector<vector<int>> ans = {{0, 4}, {1, 3}, {1, 4}, {2, 2}, {3, 0}, {3, 1}, {4, 0}};
3722 ASSERT_EQ(ans, Solution::pacificAtlantic(heights));
3723 }

引用了 leetcode::pacific_atlantic_waterflow::Solution::pacificAtlantic().

◆ TEST() [2/2]

leetcode::pacific_atlantic_waterflow::TEST ( pacific_atlantic_waterflow  ,
case2   
)

在文件 leetcode_test.cpp3725 行定义.

3725 {
3726 vector<vector<int>> heights = {{2, 1}, {1, 2}};
3727 const vector<vector<int>> ans = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};
3728 ASSERT_EQ(ans, Solution::pacificAtlantic(heights));
3729 }

引用了 leetcode::pacific_atlantic_waterflow::Solution::pacificAtlantic().