| ||||||||||
| 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 | |||||||||
我似乎就是线形查找的构造.......而且似乎我这样都没法用线段树.....里面有程序~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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator