各位神牛帮忙看看这代码!
为什么会是215错误?
program ple;
var t,w,v:array[0..1000] of longint;
f:array[0..25,0..80] of longint;
i,j,k,o,m,n,temp,ans:longint;
function getf(x,y:longint):longint;
begin
if (x<=0) and (y<=0) then exit(0);
if x<=0 then x:=1;
if y<=0 then y:=1;
exit(f[x,y]);
end;
begin
assign(input,'ple.in');
reset(input);
assign(output,'ple.out');
rewrite(output);
readln(o,n);
readln(m);
for i:=1 to 21 do
for j:=1 to 79 do
f[i,j]:=maxlongint-1;
for i:=1 to n do
for j:=o downto 1 do
for k:=n downto 1 do
begin
ans:=getf(j-t,k-v);
temp:=w+ans;
if temp<f[j,k] then f[j,k]:=temp;
end;
writeln(f[o,n]);
close(input);
close(output);
end.
数据:
5 60
5
3 36 120
10 25 129
5 50 250
1 45 130
4 20 119
那怎么改呢?
|