单调栈
苏子散人
爱古风,爱代码。
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
hdu 1506(单调栈实现)
#include #include#includeusing namespace std;struct node{int w=1;long long h;}s[100005];int main(){ int n;while(scanf("%d",&n)!=EOF&&n){ int i; stackst; for(i=0;i<n;i++) { scanf("%ll原创 2016-07-24 11:07:14 · 822 阅读 · 0 评论 -
codeforces 631C Report(单调栈)
//题解:如果第j个操作在第i个操作后面且rj>=ri,则第i个操作可视为无效操作,根据操作区间长度//建立一个递减的单调栈,只需改变相差区间的数的排列顺序#include#includeusing namespace std;const int maxn=200005;long long a[maxn],b[maxn];int q[maxn],t[maxn],r[maxn];原创 2016-07-24 16:05:13 · 374 阅读 · 0 评论
分享