- 奶牛排队
- 2009-06-08 08:25:25 @
var n,ans,i,j,k:longint;
x,y,a:array[0..100000]of longint;
begin
read(n);
for i:=1 to n do read(a[i]);
x[n]:=n+1;y[n]:=n+1;
for i:=n-1 downto 1 do
begin
j:=i+1;
while ja[i] then break else j:=x[j];
x[i]:=j;
end;
for i:=n-1 downto 1 do
begin
j:=i+1;
while j
0 条评论
目前还没有评论...