Well, if you search the vector from begin to end you'll have O(N) complexity.

But if you introduce an extra unordered_map you can get O(1) accesses into the vector.