看看地图和一些 STL 算法:
http://www.cplusplus.com/reference/stl/map/
lower_bound Return iterator to lower bound (public member function)
upper_bound Return iterator to upper bound (public member function)
distance Calculates the number of elements between first and last.