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

我似乎就是线形查找的构造.......而且似乎我这样都没法用线段树.....里面有程序~

Posted by palmtenor at 2005-05-10 14:58:30 on Problem 2182
In Reply To:刚才没想清楚,找第Ai+1个的时候想到线性查找上去了 Posted by:frkstyc at 2005-05-10 14:53:32
const
      maxn=8000;
var
      seq:array[1..maxn] of longint;
      i,j,k,l,m,n,t,s:longint;
begin
 while not eof(input) do begin
 readln(n);
 fillchar(seq,sizeof(seq),0);
 seq[1]:=1;
 for i:=2 to n do begin
  readln(seq[i]);
  inc(seq[i]);
  for j:=1 to i-1 do if seq[j]>=seq[i] then inc(seq[j]);
 end;
 for i:=1 to n do writeln(seq[i]);
end;
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