Superconductivity, gapless state and isotope effect in the cuprates