change candidates_costs from list to vector

Vector has random access iterator while list is bi-directional. So a vector can be turned into a binary heap with the max (or min depending on the comparison criterion) element always at its front. In that way, we can avoid sorting candidates_costs and directly find the best candidate. It cuts the running time from nlogn to logn. Not sure how much saving overall, but a nice thing I learned from CS225.