18. Let $A$ denote the set of integer solutions $\left(x_{1}, x_{2}, \cdots, x_{2 n}\right)$ to the equation $x_{1}+x_{2}+\cdots+x_{2 n}=n$ that satisfy the constraints: $x_{1}+x_{2}+\cdots+x_{j}<\frac{1}{2} j(1 \leqslant j \leqslant 2 n-1)$ and $0 \leqslant x_{j} \leqslant 1(1 \leqslant j \leqslant 2 n)$. Find $|A|$.
18. Let $y_{i}=2 x_{i}-1(i=1,2, \cdots, 2 n), B$ denote the set of integer solutions $\left(y_{1}, y_{2}, \cdots, y_{2 n}\right)$ of the indeterminate equation $y_{1}+y_{2}+\cdots+y_{2 n}=0$ that satisfy the constraints: $y_{1}+$ $y_{2}+\cdots+y_{j}<0(1 \leqslant j \leqslant 2 n-1)$ and $-1 \leqslant y_{j} \leqslant 1(1 \leqslant j \leqslant 2 n)$. Then $|A|=|B|$. Let $b_{j}=y_{1}+y_{2}+\cdots+y_{j}(1 \leqslant j \leqslant 2 n)$. Since $-1 \leqslant b_{1} \leqslant 1$ and $b_{1}<0$, we have $b_{1}=-1$. Since $b_{2 n}=b_{2 n-1}+y_{2 n}=0$, $-1 \leqslant y_{2 n} \leqslant 1$ and $b_{2 n-1}=-y_{2 n}<0$, we have $b_{2 n-1}=-1$, thus $y_{2 n}=1$. In the Cartesian plane, connect the following grid points $\left(1, b_{1}\right),\left(2, b_{2}\right), \cdots,\left(2 n-1, b_{2 n-1}\right)$ sequentially from left to right to form a broken line. This broken line does not intersect the $x$-axis. Let the set of such broken lines be $D$, then $|A|=|B|=|D|$. By the corollary of the theorem in $\S 2-6$, we get $|A|=|B|=|D|=C_{2 n-2}^{n-1}-C_{2 n-2}^{n-2}=$ $\frac{1}{n} C_{2 n-2}^{n-1}$.