20. (Problem 1518 from "Mathematics Bulletin") The sequence $\left\{a_{n}\right\}$ has exactly 2003 terms, each of which is a positive integer, and satisfies:
(1) Any term of $\left\{a_{n}\right\}$ is less than 100;
(2) The sum of any consecutive terms of $\left\{a_{n}\right\}$ is not equal to 100. Let $S=\sum_{i=1}^{2003} a_{i}$, try to find the minimum value of $S$.
20. First consider the first 100 terms of $\left\{a_{n}\right\}$.

Let $S_{0}=0, S_{1}=a_{1}, \cdots$,
$S_{k}=\sum_{i=1}^{k} a_{i} \quad(1 \leqslant k \leqslant 100)$.
Then $S_{k} \in \mathbf{N}_{+}$, and $1 \leqslant S_{1}100$.
By the pigeonhole principle, there exist $S_{m}, S_{n}(0 \leqslant m<n \leqslant 100)$, such that
$$
S_{n}-S_{m}=\sum_{i=m+1}^{n} a_{i}=100 t \text {, }
$$

By the given condition, we know $t \neq 1$, so $t \geqslant 2$,
Thus $\sum_{i=m+1}^{n} a_{i} \geqslant 200$.
Therefore, $\sum_{i=1}^{100} a_{i} \geqslant \sum_{i=m+1}^{n} a_{i} \geqslant 200$,
Similarly, $\sum_{i=1}^{100} a_{100 k+i} \geqslant 200, k=1,2, \cdots, 19$.
$$
\sum_{i=1}^{3} a_{2000+i} \geqslant 3 \text {, }
$$

Thus $S=\sum_{i=1}^{2003} a_{i}=\sum_{k=0}^{19} \sum_{i=1}^{100} a_{100 k: i}+\sum_{i=1}^{3} a_{2000+i}$
$$
\geqslant 20 \times 200+3=4003 \text {. }
$$

Construct a sequence $\left\{a_{n}\right\}$, where $a_{100 k \cdot-50}=50, a_{1001 k+51}=51, a_{100(k+1)}=2(k=0,1,19)$, and the rest of the terms are 1.
The terms of this sequence are all less than 100, and their sum is 4003. Next, we prove that this sequence satisfies condition (2).
Assume there exist several consecutive terms whose sum is 100, then these consecutive terms cannot simultaneously contain the terms 50 and 51.
If they only contain the term 50, then the other terms can only be the terms after 50. If these terms contain the term 2, then the sum of these consecutive terms is at least $50+49+2=101$. If they do not contain 2, then the sum of these consecutive terms is at most $50+49=99$, so these consecutive terms do not contain 50.
Similarly, it can be proven that these consecutive terms do not contain 51.
If these consecutive terms do not contain 50 and 51, then their sum is at most $48+2+49=99$.
Therefore, the assumption is false, i.e., there do not exist consecutive terms whose sum is 100.
Thus, the minimum value of $S$ is 4003.