随笔分类 -  模板

摘要:类欧几里得算法 阅读全文
posted @ 2021-08-05 10:52 GhostCai 阅读(60) 评论(0) 推荐(1) 编辑
摘要:FFT NTT MTT FWT 阅读全文
posted @ 2021-08-04 16:45 GhostCai 阅读(53) 评论(0) 推荐(1) 编辑
摘要:将同余方程改写等式,用exgcd合并即可 #include<bits/stdc++.h> #define int __int128 using namespace std; int rd(){ int ret=0,f=1;char c; while(c=getchar(),!isdigit(c))f 阅读全文
posted @ 2021-08-03 19:50 GhostCai 阅读(33) 评论(0) 推荐(1) 编辑
摘要:好写的高精度模板 阅读全文
posted @ 2018-11-01 23:48 GhostCai 阅读(160) 评论(0) 推荐(0) 编辑
摘要:康拓展开/逆展开模板 阅读全文
posted @ 2018-10-28 18:24 GhostCai 阅读(105) 评论(0) 推荐(0) 编辑
摘要:左偏树,斜堆 阅读全文
posted @ 2018-09-13 00:11 GhostCai 阅读(87) 评论(0) 推荐(0) 编辑
摘要:点分治 阅读全文
posted @ 2018-08-14 15:34 GhostCai 阅读(127) 评论(0) 推荐(0) 编辑
摘要:约数个数函数 记d[i]为i的约数个数,e[i]为i的最小质因子个数。 void solve(){ d[1]=1; for(int i=2;i<=n;i++){ if(!isx[i]){prime[++cnt]=i;d[i]=2;e[i]=1;} for(int j=1;(i*prime[j]<=n 阅读全文
posted @ 2018-07-25 17:44 GhostCai 阅读(136) 评论(0) 推荐(0) 编辑
摘要:线性修改 阅读全文
posted @ 2018-07-10 21:51 GhostCai 阅读(300) 评论(0) 推荐(0) 编辑
摘要:细节挺多的。。 阅读全文
posted @ 2018-07-02 11:55 GhostCai 阅读(121) 评论(1) 推荐(0) 编辑
摘要:高斯消元 阅读全文
posted @ 2018-07-02 09:34 GhostCai 阅读(109) 评论(0) 推荐(0) 编辑
摘要:不定方程 阅读全文
posted @ 2018-07-01 21:46 GhostCai 阅读(122) 评论(0) 推荐(0) 编辑
摘要:HDU2222#include#include#include#include#define C(x) ((x)-('a'))using namespace std;const int MAXN=500005;int ch[MAXN][26],fail[MAXN],e... 阅读全文
posted @ 2018-06-25 20:48 GhostCai 阅读(123) 评论(1) 推荐(1) 编辑
摘要:由于中序遍历不会因为旋转改变,平衡树可以作为区间树使用。 翻转用打标记的方法,splay(x,y)代表把x接到以y为根的子树下面。#include#includeusing namespace std;const int MAXN=100005;int n,m;int... 阅读全文
posted @ 2018-06-14 08:51 GhostCai 阅读(109) 评论(0) 推荐(0) 编辑
摘要:欠了好久的Splay,以后就它了。 默写真不容易,过几天估计就忘了.. 整个Splay真的精妙,不拖泥带水那种.. 前驱后继之所以不能用rk转到根,是因为这个数不一定存在。。 kth中#include#define check(x) (x==ch[fa[x]][1])... 阅读全文
posted @ 2018-06-11 20:13 GhostCai 阅读(117) 评论(0) 推荐(0) 编辑
摘要:题目描述陶陶是个贪玩的孩子,他在地上丢了A个瓶盖,为了简化问题,我们可以当作这A个瓶盖丢在一条直线上,现在他想从这些瓶盖里找出B个,使得距离最近的2个距离最大,他想知道,最大可以到多少呢?输入输出格式输入格式:第一行,两个整数,A,B。(B#includeusing ... 阅读全文
posted @ 2018-06-04 11:42 GhostCai 阅读(110) 评论(0) 推荐(0) 编辑
摘要:dinic算法,在二分图上就是Hopcroft-Karp算法。#include#include#include#include#includeusing namespace std;const int MAXN=100005;const int INF=1 Q; ... 阅读全文
posted @ 2018-05-14 15:12 GhostCai 阅读(92) 评论(0) 推荐(0) 编辑
摘要:讲真 sublime挺好用的。 atom更吼 阅读全文
posted @ 2018-05-03 02:09 GhostCai 阅读(115) 评论(0) 推荐(0) 编辑
摘要:详解极其优秀的数据结构:宗法树 其实我写得非常简陋 代码量小,类似平衡树+线段树的功能(除了LCT都能做),跑得飞快网上没找到太多资料,先写一点宗法树是这样的一棵二叉树: 数据存储在叶子里,非叶子存储两个子树的最大值/最小值,左小右大,每个非叶子节点必须有两个叶子详解... 阅读全文
posted @ 2018-05-01 00:34 GhostCai 阅读(275) 评论(0) 推荐(0) 编辑
摘要:本质上是多棵线段树,动态开点,每次修改到root的一条链节约空间 可持久化数组(维护叶子节点的主席树) #include<iostream> #include<cstdio> using namespace std; inline int rd(){ int ret=0,f=1;char c; wh 阅读全文
posted @ 2018-04-28 23:59 GhostCai 阅读(155) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示