change set to unordered_set but still exceed the time limit