
数据结构
荷塘涟漪
这个作者很懒,什么都没留下…
展开
-
【线段树】hdu1166
敌兵布阵 Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的原创 2014-07-17 20:47:09 · 387 阅读 · 0 评论 -
【BFS+priority_queue】hdu 4198
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4198 题目大意: 给你一张地图,”S“为起点,"#"不能走,走过一个"."需要1个单位时间, 走过一个”@“需要d+1的单位时间,求中起点走出地图的最短时间…… 思路:我的第一反应是拆点……把一个“@”拆成d+1个,然后BFS但是这么写真的好麻烦啊! 可以用优先队列+BFS,先扩展路径长度比较短原创 2015-02-13 14:56:20 · 340 阅读 · 0 评论 -
【反素数+线段树求约瑟夫环】poj2886
Who Gets the Most Candies? Description N children are sitting in a circle to play a game. The children are numbered from 1 to N in clockwise order. Each of them has a card with a non-zero i原创 2014-08-19 11:51:17 · 484 阅读 · 0 评论 -
【map + 线段树】 hdu4893
Wow! Such Sequence! Problem Description Recently, Doge got a funny birthday present from his new friend, Protein Tiger from St. Beeze College. No, not cactuses. It's a mysterious blackbox.原创 2014-08-22 14:11:15 · 444 阅读 · 0 评论 -
【并查集】POJ 1182
食物链 Description 动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是"1 X Y",表示X和Y是同类。 第二种说法是"2 X Y",表示X吃Y。原创 2014-08-19 11:13:56 · 306 阅读 · 0 评论 -
【线段树】zoj1484
Minimum Inversion Number Time Limit: 2 Seconds Memory Limit: 65536 KB The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj.原创 2014-08-19 11:30:47 · 320 阅读 · 0 评论 -
【线段树】poj2828
Buy Tickets Time Limit: 4000MS Memory Limit: 65536K Total Submissions: 13383 Accepted: 6659 Description Railway tickets were difficult to buy around the Lunar New Y原创 2014-08-19 11:23:59 · 333 阅读 · 0 评论 -
【线段树】hdu1828 & poj1177
补题解开始…… timu A number of rectangular posters, photographs and other pictures of the same shape are pasted on a wall. Their sides are all vertical or horizontal. Each rectangle can be partially o原创 2014-08-19 10:13:05 · 347 阅读 · 0 评论 -
【线段树】hdu2795
Billboard Problem Description At the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible ann原创 2014-07-18 14:17:55 · 337 阅读 · 0 评论 -
【线段树】poj2777
Count Color Description Chosen Problem Solving and Program design as an optional course, you are required to solve all kinds of problems. Here, we get a new problem. There is a very long bo原创 2014-07-17 20:55:30 · 325 阅读 · 0 评论 -
【并查集】bzoj 1854
1854: [Scoi2010]游戏 Time Limit: 5 Sec Memory Limit: 162 MB Submit: 3683 Solved: 1398 [Submit][Status][Discuss] Description lxhgww最近迷上了一款游戏,在游戏里,他拥有很多的装备,每种装备都有2个属性,这些属性的值用[1,10000]之间的数表示。当他使用某原创 2016-05-05 20:39:03 · 263 阅读 · 0 评论