随笔分类 -  模板

关于BM算法求解线性递推的细节
摘要:关于BM算法求解线性递推的细节 网上已有相当多的讲解BM算法的文章,这里只讨论一些细节部分。 1.第一次遇到非零元素:那么下一个转移数组一定是由i个0组成的,其中i是已经访问过零元素个数加1。应为我们**当前**需要保存的只是对下一位可能正确并且前面必然正确的转移数组,若只有i-1个零,这一位上显然 阅读全文
posted @ 2021-02-24 22:51 GreenDuck 阅读(232) 评论(0) 推荐(0)
[模板]二次剩余(无讲解)
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long int ll; 4 typedef unsigned long long int ull; 5 ull SEED=1; 6 ll n,mod; 7 ll w; 8 阅读全文
posted @ 2019-10-20 18:42 GreenDuck 阅读(118) 评论(0) 推荐(0)
[模板]三维凸包(无讲解)
摘要:1 // luogu-judger-enable-o2 2 #include<bits/stdc++.h> 3 using namespace std; 4 typedef long double ld; 5 const int maxn=2E3+5; 6 const ld eps=1E-9; 7 阅读全文
posted @ 2019-09-13 12:45 GreenDuck 阅读(207) 评论(0) 推荐(0)
[模板]多项式封装(无讲解)
摘要:1 // luogu-judger-enable-o2 2 #include<bits/stdc++.h> 3 #define mod 998244353 4 #define G 3 5 #define Gi 332748118 6 using namespace std; 7 typedef lo 阅读全文
posted @ 2019-07-12 13:23 GreenDuck 阅读(239) 评论(1) 推荐(0)
[模板]计算几何模板
摘要:1.声明 1.博主比较菜,只会二维。还只会OI常用的。 2.不要吐槽换行。 3.精度、圆周率: 1 const ld eps=1E-10; 2 const ld pi=acos(-1); 3 const ld inf=1E9; 有时要long double,有时要int。 4.正确判相等: 1 in 阅读全文
posted @ 2019-05-12 19:58 GreenDuck 阅读(209) 评论(0) 推荐(0)
LCT模板(无讲解)
摘要:怎么说呢,照着打一遍就自然理解了,再打一遍就会背了,再打一遍就会推了。 1 // luogu-judger-enable-o2 2 #include<bits/stdc++.h> 3 using namespace std; 4 const int maxn=3E5+5; 5 int fa[maxn 阅读全文
posted @ 2019-04-13 18:38 GreenDuck 阅读(125) 评论(0) 推荐(0)
Miller Robbin测试模板(无讲解)
摘要:想着费马定理和二次探测定理就能随手推了。 做一次是log2n的。 1 #include<bits/stdc++.h> 2 using namespace std; 3 typedef long long int ll; 4 ll T,n; 5 ll qpow(ll x,ll y,ll mod) 6 阅读全文
posted @ 2019-04-08 14:54 GreenDuck 阅读(326) 评论(0) 推荐(0)
平面图转对偶图&19_03_21校内训练 [Everfeel]
摘要:对于每个平面图,都有唯一一个对偶图与之对应。若G‘是平面图G的对偶图,则满足: G'中每一条边的两个节点对应着G中有公共边的面,包括最外部无限大的面。 直观地讲,红色标出来的图就是蓝色标出的图的对偶图。 求出一个平面图的对偶图(而且不是特殊的结构),可以贪心地找出所有最小的面。但如何描述最小?我们要 阅读全文
posted @ 2019-03-21 18:26 GreenDuck 阅读(539) 评论(0) 推荐(0)
NTT模板(无讲解)
摘要:1 #include<bits/stdc++.h>//只是在虚数部分改了一下 2 using namespace std; 3 typedef long long int ll; 4 const ll maxn=1E6+5; 5 const ll mod=998244353; 6 const ll 阅读全文
posted @ 2019-03-18 19:01 GreenDuck 阅读(155) 评论(0) 推荐(0)
FFT模板(无讲解)
摘要:1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn=1E6+5; 4 const double pi=3.1415926535898; 5 int n,m,limit,r[maxn*4],len; 6 struct co 阅读全文
posted @ 2019-03-18 18:47 GreenDuck 阅读(215) 评论(0) 推荐(0)