Advertisement
LEGEND2004

set multiset

May 18th, 2024
756
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.22 KB | None | 0 0
  1. #pragma GCC optimize("O3")
  2. #include <bits/stdc++.h>
  3. using namespace std;
  4.  
  5. #define int long long
  6. #define double long double
  7. #define pb push_back
  8. const int mod = 1e9 + 7;
  9.  
  10. signed main()
  11. {
  12.     ios_base::sync_with_stdio(0);
  13.     cin.tie(0);
  14.  
  15.     int n;
  16.     cin >> n;
  17.     multiset<int> ms;
  18.     for(int i = 0; i < n; i++){
  19.         int x;
  20.         cin >> x;
  21.         ms.insert(x);
  22.     }
  23.     for(int i = 1; i <= 5; i++){
  24.         cout << i << "-den " << ms.count(i) << " dene var\n";
  25.     }
  26.     //ms.erase(4);
  27.     ms.erase(ms.find(4));
  28.     cout << '\n';
  29.     for(int i = 1; i <= 5; i++){
  30.         cout << i << "-den " << ms.count(i) << " dene var\n";
  31.     }
  32.     /*
  33.     multiset<int> ms;
  34.     ms.size(); // olcusu
  35.     ms.empty(); // bosdurmu?
  36.     ms.insert(x); // elave ele amma sorted
  37.     ms.count(x); // x-in sayi
  38.     ms.erase(x); // butun x leri sil
  39.     ms.erase(ms.find(x)); // 1 dene x sil
  40.  
  41.     set<int> s;;
  42.    
  43.     */
  44.     /*
  45.    
  46.     2
  47.     4
  48.    
  49.     5
  50.     3 2 4 5 1
  51.  
  52.     {1 ,
  53.  
  54.     2 , 3 , 4 , 5}
  55.  
  56.     log(1000) = 10
  57.     2^10 = 1024~1000
  58.  
  59.     2^5 * 2^5 = 2^10 = 32 * 32 = 1024
  60.     2^10 * 2^10 = 2^20 = 10^6
  61.     log(10^3) = 10
  62.     log(10^12) = 40
  63.     log(10^9) = 30
  64.     log(10^18) = 60
  65.  
  66.     */
  67.  
  68. }
  69.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement