Time Limit Exceeded
replace std::set with integer array