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 |
二分竟然不如暴力for(i=start;i<=end;i++){ if(stick[i]>ma) ma=stick[i] , mapo=i; else if(stick[i]<mi) mi=stick[i] , mipo=i; } if(mapo-mipo>bestlen){ bestlen=mapo-mipo; } if(mipo-1-start>bestlen) findlen(start,mipo-1); if(end-mapo-1>bestlen) findlen(mapo+1,end); 这样的二分差20ms就没过,还能改进吗? Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator