比赛 |
2008haoi模拟训练1 |
评测结果 |
RRRRRRRRRR |
题目名称 |
分组 |
最终得分 |
0 |
用户昵称 |
zxc111 |
运行时间 |
0.022 s |
代码语言 |
Pascal |
内存使用 |
1.34 MiB |
提交时间 |
2008-04-22 10:45:10 |
显示代码纯文本
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,'');
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.