We have developed a one-dimensional code to solve ultrarelativistic hydrodynamic problems, using the Glimm method for an accurate treatment of shocks and contact discontinuities. The implementation of the Glimm method is based on an exact Riemann solver and van der Corput sampling sequence. In order to improve computational efficiency, the Glimm method is replaced by a finite differencing scheme in those regions where the fluid flow is sufficiently smooth. The accuracy and convergence of this hybrid method is investigated in tests involving planar, cylindrically, and spherically symmetric flows that exhibit strong shocks and Lorentz factors of up to ∼2000. This hybrid code has proven to be successful in simulating the interaction between a thin, ultrarelativistic, spherical shell and a low-density stationary medium, which is a situation likely to arise in gamma-ray bursters, supernovae explosions, pulsar winds, and active galactic nuclei.