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 |
求救数据.本不想这么轻易就向人求救的,可是被wa的,唉…… 哪位仁兄有数据能帮忙的,小弟多谢了! 程序: type arr=array[0..5000,1..3] of longint; var a:arr; i,j,k,l,n,s,t:longint; begin readln(n); a[0,1]:=maxlongint; a[0,2]:=1; a[0,3]:=1; for i:=1 to n do begin read(a[i,1]); a[i,2]:=1; a[i,3]:=1; end; l:=0; for i:=n downto 0 do begin k:=0;t:=1; for j:=i+1 to n do if a[i,1]>a[j,1] then begin if (a[j,2]>k) then begin k:=a[j,2]; t:=a[j,3]; end else if (a[j,2]=k) then inc(t,a[j,3]); end; a[i,2]:=k+1;a[i,3]:=t; if a[i,2]>l then l:=a[i,2]; end; s:=a[0,3];dec(l); writeln(l,' ',s); end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator