数据结构
日月火山
这个作者很懒,什么都没留下…
展开
-
Heap Operations(模拟优先队列)
Petya has recently learned data structure named "Binary heap".The heap he is now operating with allows the following operations: put the given number into the heap; get the value of the minimum原创 2017-07-18 08:44:38 · 434 阅读 · 0 评论 -
D - Feel Good (前缀和 单调栈)
Bill is developing a new mathematical theory for human emotions. His recent investigations are dedicated to studying how good or bad days influent people's memories about some period of life. A ne原创 2017-07-17 22:04:12 · 384 阅读 · 0 评论 -
Okabe and Boxes (栈 易)
Okabe and Super Hacker Daru are stacking and removing boxes. There are n boxes numbered from 1 to n. Initially there are no boxes on the stack.Okabe, being a control freak, gives Daru 2n commands: n原创 2017-07-16 19:57:41 · 476 阅读 · 0 评论 -
water problem(线段树 容易)
#include #include #include using namespace std;typedef long long ll;typedef struct node{ ll l,r; ll num;}node;const ll maxn = 100000;ll N,M,Q;node tree [maxn * 4];void build(ll l,原创 2017-07-16 10:34:57 · 444 阅读 · 0 评论 -
Just a Hook HDU - 1698 (线段树)
In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the same length. No原创 2017-07-22 21:47:51 · 334 阅读 · 0 评论 -
Largest Submatrix of All 1’s POJ - 3494(单调栈)
Given a m-by-n (0,1)-matrix, of all its submatrices of all 1’s which is the largest? By largest we mean that the submatrix has the most elements.InputThe input contains multiple test cases.原创 2017-07-24 13:50:41 · 293 阅读 · 0 评论 -
二叉树的遍历 (二叉树遍历转换)
本题有多组数据,输入处理到文件结束。每组数据的第一行包括一个整数n,表示这棵二叉树一共有n个节点。接下来的一行每行包括n个整数,表示这棵树的中序遍历。接下来的一行每行包括n个整数,表示这棵树的前序遍历。3Output每组输出包括一行,表示这棵树的后序遍历。Sample Input74 2 5 1 6 3 71 2 4 5 3 6 7Sample Output原创 2017-07-25 10:57:53 · 609 阅读 · 0 评论 -
Neat Tree 单调栈
链接:https://www.nowcoder.com/acm/contest/106/I来源:牛客网题目描述 It’s universally acknowledged that there’re innumerable trees in the campus of HUST. There is a row of trees along the East-9 Road whi...原创 2018-04-29 21:08:10 · 407 阅读 · 0 评论