摘要: 一道很裸的数位dp。 //Serene #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<cmath> using namespace std; c 阅读全文
posted @ 2017-10-05 16:05 shixinyi 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 题意:给出l、r,求区间[l,r]内二进制中0的个数大于等于1的个数的数字有多少个. 简单的数位dp。 //Serene #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdi 阅读全文
posted @ 2017-10-05 11:17 shixinyi 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 水题。随便搞搞就过了。 //Serene #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<cmath> using namespace std; 阅读全文
posted @ 2017-10-05 10:23 shixinyi 阅读(192) 评论(0) 推荐(1) 编辑
摘要: 水题。 题目描述有坑,可以先根据样例手算试一试 //Serene #include<algorithm> #include<iostream> #include<cstring> #include<cstdlib> #include<cstdio> #include<cmath> using nam 阅读全文
posted @ 2017-10-05 10:05 shixinyi 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 数位dp。 因为我们知道如果有回文子串,一定有一个回文的中心。我们只要能找到一个满足长度$\geq 2$的回文中心就可以了。 也就是说找到一个满足$a[i]=a[i+1]$或$a[i]=a[i+2]$的地方就是萌数了。 但是还需要注意前导0的特殊处理、记忆化搜索的状态里面负数的处理(有-1的情况可以 阅读全文
posted @ 2017-10-05 09:18 shixinyi 阅读(348) 评论(0) 推荐(1) 编辑