摘要: 以前没写过这类题目 dp方程不难得到 f[i]=∑ f[j]*a[i-j] 这是卷积的形式,考虑用fft优化 虽然f[i]之前的值是未确定的,但是这里可以算贡献,用分治即可 具体的对于[l,r],先计算[l,mid]的f[],再计算f[l..mid]对f[mid+1..r]的贡献,最后计算f[mid 阅读全文
posted @ 2017-03-17 14:53 acphile 阅读(170) 评论(0) 推荐(0) 编辑
摘要: hdu5820 官方题解:http://www.cnblogs.com/duoxiao/p/5777700.html 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 struct node{int l,r,s;} tr[500010*40]; 阅读全文
posted @ 2017-03-17 14:49 acphile 阅读(189) 评论(0) 推荐(0) 编辑