📄 ac1141.pas
字号:
program tju1141;
const
maxn=49;
var
count:array[0..maxn]of qword;
i,x,y,z:shortint;
function h(a:qword;b:byte):qword;
var
i:byte;
begin
h:=1;
for i:=1 to b do
h:=h*(a+i-1) div i;
end;
begin
count[0]:=1;
for i:=1 to maxn do begin
x:=0;z:=i-1;
repeat
if x<>z then inc(count[i],h(count[x],2)*count[z]) else inc(count[i],h(count[x],3));
inc(x);dec(z,2);
until z<0;
for x:=0 to (i-1) div 3-1 do
for y:=x+1 to (i-x-2) div 2 do
inc(count[i],count[x]*count[y]*count[i-1-x-y]);
end;
repeat
read(i);
writeln(count[i]);
until seekeof;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -