
数据结构
文章平均质量分 84
Wiking__acm
这个作者很懒,什么都没留下…
展开
-
UVAlive 4035 Undetectable Tour
Mickey is assigned a task to help the puppies to escape by travelling from the south-west corner of a grid to the north-east corner undetected by the set of motion detectors deployed by Cruella. There原创 2014-11-11 09:40:00 · 1061 阅读 · 0 评论 -
ural 1306 Sequence Median
1306. Sequence MedianTime limit: 1.0 secondMemory limit: 1 MBLanguage limit: C, C++, PascalGiven a sequence of N nonnegative integers. Let's define the median of such sequence. If N is原创 2014-11-10 11:19:11 · 1335 阅读 · 0 评论 -
ZOJ Problem Set - 3261 Connections in Galaxy War(并查集)
Connections in Galaxy WarTime Limit: 3 Seconds Memory Limit: 32768 KBIn order to strengthen the defense ability, many stars in galaxy allied together and built many bidirectional tunnels原创 2014-11-09 20:30:38 · 1199 阅读 · 0 评论 -
uva 11165 Galactic Travel
Galactic TravelTime Limit: 3000MSMemory Limit: Unknown64bit IO Format: %lld & %llu[Submit] [Go Back] [Status] DescriptionProblem AGalactic Travel Input: Stan原创 2014-08-10 14:50:52 · 983 阅读 · 0 评论 -
splay tree python模板留存(from udacity software testing)
class Node: def __init__(self, key): self.key = key self.left = self.right = None def equals(self, node): return self.key == node.keyclass SplayTree: def __init_原创 2014-01-23 01:05:47 · 1431 阅读 · 1 评论 -
CF keks(单调队列)
Problem K. KeksInput le: stdinOutput le: stdoutTime limit: 2 secondsMemory limit: 256 megabytesMirko and Slavko are bored at math class again so they came up with new game. Mirko writes do原创 2013-10-24 17:44:11 · 1078 阅读 · 0 评论 -
hdu 2473 (并查集 删除操作)
Junk-Mail FilterTime Limit: 15000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5110 Accepted Submission(s): 1629Problem DescriptionRecogniz原创 2013-10-09 17:54:31 · 3470 阅读 · 0 评论 -
Poj 2082(单调栈)
Terrible SetsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 2778 Accepted: 1413DescriptionLet N be the set of all natural numbers {0 , 1 , 2 , . . . },原创 2013-08-15 00:46:04 · 1000 阅读 · 0 评论 -
Poj 2010(优先队列)
Moo University - Financial AidTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3708 Accepted: 1099DescriptionBessie noted that although humans have many un原创 2013-08-07 12:43:26 · 3010 阅读 · 2 评论 -
CF 189 div2 D
D. Psychos in a Linetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n psychos standing in a line. Each psyc原创 2013-06-24 14:57:28 · 813 阅读 · 0 评论 -
CF 172(div2) D(单调队列)
D. Maximum Xor Secondarytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBike loves looking for the second maximum el原创 2013-05-15 20:44:53 · 986 阅读 · 0 评论 -
CF 174(div2) C
C. Cows and Sequencetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputBessie and the cows are playing with sequences a原创 2013-05-14 21:09:33 · 919 阅读 · 0 评论 -
CF 179(div2) C(线段树 || 扫描法 )
C. Greg and Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGreg has an array a = a1, a2, ..., an andm operat原创 2013-05-12 09:16:48 · 1233 阅读 · 0 评论 -
uva 11488 - Hyper Prefix Sets(Trie)
HHyper Prefix SetsPrefix goodness of a set string is length of longest common prefix*number of strings in the set. For example the prefix goodness of the set {000,001,0011} is 6.Yo原创 2013-05-07 12:05:46 · 1381 阅读 · 0 评论 -
uva 12086 - Potentiometers(树状数组)
PotentiometersInput: Standard InputOutput: Standard OutputA potentiometer, or potmeter for short, is an electronic device with a variable electric resistance. It has two terminals and so原创 2013-05-06 19:33:10 · 1166 阅读 · 0 评论 -
uva 1428 - Ping pong(树状数组)
integers a1, a2...aN follow, indicating the skill rank of each player, in the order of west to east (1ai100000 , i = 1...N ).OutputFor each test case, output a single line contains an原创 2013-05-06 17:30:52 · 1392 阅读 · 0 评论 -
hdu 4544 湫湫系列故事——消灭兔子(优先队列 + 贪心)
Problem Description 湫湫减肥 越减越肥! 最近,减肥失败的湫湫为发泄心中郁闷,在玩一个消灭免子的游戏。 游戏规则很简单,用箭杀死免子即可。 箭是一种消耗品,已知有M种不同类型的箭可以选择,并且每种箭都会对兔子造成伤害,对应的伤害值分别为Di(1 假设每种箭只能使用一次,每只免子也只能被射一次,请计算要消灭地图上的所有兔子最少需要的Q原创 2013-03-31 21:47:55 · 1402 阅读 · 0 评论 -
uva 11987 Almost Union-Find(加权并查集)
Problem AAlmost Union-FindI hope you know the beautiful Union-Find structure. In this problem, you're to implement something similar, but not identical.The data structure you need to write is原创 2013-03-08 11:10:36 · 2558 阅读 · 0 评论 -
uva Hoax or what 11136(multiset)
开始以为要自己写最大最小堆,后来才知道set本身就是排好序的,囧。然后就是一直把end()当成了最后一个元素,错的离谱.所有删除的操作之前,都要记得判断是否为空,但因为这题保证了不会为空,所以不用判断原创 2013-03-06 14:41:56 · 1173 阅读 · 0 评论 -
hdu Minimum Inversion Number(线段树求逆序数有关问题的一个小归纳)
Minimum Inversion NumberTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4904 Accepted Submission(s): 2991Problem DescriptionT原创 2012-08-29 15:47:01 · 5456 阅读 · 3 评论 -
zoj Information Sharing(并查集)
Information SharingTime Limit: 3 Seconds Memory Limit: 65536 KBThere is going to be a test in the kindergarten. Since the kids would cry if they get a low score in the test, the teacher h原创 2012-08-26 23:44:42 · 885 阅读 · 0 评论 -
hdu Billboard (线段树)
BillboardTime Limit: 20000/8000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4097 Accepted Submission(s): 1907Problem DescriptionAt the entrance原创 2012-07-31 14:09:12 · 992 阅读 · 0 评论 -
poj Buy Tickets(线段树)
Buy TicketsTime Limit: 4000MS Memory Limit: 65536KTotal Submissions: 7802 Accepted: 3710DescriptionRailway tickets were difficult to buy around the Lunar New Ye原创 2012-07-31 12:43:22 · 2169 阅读 · 2 评论 -
hdu LCIS(线段树)
LCISTime Limit: 6000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1713 Accepted Submission(s): 748Problem DescriptionGiven n integers.You原创 2012-07-28 14:10:44 · 1728 阅读 · 2 评论 -
hdu Just a Hook (线段树)
Just a HookTime Limit : 4000/2000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 12 Accepted Submission(s) : 5Problem DescriptionIn the game of DotA,原创 2012-07-26 20:38:32 · 828 阅读 · 0 评论 -
Poj A Simple Problem with Integers(lazy线段树)
A Simple Problem with IntegersTime Limit : 10000/5000ms (Java/Other) Memory Limit : 262144/131072K (Java/Other)Total Submission(s) : 40 Accepted Submission(s) : 13Problem Description原创 2012-07-26 16:48:57 · 645 阅读 · 0 评论 -
hdu More is better (并查集)
More is betterTime Limit : 5000/1000ms (Java/Other) Memory Limit : 327680/102400K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 6Font: Times New Roman | Verdana | Georgi原创 2012-07-23 13:58:48 · 3788 阅读 · 1 评论 -
hdu Max Sum of Max-K-sub-sequence(单调队列)
Max Sum of Max-K-sub-sequenceTime Limit : 2000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 4Font: Times New Roman | Ver原创 2012-07-22 19:01:26 · 899 阅读 · 0 评论 -
hdu Non-negative Partial Sums(单调队列)
Non-negative Partial SumsTime Limit : 6000/3000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 1Font: Times New Roman | Verdana原创 2012-07-21 20:28:52 · 1636 阅读 · 0 评论 -
HDU I hate it(线段树)
I Hate ItTime Limit : 9000/3000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 6 Accepted Submission(s) : 2Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从原创 2012-07-16 20:17:44 · 4192 阅读 · 2 评论 -
hdu Hat‘s Words(字典树)
Hat’s WordsTime Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other)Total Submission(s) : 7 Accepted Submission(s) : 4Font: Times New Roman | Verdana | Georgia原创 2012-07-13 21:03:31 · 1023 阅读 · 0 评论 -
hdu Phone List (字典树)
Phone ListTime Limit : 3000/1000ms (Java/Other) Memory Limit : 32768/32768K (Java/Other)Total Submission(s) : 4 Accepted Submission(s) : 3Font: Times New Roman | Verdana | GeorgiaF原创 2012-07-13 13:33:30 · 1074 阅读 · 3 评论 -
hdu Flipper (用栈模拟)
#include #include #include using namespace std;int T;stack s[105];int main(){ int flag[105];//0 - up,1 - down int n,i,j; int pl,pr,p; int ans[105]; int outnum,out[105];原创 2012-07-11 15:50:00 · 900 阅读 · 0 评论