Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3")
- #include <bits/stdc++.h>
- using namespace std;
- #define int long long
- #define fastio ios_base::sync_with_stdio(0); cin.tie(0)
- signed main()
- {
- fastio;
- int x;
- multiset<int> ms;
- multiset<int>::iterator it;
- ms.size();
- ms.empty();
- ms.insert(x); // log n
- *ms.begin(); // min
- *ms.rbegin(); // max
- ms.count(x); // x-in sayi
- ms.erase(x); // butun x lari sil
- if(ms.find(x) != ms.end()) // eger varsa ms.count(x)
- ms.erase(ms.find(x)); // bir dene x sil
- ms.lower_bound(x); // x dan boyuk beraber ilk eded
- ms.upper_bound(x); // x dan boyuk ilk eded
- for(auto it = ms.begin(); it != ms.end(); it++){
- cout << *it << " ";
- }
- for(auto i : ms){
- cout << i << " ";
- }
- set<int> s;
- // her elementden 1 dene saxlayir
- // 7 4 5 5 6 2 2
- // 2 4 5 6 7
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement