Dark Energy Survey Year 3 results: Cosmological constraints from galaxy clustering and weak lensing