查找1 题解:
#include<bits/stdc++.h>
using namespace std;
int main(){
int n, m;
map<int, int> mp;
cin >> n;
int t;
for(int i = 0; i < n; i ++){
cin >> t;
mp[t] ++;
}
cin >> m;
while(m --){
cin >> t;
if(mp.find(t) == mp.end()) cout << "NO" << '\n';
else cout << "YES" << '\n';
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发