![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
-----data structure
文章平均质量分 81
hexiecs
Follow my heart.
展开
-
线段树成段更新 hdu 1698 Just a Hook
题意:给出n根金属棒,和操作数q,初始时每个金属棒价值都为1,每次操作可以把从x到y的金属棒更换材质,铜为1,银为2,金为3,最后统计所有的金属棒总价值是多少。线段树成段更新,需要用到lazy标记,所谓lazy标记就是:更新一个区间的时候不更新到底,只更新到第一个满足更新范围的区间(即范围内的最大的区间),然后给节点加上lazy标记,以后需要更新到该节点的子节点的时候,就把lazy标记原创 2015-05-21 01:03:44 · 930 阅读 · 0 评论 -
UVA 712 - S-Trees
题目如下:S-Trees A Strange Tree (S-tree) over the variable set is a binary tree representing a Boolean function.Each path of the S-tree begins at theroot node and consists原创 2014-05-28 19:04:00 · 1213 阅读 · 0 评论 -
UVA Quadtrees
题目如下;Quadtrees A quadtree is a representation format used to encode images. The fundamental ideabehind the quadtree is that any image can be split into four quadrants. Each原创 2014-05-27 12:27:21 · 1027 阅读 · 0 评论 -
UVA Tree
题目如下:Tree You are to determine the value of the leaf node in a given binary treethat is the terminal node of a path of least value from the root of thebinary tree to any le原创 2014-05-27 11:32:04 · 965 阅读 · 0 评论 -
UVA Tree Summing
题目如下: Tree Summing BackgroundLISP was one of the earliest high-level programming languages and, withFORTRAN, is one of the oldest languages currently being used. Lists,wh原创 2014-05-25 14:45:29 · 1056 阅读 · 0 评论 -
UVA Team Queue
题目如下:Team Queue Queues and Priority Queues are data structures which are known to most computer scientists. TheTeam Queue, however, is not so well known, though it occurs o原创 2014-05-19 00:14:28 · 1964 阅读 · 0 评论 -
UVA Parentheses Balance
题目如下:Parentheses Balance You are given a string consisting of parentheses () and []. A string of this type is said to be correct:(a) if it is the empty string (b) if A and B are原创 2014-05-09 19:08:16 · 1201 阅读 · 0 评论 -
UVA ShellSort
题目如下:Problem D: ShellSortHe made each turtle stand on another one's backAnd he piled them all up in a nine-turtle stack.And then Yertle climbed up. He sat down on the pile.What a wonderful v原创 2014-05-08 23:32:26 · 1000 阅读 · 0 评论 -
uva The Dole Queue
题目如下:The Dole Queue In a serious attempt to downsize (reduce) the dole queue, The NewNational Green Labour Rhinoceros Party has decided on the followingstrategy. Every day原创 2014-05-07 14:08:23 · 897 阅读 · 0 评论 -
uva ``Accordian'' Patience
题目如下:``Accordian'' Patience You are to simulate the playing of games of ``Accordian'' patience, the rules for which are as follows: Deal cards one by one in a row from left to right, no原创 2014-05-03 21:13:19 · 898 阅读 · 0 评论 -
UVA Oil Deposits
题目如下:Oil Deposits The GeoSurvComp geologic survey company is responsible for detectingunderground oil deposits. GeoSurvComp works with one large rectangularregion of land a原创 2014-06-21 00:47:43 · 1039 阅读 · 0 评论 -
UVA 784 Maze Exploration
题目如下:Maze Exploration A maze of rectangular rooms is represented on a twodimensional grid as illustrated in figure 1a. Each point of thegrid is represented by a character.原创 2014-06-30 17:26:13 · 968 阅读 · 0 评论 -
线段树单点更新 hdu 1754 I Hate It
题意:给n个学生的成绩,可以动态修改某个学生的成绩,要求动态查询某个区间学生的成绩的最大值。线段树单点更新题目,只需用一个数组存储当前节点对应的区间的成绩的最大值,并且把向上更新节点操作(pushup)改为更新该节点的两个子节点的最大值即可。代码:#include #include #include #include #include #incl原创 2015-05-19 23:55:43 · 664 阅读 · 0 评论 -
线段树入门题 hdu1166 敌兵布阵
题意:动态查询一段区间的和,支持单点更新。开始刷线段树了,这是入门第一题。。。最基本的线段树操作,递归建树,递归查询,递归修改,向上更新节点,每个节点的值代表该节点对应区间的和 。代码:#include #include #include #include #include #include#include #include #include原创 2015-05-19 11:06:35 · 671 阅读 · 0 评论 -
UVA 10129 Play on Words
题目如下:Play on WordsSome of the secret doorscontain a very interesting word puzzle. The team of archaeologists has tosolve it to open that doors. Because there is no other way to open the doors,原创 2014-07-04 16:16:40 · 1450 阅读 · 0 评论 -
UVA 10004 Bicoloring
题目如下:Bicoloring In 1976 the ``Four Color Map Theorem" was proven with the assistance of acomputer. This theorem states that every map can be colored using only fourcolors, in原创 2014-07-04 13:51:44 · 899 阅读 · 0 评论 -
UVA 10047 - The Monocycle
题目如下: Problem A: The Monocycle A monocycle is a cycle that runs on one wheel and the one we will be considering is a bit more special. It has a solid wheel colored with fiv原创 2014-07-04 13:39:23 · 1157 阅读 · 0 评论 -
UVA 10557 XYZZY
题目如下:Problem D: XYZZYADVENT: /ad�vent/, n.The prototypical computer adventure game, first designed by Will Crowther on the PDP-10 in the mid-1970s as an attempt at computer-refereed fantasy原创 2014-07-02 23:54:54 · 1049 阅读 · 0 评论 -
UVA 532 Dungeon Master
题目如下:Dungeon Master You are trapped in a 3D dungeon and need to find the quickest way out!The dungeon is composedof unit cubes which may or may not be filled with rock. It原创 2014-07-02 14:17:15 · 923 阅读 · 0 评论 -
UVA Knight Moves
题目如下:Knight Moves A friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each sq原创 2014-07-02 00:58:47 · 1186 阅读 · 0 评论 -
UVA 705 Slash Maze
题目如下:Slash Maze By filling a rectangle with slashes (/) and backslashes (), youcan generate nice little mazes. Here is an example:As you can see, paths in the maze cann原创 2014-07-01 19:57:48 · 967 阅读 · 0 评论 -
UVA The Blocks Problem
这道题自己一直WA,转载一篇别人的。。。代码转载 2014-05-03 12:09:46 · 713 阅读 · 0 评论