快速卷积
文章平均质量分 91
Steaunk
Remember to look up at the stars and not down at your feet. Be curious and however difficult life may seem, there is always something you can do and succeed at. - SH
展开
-
FWT模板(loading)
ci=∑j⊗k=iajbk=∑0≤k<2n∑0≤j<2n[j⊗k=i]ajbkci=∑j⊗k=iajbk=∑0≤k<2n∑0≤j<2n[j⊗k=i]ajbkc_i = \sum_{j \otimes k = i} a_j b_k= \sum_{0 \le k < 2^n} \sum_{0\le j < 2^n} [j \otimes k = i] a_j b_k  ...原创 2017-12-14 16:59:19 · 351 阅读 · 0 评论 -
FFT模板
《算法导论》上写的是真不错。FFT递归版,常数有点大呀。#include <cstdio>#include <cmath>#include <cstring>#define R register#define db long double#define ll long longconst int Length = 1 << 1...原创 2017-12-16 15:41:19 · 254 阅读 · 0 评论 -
「51Nod 1824」染色游戏
Description很奇妙,FMT 有趣题。首先可以一眼(或两眼)看出(或推出)式子:f(t)≡∑x=0t(tx)rxbt−xmod2f(t)≡∑x=0t(tx)rxbt−xmod2f(t)\equiv \sum_{x=0}^{t}{t \choose x} r_x b_{t-x} \mod 2这好像是个卷积,FFT???然后就想歪了。根据 Lucas 定理,我们有 (t...原创 2018-04-27 09:12:16 · 352 阅读 · 1 评论