Similarity transformation and Hirota bilinearization are deployed to derive exact bright and dark ultrashort one-and two-similariton solutions of a nonautonomous cubic-quintic nonlinear Schrödinger equation. Such wave packets may emerge when group-velocity dispersion and cubic-quintic self-phase modulations are balanced by Raman self-frequency shift in the presence of an external harmonic trap and linear gain or loss. The solutions presented here can be used to investigate the compression, amplification and interaction phenomena associated with bright and dark similaritons in inhomogeneous fiber systems. Furthermore, the dynamics of the characteristic parameters of the similaritons are studied analytically, and similariton stability in a distributed system is tested through extensive computations. As an example application, the tunneling behavior of bright and dark similaritons through cascade dispersion barriers and dispersion wells on an exponential background is investigated, and some interesting novel features are uncovered which are expected to facilitate the control of bright and dark ultrashort similariton in experimental scenarios. Keywords two-similariton, interaction, Raman effect, harmonic potential, cascade tunneling () () () () () () () 0 zz z z w z z w z z p z z w z