Reweighting method for quantum Monte Carlo simulations with the negative-sign problem