4. Let $Q$ be a set composed of several permutations of $1,2, \cdots, 100$, and it satisfies that for any $1 \leqslant a, b \leqslant 100$, $a \neq b$, there is at most one $\sigma \in Q$ such that in $\sigma$, the number immediately following $a$ is exactly $b$. Find the maximum number of elements in the set $Q$.
(Sun Gongchun)
4. First, assume $|Q| \geqslant 101$.

If $x$ and $y$ appear consecutively in some permutation, then $(x, y)$ is called a "segment".

Since each permutation has exactly 99 segments, there are a total of $99 \times 101 = 9999$ segments in the set $Q$.

However, there are only $100 \times 99 = 9900$ different segments. By the pigeonhole principle, there must be a segment that appears at least twice in the set $Q$, which is a contradiction.
Thus, $|Q| \leqslant 100$.
Next, let
$$
\begin{aligned}
\sigma_{i}= & (1+i, 100+i, 2+i, 99+i, \cdots, \\
& 50+i, 51+i)(0 \leqslant i \leqslant 99),
\end{aligned}
$$

where all elements are taken modulo 100,
$$
Q=\left\{\sigma_{i} \mid 0 \leqslant i \leqslant 99\right\} \text {. }
$$

Then, for $1 \leqslant x \leqslant 99, \sigma_{0}(x+1)-\sigma_{0}(x)$ uniquely takes on all non-zero residues modulo 100. Therefore, for $a \neq b$, there exists a unique $1 \leqslant k \leqslant 99$ such that
$$
\sigma_{0}(k+1)-\sigma_{0}(k) \equiv b-a(\bmod 100) \text {, }
$$

Then, there exists a unique appropriate $i$ such that $\sigma_{i}(k)=a$.
Thus, this set $Q$ satisfies the requirements.
In conclusion, the maximum value of $|Q|$ is 100.