Added cpp code to calculate hot_score