\(x+y+z=9\Leftrightarrow\left(x+y+z\right)^2=81\\ \Leftrightarrow x^2+y^2+z^2+2\left(xy+yz+xz\right)=81\\ \Leftrightarrow xy+yz+xz=\dfrac{81-27}{2}=27\\ \Leftrightarrow x^2+y^2+z^2=xy+yz+xz\\ \Leftrightarrow2x^2+2y^2+2z^2=2xy+2yz+2xz\\ \Leftrightarrow\left(x^2-2xy+y^2\right)+\left(y^2-2yz+z^2\right)+\left(z^2-2xz+x^2\right)=0\\ \Leftrightarrow\left(x-y\right)^2+\left(y-z\right)^2+\left(z-x\right)^2=0\\ \Leftrightarrow\left\{{}\begin{matrix}x-y=0\\y-z=0\\z-x=0\end{matrix}\right.\Leftrightarrow x=y=z=\dfrac{9}{3}=3\left(x+y+z=9\right)\)
\(\Leftrightarrow\left(x-4\right)^{2018}+\left(y-4\right)^{2019}+\left(z-4\right)^{2020}\\ =\left(-1\right)^{2018}+\left(-1\right)^{2019}+\left(-1\right)^{2020}=1-1+1=1\)