Some problems need unique values kept in sorted order, with quick insert, delete and "next bigger element" queries. set gives all of these in O(log n), and lower_bound on it is a common trick in contests. Use unordered_set when you only need fast membership checks and order does not matter. Use multiset when duplicates must be kept.