You are on page 1of 1

/*#include<bits/stdc++.

h>
using namespace std;
#define lli long long int
int main()
{
std::ios_base::sync_with_stdio(false);
cin.tie(NULL);
lli t,n;
cin>>t;
while(t--)
{
cin>>n;
if(n%5!=0)
{
cout<<"-1\n";
}
else
{
if(n%2==0)
cout<<"0\n";
else
cout<<"1\n";
}

}
return 0;
}*/

#include <iostream>
#include <algorithm> // for lower_bound, upper_bound and sort
#include <vector> // for vector

using namespace std;

int main ()
{
int gfg[] = {1,9,2,4,6};

vector<int> v(gfg,gfg+8); // 5 6 7 7 6 5 5 6

// sort (v.begin(), v.end()); // 5 5 5 6 6 6 7 7

vector<int>::iterator lower,upper;
lower = lower_bound (v.begin(), v.end(), 4);
upper = upper_bound (v.begin(), v.end(), 4);

cout << "lower_bound for 6 at position " << (lower- v.begin()) << '\n';
cout << "upper_bound for 6 at position " << (upper - v.begin()) << '\n';

return 0;
}

You might also like