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 |
为什么超时了?program z; Var n,i,j,k,v,count:Longint; a,ans:Array [1..80000] of Longint; Begin Readln(n); v:=0; For i:=1 to n do Readln(a[i]); For i:=1 to n - 1 do begin k:=i + 1; count:=0; While (a[i]>a[k])and(k<=n) do begin Inc(count);Inc(k);end; v:=v+count; end; Writeln(v); End. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator