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 |
分享一个很精妙的2分int s = 0,e = n - 1; while(s < e) { int mid = (s + e + 1) >> 1; if(len[mid] <= num) s = mid; else e = mid - 1; } return s; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator