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 |
Re:为甚么这个不过,下面拍了无数组(与AC的程序)In Reply To:Re:为甚么这个不过,下面拍了无数组(与AC的程序) Posted by:hzoi_hexing at 2014-02-23 18:18:15 var n,i,l,r,x,mid:longint; f:array[0..10000]of longint; begin read(n); for i:=1 to n do begin read(x); l:=1;r:=f[0]; while l<r do begin mid:=(l+r)shr 1; if f[mid]<x then l:=mid+1 else r:=mid; end; if (l>=r)and(x>f[f[0]])then begin f[0]:=f[0]+1; f[f[0]]:=x; l:=f[0]; end else if x<f[l] then f[l]:=x; end; write(f[0]); end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator