随笔分类 - 算法:dp > dp优化
摘要:books servers watchmen prison swaps xanadu \(\color{green}{\texttt{+8}}\) \(\color{green}{\texttt{+2}}\) \(\color{green}{\texttt{-}}\) \(\color{green}
阅读全文
摘要:链接 A. Bear and Colors 水题,直接扫两遍就好了 B. Bear and Two Paths 构造题。考虑 \(m=n\) 是一个环凑一凑发现不合法。所以一定是 \(m=n+1\)。 可以发现只要 \(n>4\) 一定可以放两个三元环,否则无解。 C. Levels and Reg
阅读全文
摘要:wqs二分&闵可夫斯基和学习笔记
阅读全文
摘要:链接 题目大意 给定一个 \(n\times m\) 的矩阵。 定义一个矩阵的元素如果全部相等那么他的“混乱度”为0。否则你可以用一条直线将其分为两个子矩阵,混乱度为两个子矩阵的混乱度较大值+1。 \(n\leq 185\) 题解 首先显然有一个 \(O(n^4\log n)\) 的dp:令 \(f
阅读全文