- (missing)
- 2009-09-06 13:37:13 @
program aa;
var a,b,c,d:array[1..10000]of longint;
f:array[0..500,0..500]of longint;
i,j,k,n,testcase,x,s,s1,s2:longint;
function min(x,y,z:longint):longint;
begin
min:=x;
if (y0 do
begin
inc(j);
d[j]:=i; dec(b[i]);
end;
for i:=1 to s1 do
for j:=i to s2-s1+i do
begin
if i=j then f:=f+abs(c[i]-d[j])
else
f:=min(f+abs(c[i]-d[j]),f,f);
end;
writeln(f);
end;
end.
0 条评论
目前还没有评论...