正文
增加 5 行删除 5 行
61 行未改动626364656667686970717273744 行未改动79808182838485868795 行未改动18318418518618718818919019161 行未改动1&\textbf{Require: }\text{ 两棵树的节点}T1,T2\\2&\qquad\textbf{if}\ \ T1=\text{null}\textbf{ or }T2=\text{null}\textbf{ then }\\3&\qquad\qquad\textbf{return}\ \ T1=\text{null}\textbf{ and }T2=\text{null}\\4&\qquad\textbf{else}\\5&\qquad\qquad\textbf{return}\ \text{Check}(T1\to\mathit{leftson},T2\to\mathit{leftson}) \\& \qquad\qquad\qquad \textbf{ and }\text{Check}(T1\to\mathit{rightson},T2\to\mathit{rightson})\\6&\qquad\textbf{endif}\\\hline\end{array}$$对于 $100\%$ 的数据,$1 \le n \le 10^9$。:::4 行未改动| $n$ | $1$ | $2$ | $3$ | $4$ | $5$ | $6$ | $7$ | $8$ | $9$ | $10$ || :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: || 树的总数 | $1$ | $2$ | $5$ | $14$ | $42$ | $132$ | $429$ | $1430$ | $4862$ | $16796$ || 叶子的总数 | $1$ | $2$ | $6$ | $20$ | $70$ | $252$ | $924$ | $3432$ | $12870$ | $48620$ |我们观察这两个数列。假设你不会卡特兰数,那么你现在打表出来依旧是倒闭的状态,而且估计不太能直接推出来这个题。于是我们搜索 `1,2,5,14,42`,得到了95 行未改动## 参考文献[1] Wikipedia. [整數數列線上大全](https://zh.wikipedia.org/wiki/%E6%95%B4%E6%95%B8%E6%95%B8%E5%88%97%E7%B7%9A%E4%B8%8A%E5%A4%A7%E5%85%A8)[EB/OL]. (2025-07-04)[2026-01-07]. https://zh.wikipedia.org/wiki/整數數列線上大全.[2] [Petit_Souris](https://www.luogu.com/user/288866). [OEIS 技巧合集](https://www.luogu.com/article/5di1bx90)[EB/OL]. (2023-12-27)[2026-01-07]. https://www.luogu.com/article/5di1bx90.[^1]: [The On-Line Encyclopedia of Integer Sequences (OEIS)](https://oeis.org/).61 行未改动626364656667686970717273744 行未改动79808182838485868795 行未改动18318418518618718818919019161 行未改动1&\textbf{Require: }\text{ 两棵树的节点}T1,T2\\2&\qquad\textbf{if}\ \ T1=\text{null}\textbf{ or }T2=\text{null}\textbf{ then }\\3&\qquad\qquad\textbf{return}\ \ T1=\text{null}\textbf{ and }T2=\text{null}\\4&\qquad\textbf{else}\\5&\qquad\qquad\textbf{return}\ \text{Check}(T1\to\mathit{leftson},T2\to\mathit{leftson}) \\& \qquad\qquad\qquad \textbf{ and }\text{Check}(T1\to\mathit{rightson},T2\to\mathit{rightson})\\6&\qquad\textbf{endif}\\\hline\end{array}$$对于 $100\%$ 的数据,$1 \le n \le 10^9$。:::4 行未改动| $n$ | $1$ | $2$ | $3$ | $4$ | $5$ | $6$ | $7$ | $8$ | $9$ | $10$ || :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: | :-: || 树的总数 | $1$ | $2$ | $5$ | $14$ | $42$ | $132$ | $429$ | $1430$ | $4862$ | $16796$ || 叶子的总数 | $1$ | $2$ | $6$ | $20$ | $70$ | $252$ | $924$ | $3432$ | $12870$ | $48620$ |我们观察这两个数列。假设你不会卡特兰数,那么你现在打表出来依旧是倒闭的状态,而且估计不太能直接推出来这个题。于是我们搜索 `1,2,5,14,42`,得到了95 行未改动## 参考文献[1] Wikipedia. [整數數列線上大全](https://zh.wikipedia.org/wiki/%E6%95%B4%E6%95%B8%E6%95%B8%E5%88%97%E7%B7%9A%E4%B8%8A%E5%A4%A7%E5%85%A8)[EB/OL]. (2025-07-04)[2026-01-07]. https://zh.wikipedia.org/wiki/整數數列線上大全.[2] [Petit_Souris](https://www.luogu.com/user/288866). [OEIS 技巧合集](https://www.luogu.com/article/5di1bx90)[EB/OL]. (2023-12-27)[2026-01-07]. https://www.luogu.com/article/5di1bx90.[^1]: [The On-Line Encyclopedia of Integer Sequences (OEIS)](https://oeis.org/).