摘要: 8222. SubstringsProblem code: NSUBSTRYou are given a string S which consists of 250000 lowercase latin letters at most. We define F(x) as the maximal ... 阅读全文
posted @ 2015-01-10 20:31 Mr.Ren~ 阅读(381) 评论(0) 推荐(0) 编辑
摘要: 一道比较好的树分治的题目.大力推荐~Query on the subtreeTime Limit: 16000/8000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 479Accept... 阅读全文
posted @ 2015-01-10 19:52 Mr.Ren~ 阅读(385) 评论(0) 推荐(0) 编辑
摘要: 1812. Longest Common Substring IIProblem code: LCS2A string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the s... 阅读全文
posted @ 2015-01-09 20:49 Mr.Ren~ 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1811. Longest Common SubstringProblem code: LCSA string is finite sequence of characters over a non-empty finite set Σ.In this problem, Σ is the set o... 阅读全文
posted @ 2015-01-07 22:18 Mr.Ren~ 阅读(229) 评论(0) 推荐(0) 编辑
摘要: Glass BeadsTime Limit: 3000MSMemory Limit: 10000KTotal Submissions: 2827Accepted: 1634DescriptionOnce upon a time there was a famous actress. As you m... 阅读全文
posted @ 2015-01-07 22:00 Mr.Ren~ 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 2666. Query on a tree IVProblem code: QTREE4You are given a tree (an acyclic undirected connected graph) with N nodes, and nodes numbered 1,2,3...,N. ... 阅读全文
posted @ 2015-01-06 22:53 Mr.Ren~ 阅读(176) 评论(0) 推荐(0) 编辑
摘要: 我的树分治#3.After the success of 2nd anniversary (take a look at problem FTOUR for more details), this 3rd year, Travel Agent SPOJ goes on with another di... 阅读全文
posted @ 2015-01-05 20:35 Mr.Ren~ 阅读(250) 评论(0) 推荐(0) 编辑
摘要: 这个是非常经典的树分治的题目,关于60分的做法.参见poj1741按照树分治的惯例,先全局统计,然后再减掉重复的东西.那么如何计算贡献呢?我们按照poj1741的方法.先将满足一维的情况的数据全部放入一个树状数组里面,然后我们就能够一维统计了.复杂度O(nlog2n)代码也比较凑合....#incl... 阅读全文
posted @ 2015-01-04 21:49 Mr.Ren~ 阅读(208) 评论(0) 推荐(0) 编辑
摘要: Cubes:我们先将每个正方形的光路投影找出来(在y轴上的截距所构成的区间)然后,我们再考虑按照光线射到的先后顺序加入每个方格。再用线段树统计这个投影区间内的最小高度的光线。这样我们就能够算出每个点被照亮的高度。复杂度O(n2logn+).注意:在计算区间的时候选择前闭后开区间,这是因为我们要满足两... 阅读全文
posted @ 2015-01-04 21:40 Mr.Ren~ 阅读(202) 评论(0) 推荐(0) 编辑