【bzoj1113】[Poi2008]海报PLA
2014-06-04 19:57
225 查看
#include<iostream> #include<cstdio> #include<stack> using namespace std; int n,a,ans; stack<int> s; inline int read(){ int x=0,f=1;char ch=getchar(); while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();} while(ch>='0'&&ch<='9'){x*=10;x+=ch-'0';ch=getchar();} return x*f; } int main(){ n=read(); for(int i=1;i<=n;i++){ a=read();a=read(); while(!s.empty()&&a<=s.top()){ if(a==s.top())ans++; s.pop(); } s.push(a); } printf("%d",n-ans); return 0; }
相关文章推荐
- bzoj1113【poi2008】海报PLA
- 【Poi2008】【BZOJ1113】海报PLA
- BZOJ1113 [Poi2008]海报PLA 【分治 + 线段树】
- BZOJ1113: [Poi2008]海报PLA
- BZOJ 1113: [Poi2008]海报PLA 裸单调栈
- [单调栈] BZOJ 1113 [Poi2008]海报PLA & BZOJ 1628 [Usaco2007 Demo]City skyline
- bzoj 1113: [Poi2008]海报PLA(栈)
- bzoj1113 [Poi2008]海报PLA(单调栈)
- bzoj1113: [Poi2008]海报PLA
- [bzoj1113][POI2008]海报PLA(单调栈)
- bzoj 1113: [Poi2008]海报PLA 分治
- BZOJ——T 1113: [Poi2008]海报PLA
- bzoj1113[Poi2008]海报PLA 单调栈
- bzoj 1113: [Poi2008]海报PLA
- BZOJ 1113: [Poi2008]海报PLA 单调栈
- BZOJ 1113 [Poi2008]海报PLA 单调栈
- Bzoj1113:[Poi2008]海报PLA:贪心+单调栈
- BZOJ 1113: [Poi2008]海报PLA
- BZOJ 1113 [Poi2008]海报PLA 单调栈
- [BZOJ 1113][Poi2008]海报PLA:单调栈