摘要: http://cogs.pro:8080/cogs/problem/problem.php?pid=1669 "The Real Incantation is Their Common Increasing Subsequence of Maximal Possible Length" 真正的咒语是 阅读全文
posted @ 2018-09-03 22:20 Manjusaka丶梦寒 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 首先点名一个串叫 L1,另一个叫L2。 明显的是一个DP,那么我们来探讨下如何求得答案。 朴素的算法 首先我们定义状态$dp[ i ][ j ]$表示L1中前i个与L2中前j个的最长公共上升子序列。 最外层枚举i,第二层枚举j,那么L1[i]和L2[j]要么相等,要么不相等,分情况讨论。 ■ L1[ 阅读全文
posted @ 2018-09-03 22:19 Manjusaka丶梦寒 阅读(362) 评论(1) 推荐(2) 编辑