![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
普通dp
文章平均质量分 82
saragrean
这个作者很懒,什么都没留下…
展开
-
codeforces 603A. Alternative Thinking(数学找规律 或者 dp)
题目链接:【A. Alternative Thinking】输入一串长为n的01串,翻转其中的一段,所谓的翻转就是0变1,1变0,求最终最长01交替的序列长度样例1:10000011 翻转后得到 10100011 最终的长度就是5 (红色部分)方法一:数学找规律原先相邻的变化后仍然相邻,所以我们可以先算出原本就相邻的最长是多少,一个子串翻转后,我们的要求是最长交替01串原创 2015-12-03 20:23:16 · 969 阅读 · 0 评论 -
poj 1088滑雪(记忆化搜索)
题目链接:【poj 1088】#include #include #include #include #include #include using namespace std;int dp[110][110], a[110][110];int f[4][2] = {0,1,1,0,0,-1,-1,0};int n, m;bool is_ok(int x, int y){原创 2015-12-08 16:52:49 · 316 阅读 · 0 评论