上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页
摘要: https://www.luogu.com.cn/problem/P3338 \(FFT\) \[ E_{i}=\sum_{j=1}^{i-1} \frac{q_j}{(i-j)^2}-\sum_{j=i+1}^{n} \frac{q_j}{(i-j)^2}\\ 改成下标从0开始\\ E_{i}=\ 阅读全文
posted @ 2020-08-01 12:47 GK0328 阅读(101) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/CF528D 字符串匹配$/NTT$ 如果$k=0$,那么$KMP$轻松解决 当$k>0$时,我们可以对每个字符分别考虑 例如样例,用$'A'$去匹配: \[ AGCAATTCAT\\ ACAT \] 将模式串和文本串中非$'A'\( 阅读全文
posted @ 2020-08-01 12:38 GK0328 阅读(150) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P5431 乘法逆元 注意,不能暴力算,否则必然$TLE$ 需要先通分,然后简单计算,从而优化时间复杂度 还需要火车头 \(C++ Code:\) #pragma GCC optimize(O2) #pragma GCC optimi 阅读全文
posted @ 2020-07-31 21:05 GK0328 阅读(129) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P5205 分治/多项式求逆 \[ 设G(n)^2 \equiv A(n) (\mod x^{\lceil \frac{n}{2} \rceil})\\ B(n)^2 \equiv A(n) (\mod x^{\lceil \frac 阅读全文
posted @ 2020-07-31 17:29 GK0328 阅读(97) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P6218 数位$DP$ 做一道简单题来复习一下数位$DP$ \[ dp[ws][del][zero]\\ ws表示当前处理到哪一位\\ del表示0的个数与1的个数的差值\\ zero表示当前数字是否全为前导0(定义true表示不全 阅读全文
posted @ 2020-07-31 16:50 GK0328 阅读(64) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P4238 \(NTT\) 递归求解 \[ 假设已知F(n)H(n) \equiv 1 (\mod x^{\lceil \frac{n}{2} \rceil} )\\ F(n)G(n)\equiv 1 (\mod x^{\lceil 阅读全文
posted @ 2020-07-30 21:04 GK0328 阅读(116) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P4721 分治$FFT$ \[ f_{i}=\sum_{j=1}^{i-1} f_{i-j} g_j \] 等式左右两边均存在函数$f$,无法直接$NTT$ 考虑到对于每个$f_i$,都是有满足$i<j$的$j$转移而来,因此考虑分 阅读全文
posted @ 2020-07-30 20:17 GK0328 阅读(72) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/CF786B 线段树优化建图 对于区间$[l,r]$,可以用线段树中的节点优化建图 对于从外面指向指定区间的边,它只能往下转移 例: 如果存在$v\rightarrow [l,r]$,那么一定存在$v\rightarrow [s,t] 阅读全文
posted @ 2020-07-30 17:34 GK0328 阅读(358) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P3807 卢卡斯定理 用于求解$n,m$较大和$n \ge p$的情况 结论$1$:对于$k \in [1,p-1]\(,有\){p \choose k} \equiv 0 (\mod p)$ 证明: \[ {p \choose k 阅读全文
posted @ 2020-07-29 19:53 GK0328 阅读(91) 评论(0) 推荐(0) 编辑
摘要: https://www.luogu.com.cn/problem/P2005 高精度除法 模板题,居然发现还没填上小学时高精除高精的坑(一定是我太菜了) 用减法模拟除法,只要大于除数,就暴力减,这一位的$ans++$ \(C++ Code:\) #include<cstdio> #include<i 阅读全文
posted @ 2020-07-29 19:01 GK0328 阅读(86) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 20 下一页