数据结构
benben-wgr
这个作者很懒,什么都没留下…
展开
-
HDU - 4699 Editor 对顶栈 双栈
首先我们理解光标的位置在数与数之间,我们有stack s1,s2, s1是用来存第一个数到第光标的位置,s2是用来存后面的数,当然 s1,s2的top都是离光标的位置比较近的;当操作I时,s1push就行了,在维护一下s1里面元素个数的前缀和sum[s1.size()]=sum[s1.size()-1]+y;当s1进入元素时前面的前缀和是不变的;当再次到这个位置可以重新利用,还要维护s1.siz...原创 2018-05-28 22:38:18 · 157 阅读 · 0 评论 -
POJ - 3784 Running Median 对顶堆 双优先级队列
For this problem, you will write a program that reads in a sequence of 32-bit signed integers. After each odd-indexed value is read, output the median (middle value) of the elements received so far.In...原创 2018-05-28 22:48:35 · 177 阅读 · 0 评论 -
POJ Snowflake Snow Snowflakes hash表
You may have heard that no two snowflakes are alike. Your task is to write a program to determine whether this is really true. Your program will read information about a collection of snowflakes, and ...原创 2019-01-17 20:30:18 · 235 阅读 · 0 评论