#include <iostream>
#include <algorithm>
using namespace std;
int main() {
int n, m, f = 0;
cin >> n;
int a[100];
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
sort(a,a+n);//排序,不排序查找会失败(二分查找只能查找线性表)
cin >> m;
for (int i = 0; i < m; ++i) {
int target;
cin >> target;
int position = lower_bound(a, a + n, target) - a;//lower_bound返回的地址要减去数组的初始地址
if (position != n && a[position] == target) {
std::cout << "YES" << std::endl;
} else {
std::cout << "NO" << std::endl;
}
}
return 0;
}

京公网安备 11010502036488号