In a plane, there are 18 points, no three of which are collinear. Each pair of points is connected by a line segment, and these line segments are colored either red or blue, with each segment being exactly one color. From a certain point $A$, the number of red line segments is odd, and from the other 17 points, the number of red line segments is distinct. Find the number of triangles with vertices among the given points, where all sides are red, and the number of triangles with two red sides and one blue side.
(1994 Hunan Provincial Training Team Problem)
Let the number of triangles with all three sides red, two sides red and one side blue, two sides blue and one side red, and all three sides blue be $m, n, p, q$ respectively.

Since the number of red segments drawn from each point except $A$ is different, the minimum is 0 and the maximum is 17, and 0 and 17 cannot appear at the same time, there are only the following two scenarios:
$0,1,2, \cdots, 16$ or $1,2, \cdots, 17$.
If the former, let the number of segments drawn from $A$ be $2 k-1$, then the total number of red segments in the graph is
$$
\frac{1}{2}(0+1+2+\cdots+16+2 k-1)=17 \times 4+k-\frac{1}{2} \text { segments, }
$$

which is a contradiction. Therefore, it can only be the second scenario. Let the other 17 points be $B_{1}, B_{2}, \cdots, B_{17}$, and from $B_{i}$, there are exactly $i$ red segments $(i=1,2, \cdots, 17)$. Thus, $B_{17}$ is connected to the other 17 points with red lines, so $B_{1}$ is only connected to $B_{17}$ with a red line, $B_{16}$ is connected to the other 16 points except $B_{1}$ with red lines, so $B_{2}$ is only connected to $B_{17}, B_{16}$ with red lines. Generally speaking, $B_{17-i}$ is connected to the other $17-i$ points except $B_{1}, B_{2}, \cdots, B_{i}(i=1,2, \cdots, 8)$ with red lines, and $B_{i}$ is only connected to $B_{17}$, $B_{16}, \cdots, B_{18-i}$ with red lines, which means $A$ is only connected to $B_{17}, B_{16}, \cdots, B_{9}$, a total of 9 points, with red lines. All other connected lines are blue.

We call two red segments from one point a red angle, and two blue segments from one point a blue angle. In every triangle with all three sides red, there are 3 red angles, in every triangle with two sides red and one side blue, there is one red angle, and in other triangles, there are no red angles, so the total number of red angles is $3 m+n$. On the other hand, the number of red angles with $B_{i}$ as the vertex is $C_{i}^{2}(i=1,2, \cdots, 17)$, and we agree that $C_{1}^{2}=0$. The number of red angles from $A$ is $C_{9}^{2}$, so the total number of red angles is
$$
\sum_{n=2}^{17} C_{i}^{2}+C_{9}^{2}=C_{3}^{3}+\sum_{i=3}^{17}\left(C_{i+1}^{3}-C_{i}^{3}\right)+C_{9}^{2}=C_{18}^{3}+C_{9}^{2}=852 .
$$

So $3 m+n=852$.
Similarly, the total number of blue angles is
$$
p+3 q=\sum_{k=i}^{17} C_{17-i}^{2}+C_{8}^{2}=C_{17}^{3}+C_{8}^{2}=708 .
$$

Since each segment is a common side of $C_{16}^{1}=16$ triangles, the number of red segments in the graph is $\frac{1}{16}(3 m+2 n+p)$. On the other hand, from $B_{i}$, there are $i$ red segments $(i=1,2, \cdots, 17)$, and from $A$, there are 9 red segments, and each red segment is counted twice, so the total number of red segments is $\frac{1}{2}(1+2+\cdots+17+9)=81$, so
$$
3 m+2 n+p=16 \times 81=1296 .
$$

Similarly, the number of blue segments in the graph is
$$
\frac{1}{16}(n+2 p+3 q)=\frac{1}{2}(16+15+\cdots+2+1+8)=72,
$$

which means $n+2 p+3 q=16 \times 72=1152$.
Solving (1), (2), (3), and (4) together, we get $m=204, n=240, p=204, q=168$.
That is, there are 204 triangles with all three sides red, and 240 triangles with two sides red and one side blue.
Solution 2: After the same analysis and notation as in Solution 1, let $M=\left\{B_{1}, B_{2}, \cdots, B_{8}\right\}, N=\left\{A, B_{9}, B_{10}, \cdots, B_{17}\right\}$, then any two points in $M$ are not connected by a red segment, while any two points in $N$ are connected by a red segment, and any point $B_{i}(1 \leqslant i \leqslant 8)$ in $M$ is connected to $i$ points in $N$ by a red segment. Therefore, there are no triangles with all three sides red with $B_{1}$ as a vertex, and there are $C_{i}^{2}$ triangles with all three sides red with $B_{i}(2 \leqslant i \leqslant 8)$ as a vertex, and there are $C_{10}^{3}$ triangles with all three sides red with any 3 points in $N$ as vertices, so the number of triangles with all three sides red is
$$
C_{2}^{2}+C_{3}^{2}+\cdots+C_{8}^{2}+C_{10}^{3}=C_{9}^{3}+C_{10}^{3}=84+120=204 .
$$

Triangles with two sides red and one side blue are divided into two categories: The first category is a triangle with one vertex as $B_{i} \in M(1 \leqslant i \leqslant 8)$, and the other two vertices belong to $N$, and the two segments drawn from $B_{i}$ to two points in $N$ are one red and one blue (the segment between the two points in $N$ is red), the number of such triangles is
$$
\sum_{i=1}^{8} C_{i}^{1} C_{10-i}^{1}=1 \times 9+2 \times 8+3 \times 7+4 \times 6+5 \times 5+6 \times 4+7 \times 3+8 \times 2=156 \text {. }
$$

The second category of triangles has one vertex as $P \in N\left(P\right.$ is $A$ or $B_{j}(9 \leqslant j \leqslant 17)$, and the other two vertices belong to $M$, and the two segments drawn from $P$ to two points in $M$ are both red (the segment between the two points in $M$ is blue), the number of such triangles is $\sum_{i=9}^{17} C_{i-9}^{2}=C_{2}^{2}+C_{3}^{2}+\cdots+C_{8}^{2}=C_{9}^{2}=84\left(C_{0}^{2}=C_{1}^{2}=0\right)$.
Therefore, the total number of triangles with two sides red and one side blue is $156+84=240$.
Note (1) After finding the number of red triangles $m=204$, we can also establish equation (1) as in Solution 1 to find the number of triangles with two sides red and one side blue as $n=852-3 \times 204=240$.
(2) This problem can also be solved by the method of counting the total number of bicolored angles (an angle formed by one red segment and one blue segment from one point) and the total number of triangles to establish two equations to replace any two of (1) to (4).