You are viewing a single comment's thread. Return to all comments →
Hey guys..C++ solution
int main() {
long long n; cin>>n; vectora(n); for(long long i=0; i>a[i];
long long q; cin>>q; for(int i=0; i>x;
auto it=lower_bound(a.begin(),a.end(),x); long long index=it - a.begin(); if(it!=a.end() && *it==x) { cout<<"Yes"<<" "<<index+1<<endl; } else { cout<<"No"<<" "<<index+1<<endl; }
}
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 →
Hey guys..C++ solution
int main() {
long long n; cin>>n; vectora(n); for(long long i=0; i>a[i];
long long q; cin>>q; for(int i=0; i>x;
}