SHARE
TWEET

setauto basic

Falak_Ahmed_Shakib Aug 22nd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. #define fastread()(ios_base:: sync_with_stdio(false),cin.tie(NULL));
  5. int main()
  6. { fastread();
  7.      /// bro taka chuto ,,,,(,greatre<int>) baddila chuto taka boro daka ba;;;
  8.     ///setv.insert(i);,for gurala value gula inset hoha jaba;;;;;;
  9.    /* set<int, greater<int>>setv;
  10.  
  11.       setv.insert(20);
  12.       setv.insert(10);
  13.       setv.insert(30);
  14.       setv.insert(30);
  15.       setv.insert(50);
  16.       setv.insert(45);
  17.        for(auto p : setv)
  18.      {
  19.          cout<<p<<endl;
  20.      }
  21.   cout<<endl; */
  22.  
  23.    ///SET ar size, SET empty ki na,ba setv.clear(); diha clear kora ;
  24.  
  25.  
  26. /*      set<int, greater<int>>setv;
  27.  
  28.       setv.insert(20);
  29.       setv.insert(10);
  30.       setv.insert(30);
  31.       setv.insert(30);
  32.       setv.insert(50);
  33.       setv.insert(45);
  34.  
  35.  
  36.       for(auto p : setv)
  37.      {
  38.          cout<<p<<endl;
  39.      }
  40.      cout<<endl;
  41.  
  42.  
  43.  
  44.     cout<<"if empty ans is 1 than it set empty .... \nOR if empty ans is 0 then set is not empty\n";
  45.     cout<<"size1="<<setv.size()<<" "<<"empty funtion="<<setv.empty()<<endl;
  46.  
  47.       setv.clear();
  48.  
  49.     cout<<"size1="<<setv.size()<<" "<<"empty funtion="<<setv.empty()<<endl;
  50.   for(auto p : setv)
  51.      {
  52.          cout<<p<<endl;
  53.      }
  54.       cout<<" abc";
  55.  
  56. */
  57. /// scan niha set;
  58.  
  59.       set<int>s;
  60.  
  61.      int n;
  62.  
  63.      cin>>n;
  64.  
  65.      for(ll i=0; i<n; i++)
  66.      {
  67.          ll a;
  68.  
  69.          cin>>a;
  70.  
  71.          s.insert(a);
  72.      }
  73.  
  74.      for(auto x : s)
  75.      {
  76.          cout<<x<<endl;
  77.      }
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top