摘要: Description "传送门" Solution 算法1 12pts 指数算法随便乱搞。 算法2 36pts $O(n^3)$dp。 设$f_{i,j}$表示以位置$j$结尾,上一个决策点为$j$时的最小值。 转移也是显而易见的: 令 $s_i=\sum \limits_{j=1}^{i} a_ 阅读全文
posted @ 2019-12-12 20:43 newbielyx 阅读(483) 评论(0) 推荐(1) 编辑
摘要: 一道区间dp好题,在GZY的ppt里,同时在洛谷题解里看见了Itst orz。 题目大意 有n个带有颜色的方块,没消除一段长度为 $x$ 的连续的相同颜色的方块可以得到 $x^2$ 的分数,用一种最优的顺序消除所有方块使得得分最多。 Solution 一开始用的常规操作,设 $f_{i,j}$ 表示 阅读全文
posted @ 2019-11-21 08:03 newbielyx 阅读(209) 评论(0) 推荐(1) 编辑
摘要: Description "传送门" Solution 算法1 32pts 爆搜,复杂度$O((m+1)^n)$ 算法2 84pts 裸的dp,复杂度$O(n^3m)$ 首先有一个显然的性质要知道: 最多只有一种主要食材出现在超过一半的主要食材里。 接下来考虑如果只有前两个限制条件的情况,那么答案就是 阅读全文
posted @ 2019-11-19 19:55 newbielyx 阅读(457) 评论(0) 推荐(0) 编辑
摘要: syntax on set number set mouse=a set showmatch set autoindent set smartindent set tabstop=2 set shiftwidth=2 set autoread map <F5> : call Compile() <C 阅读全文
posted @ 2019-11-15 09:33 newbielyx 阅读(331) 评论(0) 推荐(1) 编辑