Skip to content

Commit 27353b6

Browse files
authored
Create lc354-dp-hard.md
1 parent bc2fd7d commit 27353b6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

leetcode/lc354-dp-hard.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
https://leetcode.com/problems/russian-doll-envelopes/
2+
3+
给一个二维的子序列: (a_i,b_i) ,....,
4+
求最长覆盖路径: a_i<a_j && b_i < b_j
5+
6+
# 题解:
7+
8+
1. 二维LISO(NlogN)
9+
10+
同一维的LIS,设计cmp函数时注意,一定是在啊a[0]相同的情况下将a[1]替换为更小的。
11+
12+
```cpp
13+
static bool comp(vector<int>& v1, vector<int>& v2){
14+
return v1[0] < v2[0] || (v1[0]==v2[0] && v1[1] > v2[1]);
15+
}
16+
```

0 commit comments

Comments
 (0)