Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
给大家演示演示stl的imba#include<cstdio> #include<stdint.h> #include<vector> #include<algorithm> #include<functional> int main() { // freopen("03671.in","r",stdin); // freopen("03671.out","w",stdout); uint32_t n; fscanf(stdin,"%u",&n); std::vector<uint32_t> va; for(uint32_t a,i(0);i!=n;++i) { fscanf(stdin,"%u",&a); std::vector<uint32_t>::iterator iter(std::lower_bound(va.begin(),va.end(),a,std::less_equal<uint32_t>())); if(iter==va.end()) va.push_back(a); else *iter=a; } fprintf(stdout,"%u\n",n-va.size()); return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator