Improve the solution slightly when implementing solution for new online judge.