随笔分类 - OJ-UVA
摘要:题目链接 题目 Bubu’s bookshelf is in a mess! Help him! There are nbooks on his bookshelf. We define the mess value to be the number of segments of consecuti
阅读全文
摘要:题目链接 首先先预处理,把连续方块合一,变成 P2135 方块消除。 没错这题是双倍经验 设 \(dp(i, j, k)\) 为区间 \([i, j]\) 内后面与 \(a[j]\) 相同颜色的方块有 \(k\) 个,然后分两种情况考虑。 直接把 \([i, j-1]\) 裁掉,于是 \(dp(i,
阅读全文