摘要: /* 做的不多的位数dp 暴力的话 不知道多少组数据 会T 所以写dp 思路就和数学课本上那种“不超过xxx的x位偶数有几个” 这里可以类似的维护一个前缀和模样的东西(但又不同于前缀和) 状态:f[i][j] 表示以j开头的i位数符合条件的个数 (j可以是0) 然后可以已处理一下像是10000这种整的数 注意舍去不符合条件的 然后对于一个像123456这样不整的数 就从该高位逐位找 以此类推... 阅读全文
posted @ 2016-05-16 18:15 一入OI深似海 阅读(226) 评论(0) 推荐(0) 编辑
摘要: #include #include #include #define maxn 100010 using namespace std; int n,m,num,a[maxn],tmp[maxn]; char s[100]; struct node { int l,r; int lc,rc; int s[7],bj; }t[maxn*2+100]; int init() {... 阅读全文
posted @ 2016-05-16 16:07 一入OI深似海 阅读(185) 评论(0) 推荐(0) 编辑