| ||||||||||
| 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 | |||||||||
Re:我这个Pascal 17行0MS是不是更精髓呢In Reply To:30L精髓16ms在线算法 Posted by:kill_myself at 2011-07-14 21:47:25 var
p,w:array[0..20]of longint;
t,n,i,j:longint;
begin
readln(t);
repeat
dec(t);
readln(n);
for i:=1 to n do read(p[i]);
for i:=1 to n do
for j:=i-1 downto 0 do
if p[i]-p[j]>=i-j then
begin w[i]:=i-j; break; end;
for i:=1 to n-1 do write(w[i],' ');
writeln(w[n]);
until t=0;
end.
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator