Inelastic scattering of antiprotons from 12C and 18O at 50 and 180 MeV