1. Let the set $S=\{1,2, \cdots, 3 n\}, n$ be a positive integer, and $T$ be a subset of $S$, satisfying: for any $x, y, z \in T$ (where $x, y, z$ can be the same), we have $x+y+z \notin T$. Find the maximum number of elements in all such sets $T$. ${ }^{[4]}$
$$
\begin{array}{l}
T_{0}=\{x \mid x \in S \text { and } x \geqslant n+1\} \\
=\{n+1, n+2, \cdots, 3 n\},
\end{array}
$$

At this point, $\left|T_{0}\right|=2 n$, and the sum of any three numbers in $T_{0}$ is greater than $3 n$, so they are not in $T_{0}$. Thus, $T_{0}$ meets the requirement.
Therefore, $\max \left|T_{0}\right| \geqslant 2 n$.
Construct the following $n$ subsets of $S$:
$$
\begin{array}{l}
A_{0}=\{n, 2 n, 3 n\}, \\
A_{k}=\{k, 2 n-k, 2 n+k\}(k=1,2, \cdots, n-1) . \\
\text { Then } S=\bigcup_{k=0}^{n-1} A_{k}, \text { for any } 2 n+1 \text { element }
\end{array}
$$

subset $T^{\prime}$ of $S$, it must contain some subset $A_{k}$.
If $A_{0} \subseteq T^{\prime}$, then $n+n+n=3 n \in T^{\prime}$;
If $A_{k} \subseteq T^{\prime}(k=1,2, \cdots, n-1)$, then
$$
k+k+(2 n-k)=2 n+k \in T^{\prime} \text {. }
$$

Hence, $\max |T|<2 n+1$.
Therefore, $\max |T|=2 n$.