摘要:
水题 19:46开始看题,20:09AC 就是大力dp啊,设dp[i][j]表示考虑到第i个点,距离它为j的数量,第一次倒推,求出子树中的,第二次正推,从父节点转移 转移见代码 阅读全文
摘要:
区间do 大力设状态,设dp[i][j][0/1]代表左右端点位i,j的区间,最后加入的是左端点还是右端点。转移: // luogu judger enable o2 include include include include include include include include in 阅读全文
摘要:
大力dp 首先设出状态:dp[i][j][k][0/1]代表了匹配到了a串的第i位,b串的第j位,已经选出了k次,这一位是否必须选,然后转移见代码吧qwq: 空间可能吃不消,用滚动数组优化第一位 include include include include include include incl 阅读全文