单调栈
yamatsui
这个作者很懒,什么都没留下…
展开
-
STL6-------F - Largest Rectangle in a Histogram
一道单调栈的好题,充分说明了我只是明白了原理但是并不会应用。 这是题源poj2559 不过我发现要理解单调栈还是要有逆向思维啊 我也是看了大佬的博客才稍微明白了一些。 下面是代码; #include <iostream> #include <cstdio> #include <algorithm> #include <stack> #include ...转载 2019-04-09 19:53:30 · 137 阅读 · 0 评论 -
STL6-----J - Passing the Message
来源hdu3410 这道题让我发现了单调栈的唯一性,即可以使得数组记录的位置不会重复。 代码如下: #include <iostream> #include <stack> #include <cstdio> #include <algorithm> #include <cstring> #define mem(a,b) memset (...原创 2019-04-09 22:18:20 · 104 阅读 · 0 评论