You are viewing a single comment's thread. Return to all comments →
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"<<" "<
Seems like cookies are disabled on this browser, please enable them to open this website
Lower Bound-STL
You are viewing a single comment's thread. Return to all 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"<<" "<