multiset<int, greater<int>> st; // ... // operation 1 // ... delete sth cout << *next(st.begin()) << '\n';
是错的,因为有可能 *st.begin() == *next(st.begin())。应为
*st.begin() == *next(st.begin())
cout << *st.upper_bound(*st.begin()) << '\n';