用生成函数套路推一推,推完老想NTT--实际上把这个多项式乘法看成dp然后前缀和优化一下即可 #include<iostream> #include<cstdio> using namespace std; const int N=1005,mod=1000000; int n,m,c[N],l,r,f[N*100],s[N],sum; int read() { int r=0,f=1; char p=getchar(); while(p>'9'||p<'0') { i…
题目链接 http://noi.openjudge.cn/ch0206/9289/ 描述 Bessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized that many of the ants were siblings, indistinguishable from one another. She also realize…