摘要: 括号匹配,栈开始感觉题意很奇怪,表示这道题不会做。。。然而看了题解,原来并不是太难啊~!我太弱了,还是直接贴代码吧。。。#include #include #include #include #include #include #include #include #include #... 阅读全文
posted @ 2015-08-10 22:52 <Dash> 阅读(181) 评论(0) 推荐(0) 编辑
摘要: 如果确定了 ax 为最小值,那么包含 ax 并且以 ax 为最小值的区间个数是 O(N2) 的。因为序列中所有数的值非负,所以只需要考虑满足以上条件的最长区间即可。而包含 ax 并且以 ax 为最小值的最长区间可以用两次单调队列求出,最后对每个 ax 计算答案即可。#include ... 阅读全文
posted @ 2015-08-10 15:38 <Dash> 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 把转移方程优化一下,改变决策顺序就行了。。。#include #include #include #include #include #include #include #include #include #include #include #include #include tem... 阅读全文
posted @ 2015-08-10 15:37 <Dash> 阅读(201) 评论(0) 推荐(0) 编辑