Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- int main() {
- int n, k;
- cin >> n >> k;
- vector<int> v(n);
- for(int i=0; i<n; ++i) cin >> v[i];
- for(int i=0; i<k; ++i)
- {
- int x;
- cin >> x;
- cout << ( binary_search(v.begin(), v.end(), x) ? "YES" : "NO" ) << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement