![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
黑科技
fo0Old
This is fold from China.
展开
-
matrix fast pow
const int mod=998244353; //改modstruct matrix{ int n,m; ll ma[105][105]; matrix(int x,int y):n(x),m(y) { memset(ma,0,sizeof(ma)); } matrix operator*(matrix& x) {原创 2017-09-16 22:11:51 · 565 阅读 · 0 评论 -
差分与树状数组
一维树状数组长度为nnn的序列: a1,a2,⋯ ,ana_1,a_2,\cdots,a_na1,a2,⋯,an一阶差分与前缀和一阶差分数组: di=ai−ai−1(a0=0)d_i=a_i-a_{i-1}\qquad(a_0=0)di=ai−ai−1(a0=0)考虑序列aaa第mmm项:am=∑i=1mdia_m=\sum\limits_{i=...原创 2019-03-03 21:45:32 · 562 阅读 · 0 评论