- 看樱花
- 2009-08-24 22:16:09 @
编译通过...
├ 测试数据 01:答案正确... 0ms
├ 测试数据 02:答案正确... 0ms
├ 测试数据 03:答案正确... 0ms
├ 测试数据 04:答案正确... 0ms
├ 测试数据 05:答案正确... 0ms
├ 测试数据 06:答案正确... 0ms
├ 测试数据 07:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 08:答案正确... 0ms
├ 测试数据 09:答案错误... ├ 标准行输出
├ 错误行输出
├ 测试数据 10:答案正确... 0ms
---|---|---|---|---|---|---|---|-
Unaccepted 有效得分:80 有效耗时:0ms
program DT3;
var d,f,c,ll,rr:array[0..1000]of longint;
i,n,l,r,ans,j,k,count,p,q:longint;
begin
assign(input,'a.in');
reset(input);
{assign(output,'a.out');
rewrite(output);}
readln(n,l,r);
ans:=-maxlongint;
for i:=1 to n do
read(d[i]);
readln;
for i:=1 to n do
read(f[i]);
readln;
for i:=1 to n do
read(c[i]);
readln;
for i:=1 to n do
begin
rr[i]:=c[i]-d[i];
if rr[i]-f[i]>ans then ans:=rr[i]-f[i];
k:=rr[i];
p:=rr[i];
for j:=i+1 to n do
begin
p:=p+c[j]-r;
if p-f[j]>ans then ans:=p-f[j];
k:=k+c[j]-l-r;
if k>rr[i]then rr[i]:=k;
end;
if rr[i]-f[i]>ans then ans:=rr[i]-f[i];
ll[i]:=c[i]-d[i];
k:=ll[i];p:=ll[i];q:=rr[i];
for j:=i-1 downto 1 do
begin
p:=p+c[j]-l;
if p-f[j]>ans then ans:=p-f[j];
k:=k+c[j]-l-r;
if k>ll[i]then ll[i]:=k;
q:=q+c[j]-l;
if q-f[j]>ans then ans:=q-f[j];
end;
if ll[i]-f[i]>ans then ans:=ll[i]-f[i];
q:=ll[i];
for j:=i+1 to n do
begin
q:=q+c[j]-r;
if q-f[j]>ans then ans:=q-f[j];
end;
end;
writeln(ans);
close(output);
end.