记录编号 112 评测结果 AAAAAWAAAA
题目名称 分组 最终得分 90
用户昵称 Gravatarzxc111 是否通过 未通过
代码语言 Pascal 运行时间 10.000 s
提交时间 2008-04-23 11:36:42 内存使用 0.00 MiB
显示代码纯文本
program ooo;
type
er=array[1..6] of integer;
ac=array[1..100000] of er;
var
t:text;
an:ac;
f:array[1..20,1..6] of boolean;
a,b,i,he,j,k,num,z:longint;
e:array[1..6] of integer;
q:array[1..20] of integer;
o,o1:boolean;
procedure oo(ui,oi:integer);
var
i,j,k:integer;
begin
if e[ui]>=e[ui-1] then begin
he:=0;
if ui<b then begin
i:=ui;
inc(i);
for j:=1 to a do
begin
e[i]:=j;
oo(i,e[i]);
end; end  else begin

if o1=false then begin
for i:=1 to b do
he:=he+e[i];
if he=a then begin
inc(num);
an[num]:=e;end;
end;
end;
end;end;
begin
assign(t,'dataa.in');
reset(t);
readln(t,a,b);
close(t);
o:=true;
for i:=1 to a div b do
q[i]:=i;
for z:=1 to a div b do begin
he:=0;o1:=false;
e[1]:=q[z];
for j:=1 to b do
oo(j,1);

end;
assign(t,'dataa.out');
rewrite(t);
writeln(t,num);
for j:=1 to num do
begin
e:=an[j];
for z:=1 to b-1 do
write(t,e[z],' ');
write(t,e[b]);
writeln(t);
end;
close(t);
end.