OSDN Git Service

Update catalan.md
author雷蒻 <34390285+hsfzLZH1@users.noreply.github.com>
Sat, 5 Oct 2019 23:34:55 +0000 (07:34 +0800)
committerGitHub <noreply@github.com>
Sat, 5 Oct 2019 23:34:55 +0000 (07:34 +0800)
修复例题格式,代码格式,删除了重复的公式

docs/math/catalan.md

index de8940b..cd2d792 100644 (file)
@@ -44,32 +44,30 @@ $$
 H_n = \binom{2n}{n} - \binom{2n}{n-1}
 $$
 
-    f[n] = f[0] * f[n - 1] + f[1] * f[n - 2] + ... + f[n - 1] * f[0]
-
-具体实例[https://www.luogu.org/problem/P1044](洛谷 P1044 栈)
-
-    #include <iostream>
-
-    using namespace std;
-
-    int n;
-    long long f[25];
-
-    int main(){
-       f[0] = 1;
-       cin >> n;
-       for(int i = 1; i <= n; i++)
-               f[i] = f[i - 1] * (4 * i - 2) / (i + 1);
-        //这里用的是常见公式2
-       cout << f[n] << endl;
-       return 0;
-    }
+??? note " 例题[洛谷 P1044 栈](https://www.luogu.org/problem/P1044)"
+    题目大意:入栈顺序为 $1,2,\ldots ,n$ ,求所有可能的出栈顺序的总数。
+
+```cpp
+#include <iostream>
+using namespace std;
+int n;
+long long f[25];
+int main(){
+    f[0] = 1;
+    cin >> n;
+    for(int i = 1; i <= n; i++)
+       f[i] = f[i - 1] * (4 * i - 2) / (i + 1);
+       //这里用的是常见公式2
+    cout << f[n] << endl;
+    return 0;
+}
+```
 
 ## 路径计数问题
 
 非降路径是指只能向上或向右走的路径。
 
-1.  从 $(0,0)$ 到 $(m,n)$ 的非降路径数等于 m 个 x 和 n 个 y 的排列数,即 ${n + m \choose m}$ 。
+1.  从 $(0,0)$ 到 $(m,n)$ 的非降路径数等于 $m$ 个 $x$ 和 $n$ 个 $y$ 的排列数,即 ${n + m \choose m}$ 。
 
 2.  从 $(0,0)$ 到 $(n,n)$ 的除端点外不接触直线 $y=x$ 的非降路径数: