new candy.cpp

O(n^2) is timeout, You must use O(n) solution.