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

哪位懂PASCAL的高手看看

Posted by 1993623 at 2008-11-08 21:43:23
3250老出超时啊!为什么啊!!!!!!
program z;
Var
  n,i,j,k,v,count:Longint;
  a: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:
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