Lower Bound-STL

  • + 0 comments

    include

    include

    using namespace std;

    int main() { int n; cin>>n; vectorm; for(int i=0;i>temp; m.push_back(temp); } int q; cin>>q; for(int i=0;i>temp; vector::iterator it; it=lower_bound(m.begin(),m.end(),temp); if(*(it+1)==temp||*it==temp){ cout<<"Yes"<<" "<