
===数据结构===
文章平均质量分 80
userluoxuan
这个作者很懒,什么都没留下…
展开
-
树状数组
http://www.topcoder.com/tc?module=Static&d1=tutorials&d2=binaryIndexedTrees#prob树状数组中用的d【】,每个点都有一定的管辖范围;如d[1]=a[1];d[2]=a[1]+a[2];d[3]=a[3];d[4]=a[1]+a[2]+a[3]+a[4];等等;这样转载 2014-07-28 16:44:29 · 457 阅读 · 0 评论 -
Word Puzzles(字典树)
DescriptionWord puzzles are usually simple and very entertaining for all ages. They are so entertaining that Pizza-Hut company started using table covers with word puzzles printed on them, possi原创 2014-08-08 15:00:09 · 2276 阅读 · 0 评论 -
Shortest Prefixes(字典树)
解题思路:和前面一道原创 2014-08-08 12:06:32 · 545 阅读 · 0 评论 -
I Hate It(线段树)
解题思路:线段树,点更新,求原创 2014-08-11 17:05:44 · 475 阅读 · 0 评论 -
Minimum Inversion Number(线段树)
解题思路:用线段树求逆序对。只需要原创 2014-08-11 17:07:19 · 691 阅读 · 1 评论 -
Billboard(线段树)
解题思路:题目大意是原创 2014-08-11 17:22:34 · 472 阅读 · 0 评论 -
Crane(线段树)
DescriptionACM has bought a new crane (crane -- jeřáb) . The crane consists of n segments of various lengths, connected by flexible joints. The end of the i-th segment is joined to the beginning原创 2014-08-14 15:17:42 · 1173 阅读 · 1 评论 -
A Simple Problem with Integers(线段树)
解题思路:区间更新,区间求和的模板题。AC代码:原创 2014-08-14 15:15:35 · 519 阅读 · 0 评论 -
Panda(线段树)
解题思路:用每个字符的下标记录原创 2014-08-14 16:19:59 · 768 阅读 · 0 评论 -
线段树模板
单点更新,区间求和:转载 2014-08-14 20:21:06 · 546 阅读 · 0 评论 -
Phone List(字典树 or 排序)
DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let’s say the phone catalogue listed these numbers:1. Emergency 911原创 2014-08-08 11:23:09 · 889 阅读 · 0 评论 -
IMMEDIATE DECODABILITY(字典树)
解题思路:这题和之前的原创 2014-08-08 14:57:19 · 463 阅读 · 0 评论 -
并查集(Union-Find)算法介绍
本文主要介绍解决动态连通性一类问题的一种算法,使用到了一种叫做并查集的数据结构,称为Union-Find。更多的信息可以参考Algorithms 一书的Section 1.5,实际上本文也就是基于它的一篇读后感吧。原文中更多的是给出一些结论,我尝试给出一些思路上的过程,即为什么要使用这个方法,而不是别的什么方法。我觉得这个可能更加有意义一些,相比于记下一些结论。转载 2014-08-01 10:54:25 · 559 阅读 · 0 评论 -
Japan(树状数组)
DescriptionJapan plans to welcome the ACM ICPC World Finals and a lot of roads must be built for the venue. Japan is tall island with N cities on the East coast and M cities on the West coast (M原创 2014-07-29 21:56:28 · 744 阅读 · 0 评论 -
Stars(树状数组)
解题思路:题目一开始没看懂,读了半天才知道是一颗原创 2014-07-28 20:34:35 · 488 阅读 · 0 评论 -
UFOs(三维树状数组)
解题思路:貌似原创 2014-07-30 14:07:25 · 572 阅读 · 0 评论 -
Mobile phones(二维树状数组)
解题思路:完全就是二维树状数组的模板原创 2014-07-30 12:57:56 · 488 阅读 · 0 评论 -
Ultra-QuickSort(树状数组 + 离散化)
DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence elements until the seq原创 2014-07-30 10:31:07 · 700 阅读 · 0 评论 -
敌兵布阵(树状数组)
解题思路:最基础的树状数组,原创 2014-07-28 17:29:56 · 485 阅读 · 0 评论 -
Babelfish(字典树 or map)
解题思路:这题用字典树做可以,用map映射做也可以,当然字典树效率原创 2014-08-08 14:43:07 · 630 阅读 · 0 评论 -
统计难题(字典树)
解题思路:直接原创 2014-08-08 11:20:53 · 542 阅读 · 0 评论 -
Mayor's posters(线段树 + 离散化)
DescriptionThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whim. The city coun原创 2014-08-14 15:50:50 · 1263 阅读 · 2 评论