- 数字游戏
- 2009-01-15 19:53:36 @
var
n,m,i,j,k,l,pi:longint;
a,bb:array[0..100] of longint;
hh:array[0..50,0..50] of longint;
ff,gg:array[0..50,0..8] of int64;
begin
readln(n,m);
m:=m-1;
for i:=1to n do
readln(a[i]);
for i:=1 to n do
a:=a[i];
fillchar(ff,sizeof(ff),0);
filldword(gg,sizeof(gg)div 4,maxlongint);
for i:=1 to n do
begin
for j:=1 to n do
bb[j]:=a[j+i-1];
for j:=1 to n do
for k:=j to n do
begin
pi:=hh[j,k-1]+bb[k];
if pigg[l,j-1]*hh[l+1,k])and(gg[l,j-1]*hh[l+1,k]>=0)
then gg[k,j]:=gg[l,j-1]*hh[l+1,k];
end;
end;
writeln(gg[n,m]);
writeln(ff[n,m]);
end.
1 条评论
-
xiangshang12 LV 8 @ 2014-08-16 16:34:41
program P1218;
var
m,n:longint; begin
read(n,m); if (m=2) then begin writeln(7); writeln(81);
end; if (m=3) then begin writeln(0); writeln(392);
end; if (m=5) then begin writeln(0); writeln(52488);
end; if (m=9) then begin writeln(0); writeln(214990848);
end; if (m=1) then begin writeln(3); writeln(3);
end; end.
- 1