上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 36 下一页
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3674http://www.lydsy.com/JudgeOnline/problem.php?id=3673双倍经验啦啦啦。。给主席树换了个名称果然高大上。。。首先要可持久化并查集其实就是可持久化数组... 阅读全文
posted @ 2014-12-08 18:37 iwtwiioi 阅读(756) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=1179缩点建图。。。#include #include #include #include #include #include #include #include #include using name... 阅读全文
posted @ 2014-12-08 07:01 iwtwiioi 阅读(350) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3669首先看到题目应该可以得到我们要最小化min{ max{a(u, v)} + max{b(u, v)} }两个变量不好做。。。那么我们约束一个a即按a从小到大排序,依次加边。发现当有环出现时,去掉的... 阅读全文
posted @ 2014-12-08 00:03 iwtwiioi 阅读(620) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=1798之前写了个快速乘。。。。。。。。。。。。。。。。。。。。。。。。。。20多s。。。。。。还好1a。。那么本题就是维护两个tag即可。和上一题一样。#include #include #includ... 阅读全文
posted @ 2014-12-07 22:00 iwtwiioi 阅读(421) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2818我很sb的丢了原来做的一题上去。。其实这题可以更简单。。设$$f[i]=1+2 \times \phi (i) $$那么答案就是$$\sum_{p是质数} f[n/p]$$就丢原来的题了。。。不写... 阅读全文
posted @ 2014-12-07 17:01 iwtwiioi 阅读(742) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=1180今天状态怎么这么不好。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。又是调了好久。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。... 阅读全文
posted @ 2014-12-07 15:37 iwtwiioi 阅读(460) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3585好神的题。但是!!!!!!!!!!!!!!我线段树现在要开8倍空间才能过!!!!!!!!!!这什么梗。。。。。。。。。。。。。。。。。。。。。。我思考了很久空间的问题,因为我在pushdown的时... 阅读全文
posted @ 2014-12-07 14:39 iwtwiioi 阅读(1061) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2875矩阵的话很容易看出来。。。。。我就不写了。太水了。然后乘法longlong会溢出。。。那么我们用快速乘。。。就是将快速幂的乘法变成加法。。。这种很简单吧。。#include #include #i... 阅读全文
posted @ 2014-12-07 11:37 iwtwiioi 阅读(444) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2329和前一题一样,不就多了个replace操作吗。好,就打一下。然后交上去wa了。。。。。。。。。。。。。。。。。。。。看了题解,好神奇!记住:以后pushdown的tag要考虑先后顺序!因为inve... 阅读全文
posted @ 2014-12-07 11:06 iwtwiioi 阅读(585) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2209splay又犯逗。。。。。。。。upd1那里的sum忘记赋值反。。。。。。。。。。。。。本题好神。。首先发现将所有能匹配的消掉后一定是类似这样的))))((((,当然也有((((((这种情况还有本... 阅读全文
posted @ 2014-12-07 10:25 iwtwiioi 阅读(620) 评论(0) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=1251不行。。为什么写个splay老是犯逗,这次又是null的mx没有赋值-maxlongint...#include #include #include #include #include #incl... 阅读全文
posted @ 2014-12-07 00:14 iwtwiioi 阅读(457) 评论(0) 推荐(0) 编辑
摘要: http://uoj.ac/problem/31纪念伟大的没有调出来的splay。。。竟然那个find那里写错了!!!!!!!!!!!!!以后要记住:一定要好好想过!(正解的话我就不写了,太简单了。。#include #include #include #include #include #incl... 阅读全文
posted @ 2014-12-06 23:15 iwtwiioi 阅读(449) 评论(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 阅读(408) 评论(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 阅读(379) 评论(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 阅读(590) 评论(1) 推荐(0) 编辑
摘要: http://www.spoj.com/problems/SUBLEX/后缀自动机系列完成QAQ。。。撒花。。明天or今晚写个小结?首先得知道:后缀自动机中,root出发到任意一个状态的路径对应一个子串,而且不重复。(原因似乎是逆序后缀树?所以我们在自动机上预处理每一个状态的子串数目,然后从小到大枚... 阅读全文
posted @ 2014-12-05 13:20 iwtwiioi 阅读(441) 评论(0) 推荐(0) 编辑
摘要: http://www.spoj.com/problems/LCS2/发现了我原来对sam的理解的一个坑233本题容易看出就是将所有匹配长度记录在状态上然后取min后再对所有状态取max。但是不要忘记了一点:更新parent树的祖先。为什么呢?首先如果子树被匹配过了,那么长度一定大于任意祖先匹配的长度... 阅读全文
posted @ 2014-12-05 06:48 iwtwiioi 阅读(991) 评论(0) 推荐(2) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=2555 学到了如何快速维护right值orz (不过这仍然是暴力维护,可以卡到O(n) 首先我们在加一个新节点的时候直接遍历它的parent树就行啦啦!!!!这样直接就暴力维护了。。。我竟然没想到。。 阅读全文
posted @ 2014-12-04 17:21 iwtwiioi 阅读(999) 评论(3) 推荐(0) 编辑
摘要: http://www.lydsy.com/JudgeOnline/problem.php?id=3172随便搞个sam就行了。(其实一开始看到数据n#include #include #include #include #include #include #include #include usin... 阅读全文
posted @ 2014-12-04 13:50 iwtwiioi 阅读(728) 评论(0) 推荐(1) 编辑
摘要: http://www.spoj.com/problems/NSUBSTR/题意:给一个字符串S,令F(x)表示S的所有长度为x的子串中,出现次数的最大值。求F(1)..F(Length(S))这题做法:首先建立字符串的后缀自动机。所以对于一个节点$s$,长度范围为$[Min(s), Max(s)]$... 阅读全文
posted @ 2014-12-04 06:57 iwtwiioi 阅读(347) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 16 17 ··· 36 下一页