SHARE
TWEET

Untitled

a guest May 26th, 2019 76 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <set>
  3. #include <vector>
  4. #include <algorithm>
  5.  
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int type;
  11.     long int m, i, j = 0;
  12.     long long int *req, *c;
  13.    
  14.     set <long long int> el;
  15.    
  16.     cin >> m;
  17.     m *= 2;
  18.  
  19.     req = new long long int[m];
  20.    
  21.     for (i = 0; i < m; i += 2)
  22.     {  
  23.         cin >> req[i] >> req[i + 1];
  24.        
  25.         if (req[i] == 1) el.insert(req[i + 1]);
  26.     }
  27.    
  28.     c = new long int[el.size()]
  29.    
  30.     for (i = 0; i < m; i += 2)
  31.     {
  32.         if (req[i] == 1)
  33.         {
  34.             long long int curEl;
  35.            
  36.             curEl = req[i + 1];
  37.            
  38.             c[j] = 1;
  39.         }
  40.     }
  41.    
  42.     for (i = 0; i < a.size(); i++)
  43.         cout << a[i] << " ";
  44.     cout << endl;
  45.  
  46.     return 0;
  47. }
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