Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

What wrong???

Posted by TishkinDmitriy at 2005-08-05 15:20:35 on Problem 2533
var p:array[0..10000] of integer;
var i,l,m,n,r,t,u:integer;
begin {assign(input,'inp.1');reset(input);}
read(n);p[0]:=0;u:=0;
for i:=1 to n do begin 
l:=1; r:=u;read(t);
repeat 
    m:=(l+r)div 2;if t<p[m]  then r:=m-1 else l:=m+1
  until l>r;
p[l]:=t;if l>u then u:=l;
end;
write(u);
end.


Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator