上一页 1 2 3 4 5 6 7 ··· 16 下一页
摘要: 数论。。。答案就是前n-1个欧拉函数的总和再*2+1#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i<=r; i++)#define clr(x, c)... 阅读全文
posted @ 2015-05-05 18:09 NanoApe 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 线段树即可。。。区间各种混乱。。。开闭区间的话,可以在每两个数x,y中插入两个数,左边那个无限接近大于x,右边那个无限接近小于x。U操作:将[x,y]修改为TrueI操作:将除了[x,y]以外修改为FalseD操作:将[x,y]修改为FalseS操作:将[x,y]真假反转C操作:I操作+S操作#in... 阅读全文
posted @ 2015-05-05 18:00 NanoApe 阅读(182) 评论(0) 推荐(0) 编辑
摘要: LCT模版题。。。。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; in)#define l(x) c[x][0]#define r(x) c[x][1]... 阅读全文
posted @ 2015-05-05 17:27 NanoApe 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 树链剖分模版题。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; in)#define k(x) Key[x]#define t(x) Tree[x]#de... 阅读全文
posted @ 2015-05-05 17:21 NanoApe 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 树链剖分模版题。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; in)#define k(x) Key[x]#define t(x) Tree[x]#de... 阅读全文
posted @ 2015-05-05 17:19 NanoApe 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 离线做法:分别处理每个编号上的各种询问和操作,接着就能用树状数组维护。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i0) now+=s(x), x-=... 阅读全文
posted @ 2015-05-05 16:58 NanoApe 阅读(140) 评论(0) 推荐(0) 编辑
摘要: 神级数据结构维护题。。。Splay练手题。#include #include #include #include #include #include #include #define rep(i, l, r) for(int i=l; i q;inline void update(int x){ i... 阅读全文
posted @ 2015-05-05 16:55 NanoApe 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 本题被描述者现在才来做这道题。。。对我就是KPM。。。先Orz云神吧~把所有字符串反向建立一棵Trie,然后建立DFS序,那么Trie上的每个点的子树就对应着DFS序上的一段数。然后将每个字符串的标号插入,无修改的话只需要主席树。#include #include #include #include... 阅读全文
posted @ 2015-05-05 16:47 NanoApe 阅读(321) 评论(0) 推荐(0) 编辑
摘要: 貌似是先把各个子串处理成各个Hash值,然后离散化,然后这道题就变成询问区间[x,y]中有没有数字k。主席树直接上。。。#include #include #include #include #include #include #include #define rep(i, l, r) for(in... 阅读全文
posted @ 2015-05-05 16:18 NanoApe 阅读(167) 评论(0) 推荐(0) 编辑
摘要: FFT模版题。观察题目,我们可以发现,只要把序列b倒过来,再联想一下乘法运算。。。我们会发现,将序列a和序列b当作100进制数,做一次乘法,然后从低到高每一位便是答案了(乘完无需进位)#include #include #include #include #include #include #inc... 阅读全文
posted @ 2015-05-05 16:07 NanoApe 阅读(177) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 16 下一页
AmazingCounters.com