- 过河
- 2010-03-26 23:07:45 @
program p1002;
var
l,s,t,m,i,j,mid,best,tt:longint;
a,b:array[1..100] of longint;
f:array[-100..50000] of longint;
ans:array[1..50000] of boolean;
begin
readln(l);
readln(s,t,m);
for i:=1 to m do
read(a[i]);
for i:=1 to m-1 do
for j:=i+1 to m do
if a[i]>a[j] then begin tt:=a[i];a[i]:=a[j];a[j]:=tt; end;
if a[1]>100 then mid:=(a[1] div 100-1)*100;
b[1]:=a[1]-mid;
for i:=1 to m-1 do
begin
if a-a[i]>100 then mid:=mid+((a-a[i]) div 100-1)*100;
b:=a-mid;
end;
for i:=1 to m do
ans[b[i]]:=true;
if l-a[m]>100 then mid:=mid+((l-a[m]) div 100-1)*100;
l:=l-mid;
for i:=1 to s-1 do
f[i]:=10000;
for i:=s to l+t-1 do
begin
best:=1000;
for j:=s to t do
if f=f[i] then best:=f[i];
writeln(best);
end.
1 条评论
-
冷凌云 LV 8 @ 2010-03-27 20:07:52
如果第i个点和第i-1个点距离超过了100,你将第i个点和第i+1个点给缩进了,但是后面的点没有,有可能影响到第i+2个点和第i+1个点的关系,你仔细想想。应该缩进i~m所有点
- 1