a,b,c:longint;
function w(a,b,c:longint):longint;
begin
if s[a,b,c]<>0 then exit(s[a,b,c]);
if (a<=0)or(b<=0)or(c<=0) then exit(1);
if (a>20)or(b>20)or(c>20) then exit(w(20,20,20));
if (a<b)and(b<c) then
begin
w:=w(a,b,c-1)+w(a,b-1,c-1)-w(a,b-1,c);
s[a,b,c]:=w;
end else
begin
w:=w(a-1,b,c)+w(a-1,b-1,c)+w(a-1,b,c-1)-w(a-1,b-1,c-1);
s[a,b,c]:=w;
end;
end;
begin
readln(a,b,c);
while (a<>-1)or(b<>-1)or(c<>-1) do
begin
fillchar(s,sizeof(s),0);
if (a<1)or(b<1)or(c<1) then writeln('w(',a,', ',b,', ',c,') = 1')
else writeln('w(',a,', ',b,', ',c,') = ',w(a,b,c));
readln(a,b,c);
end;
end.
测评机: Xeost[5]
得分: 80分
提交日期: 2010-10-4 9:51:00
有效耗时: 421毫秒
测试结果1: 运行错误|普通保护错误
测试结果2: 通过本测试点|有效耗时156ms
测试结果3: 通过本测试点|有效耗时47ms
测试结果4: 通过本测试点|有效耗时47ms
测试结果5: 通过本测试点|有效耗时171ms
要开到多大才行啊?太大了反而更有问题。
测评机: Xeond[6]
得分: 0分
提交日期: 2010-10-4 23:03:00
有效耗时: 该状态没有记录
测试结果1: 运行错误|普通保护错误
测试结果2: 运行错误|普通保护错误
测试结果3: 运行错误|普通保护错误
测试结果4: 运行错误|普通保护错误
测试结果5: 运行错误|普通保护错误
var s:array[-500..1000,-500..1000,-500..1000]of longint;
。。。。