city skyline【单调栈】

题目链接 单调栈(维护单调递增)。 矩形的宽度与答案无关,我们只需处理矩形的高度。 code #include<bits/stdc++.h> using namespace std; int h[50005],x,n,w; int ans,s[50005],top; inline int read() { int x=0,f=1; char c=getchar(); while(c<'0'||
相关文章
相关标签/搜索