You are viewing a single comment's thread. Return to all comments →
int main() { vector v; int n; cin>>n; for (int i=0; i>value; v.push_back(value); }
int q;cin>>q; int l; vector::iterator lower; for(int i=0; i>l; lower=lower_bound(v.begin(),v.end(),l); if(v[lower-v.begin()]==l) { cout<<"Yes "<
Lower Bound-STL
You are viewing a single comment's thread. Return to all comments →
int main() { vector v; int n; cin>>n; for (int i=0; i>value; v.push_back(value); }
int q;cin>>q; int l; vector::iterator lower; for(int i=0; i>l; lower=lower_bound(v.begin(),v.end(),l); if(v[lower-v.begin()]==l) { cout<<"Yes "<