Loading [MathJax]/jax/output/HTML-CSS/jax.js

随笔分类 -  数据结构-块状链表&分块

摘要:题意 求ni=1mj=1lcm(i,j)gcd(i,j)n,m<=500000) 分析 很显然要死推莫比乌斯 题解 设nm $$ \begin{aligned} ans & = \sum_{i=1}^{n} \sum_{ 阅读全文
posted @ 2015-11-22 15:59 iwtwiioi 阅读(476) 评论(0) 推荐(0) 编辑
摘要:题意T(T10000)次询问,每次给出a,b(1a,b107),求ai=1bj=1f((i,j))
其中f(n)表示n所含质因子的最大幂指数。f(1)=0。 分析以下默认ab<... 阅读全文
posted @ 2015-11-22 14:35 iwtwiioi 阅读(486) 评论(0) 推荐(0) 编辑
摘要:题意求ni=1mj=1(n mod i)(m mod j)[ij] mod 19940417, (n,m109) 分析以下均设nm<p $$\begin{align}&\sum_{i... 阅读全文
posted @ 2015-11-22 14:28 iwtwiioi 阅读(370) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3052题意:n个带颜色的点(m种),q次询问,每次询问x到y的路径上sum{w[次数]*v[颜色]},可以单点修改颜色。(n, m, qusing namespace std;const int N=1... 阅读全文
posted @ 2015-03-13 17:26 iwtwiioi 阅读(492) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3757题意:n个节点的树,每个点有一种颜色。现有m种询问,每次询问x y a b表示x到y的路径上颜色的种数且a颜色看成b颜色。(nusing namespace std;const int N=500... 阅读全文
posted @ 2015-03-11 20:47 iwtwiioi 阅读(517) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=1086题意:n个点的树,要求分块,使得每一块的大小在[b, 3b]内且块与某个点形成的块是连通的(某个点既可以是块内也可以在块外)(nusing namespace std;const int N=10... 阅读全文
posted @ 2015-03-11 13:49 iwtwiioi 阅读(375) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3239题意:原题很清楚了= =#include using namespace std;map s;typedef long long ll;int mpow(int a, int b, int p) ... 阅读全文
posted @ 2015-02-15 18:30 iwtwiioi 阅读(218) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2242题意:(前两个问略...)第三个问是,求axb(modp)最小的x,或者输出无解,它们范围都是109哒= =#include using namespace ... 阅读全文
posted @ 2015-02-15 18:29 iwtwiioi 阅读(322) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3834题意:求$max\{(i,j)\}, sminusing namespace std;int main() { int cs, smin, smax, wmin, wmax, ans; scanf... 阅读全文
posted @ 2015-02-05 14:53 iwtwiioi 阅读(260) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3434 题意:n维坐标中要找c个点使得c个点在一条线上且每一维的坐标单调递增且不能超过每一维限定的值m[i](n<=11, 2<=c<=20, m[i]<=100000) #include <bits/ 阅读全文
posted @ 2015-02-03 23:08 iwtwiioi 阅读(786) 评论(1) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2154题意:求ni=1mj=1lcm(i,j), $n,musing namespace std;typedef long long ll;const ... 阅读全文
posted @ 2015-02-02 22:59 iwtwiioi 阅读(1544) 评论(6) 推荐(1) 编辑
摘要:题意:给定一个长度为n的序列,m次询问,每次询问一个区间[l, r],求max(Ai xor Ai+1 xor Ai+2 ... xor Aj),其中lusing namespace std;const int nT=5000005, N=12005;struct node *null;struct... 阅读全文
posted @ 2015-02-01 12:02 iwtwiioi 阅读(655) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3809题意:n个元素(1#include #include #include #include #include #include #include #include #include using na... 阅读全文
posted @ 2015-01-07 17:49 iwtwiioi 阅读(293) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2818我很sb的丢了原来做的一题上去。。其实这题可以更简单。。设f[i]=1+2×ϕ(i)
那么答案就是pf[n/p]
就丢原来的题了。。。不写... 阅读全文
posted @ 2014-12-07 17:01 iwtwiioi 阅读(757) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3781还能不能再裸点。。#include #include #include #include #include #include #include #include #include using na... 阅读全文
posted @ 2014-12-06 13:31 iwtwiioi 阅读(413) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=3289很裸的莫队。。。离线了区间然后分块排序后,询问时搞搞就行了。本题中,如果知道[l,r]后,考虑如何转移[l,r+1],发现就是a[r+1]的颜色在这个区间的排名,然后$r-l+1-... 阅读全文
posted @ 2014-12-06 12:57 iwtwiioi 阅读(384) 评论(0) 推荐(0) 编辑
摘要:http://www.lydsy.com/JudgeOnline/problem.php?id=2038学了下莫队,挺神的orzzzz首先推公式的话很简单吧。。。看的题解是从http://foreseeable97.logdown.com/posts/158522-233333来的对于查询$[l,r... 阅读全文
posted @ 2014-12-05 18:24 iwtwiioi 阅读(592) 评论(1) 推荐(0) 编辑
摘要:http://tyvj.cn/Problem_Show.aspx?id=1463二分的话是水题啊。。为了学分块还是来写这题吧。。二分:#include #include #include #include #include #include using namespace std;#define r... 阅读全文
posted @ 2014-08-29 15:25 iwtwiioi 阅读(247) 评论(0) 推荐(0) 编辑

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