欢迎访问https://blog.youkuaiyun.com/lxt_Lucia~~
宇宙第一小仙女\(^o^)/~萌量爆表求带飞=≡Σ((( つ^o^)つ~ dalao们点个关注呗~
--------------------------------我只是一条可爱哒分界线-------------------------------
一、问题:
Description
DreamGrid is learning the LIS (Longest Increasing Subsequence) problem and he needs to find the longest increasing subsequence of a given sequence a1,a2,…,ana1,a2,…,an of length nn.
Recall that
-
A subsequence b1,b2,…,bmb1,b2,…,bm of length mm is a sequence satisfying b1 = ak1 , b2 = ak2 ,…, bm = akm b1 = ak1, b2 = ak2 ,…, bm = akm and 1≤ k1 < k2<⋯<km ≤ n1 ≤ k1 < k2 <⋯< km ≤n.
-
An increasing subsequence b1,b2,…,bm b1,b2,…,bm is a subsequence satisfying b1 < b2 < ⋯ < bm b1 < b2 <⋯< bm.
DreamGrid defines the helper sequence f1,f2,…,fn f1,f2,…,fn where fif