Record number of rewarding code.
1, vector elements to weight
sort(v.begin(), v.end());
v.erase(unique(v.begin(), v.end()), v.end());
sort () function to sort vector;
unique () function allows repeating elements on the final return iterator start of repetitive elements;
erase () function is turned off element according to erase.