activity selection problem in c++