nrk009

LOWER AND UPPER BOUND ON PAIR

Jul 7th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.79 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
  4. #define ll long long
  5. #define ld long double
  6. #define pb push_back
  7. #define fe first
  8. #define se second
  9. #define st(x) sort(x.begin(),x.end())
  10. #define rst(x) sort(x.rbegin(), x.rend())
  11. #define all(x) x.begin(),x.end()
  12. long double pi = 3.14159265358979323;
  13.  
  14. const double EPS = 1e-12;
  15. const int N = 1e6 + 5;
  16. const int mod = 1e9 + 7;
  17.  
  18.  
  19.  
  20.  
  21. int main()
  22. {
  23.     fast;
  24.     //lower bound and upper bound on pair of vectors
  25.     //lower bound
  26.     pair < ll , ll > p = {x,-1e18};
  27.     //upperbound
  28.     pair < ll , ll > p = {x,1e18};
  29.     int j = upper_bound(v.begin() , v.end() , p) - v.begin();
  30.    
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.    
  53.     return 0;
  54.    
  55. }
Add Comment
Please, Sign In to add comment