18. There are ( ) non-negative integers that can be represented as
$$
\sum_{i=0}^{7} 3^{i} a_{i}\left(a_{i} \in\{-1,0,1\}, 0 \leqslant i \leqslant 7\right) \text {. }
$$
(A) 512
(B) 729
(C) 1094
(D) 3381
(E) 59048
18. D.

Since $\sum_{i=0}^{7} 3^{i} a_{i}$ is a non-negative integer, the highest bit cannot be negative.
We discuss this by cases.
$a_{7}=1$, there are $3^{7}$ cases;
$a_{7}=0, a_{6}=1$, there are $3^{6}$ cases;
$a_{7}=0, a_{6}=0, a_{5}=1$, there are $3^{5}$ cases;
$\qquad$
$a_{7}=a_{6}=\cdots=a_{1}=0, a_{0}=1$, there is 1 case.
Therefore, the desired result is $\sum_{i=0}^{7} 3^{i}=3281$.