  We realize a two-qubit sensor designed for achieving high spectral resolution
in quantum sensing experiments. Our sensor consists of an active "sensing
qubit" and a long-lived "memory qubit", implemented by the electronic and the
nitrogen-15 nuclear spins of a nitrogen-vacancy center in diamond,
respectively. Using state storage times of up to 45 ms, we demonstrate
spectroscopy of external ac signals with a line width of 19 Hz (~2.9 ppm) and
of carbon-13 nuclear magnetic resonance (NMR) signals with a line width of 190
Hz (~ 74 ppm). This represents an up to 100-fold improvement in spectral
resolution compared to measurements without nuclear memory.
