- The Moment-遇见
- 2010-04-09 17:12:51 @
program vijos_1280;
var n:integer;
f:array[0..61,0..31,-100..100]of boolean;
a:array[0..100,0..100]of integer;
procedure init;
var i,j:longint;
begin
assign(input,'v_1280.in');reset(input);
readln(n);
for i:=1 to n*2-1 do
for j:=1 to n-abs(n-i) do
read(a);
close(input);
end;
procedure main;
var i,j,k,min:longint;
begin
f[2*n-1,1,a[2*n-1,1]]:=true;
for i:=2*n-2 downto n do
for j:=1 to n-abs(n-i) do
for k:=-50 to 50 do
begin
if f then
f[i,j,a+k]:=true;
if f then
f[i,j,k-a]:=true;
if f then
f[i,j,a+k]:=true;
if f then
f[i,j,k-a]:=true;
end;
for i:=n+1 downto 1 do
for j:=1 to n-abs(n-i) do
for k:=-50 to 50 do
begin
if f then
f[i,j,a+k]:=true;
if f then
f[i,j,k-a]:=true;
if f then
f[i,j,a+k]:=true;
if f then
f[i,j,k-a]:=true;
end;
min:=maxint;
for i:=-50 to 50 do
if (f[1,1,i])and(abs(i)
1 条评论
-
ksj275172111 LV 7 @ 2010-04-09 17:19:26
.
我把 for k:=-50 to 50 do
改成 for k:=-100 to 100 do
结果第3个点对了 又多错了两个点。 只有60分。
哪个大牛能解释下。。
- 1