题解(vector)
2025-08-19 10:50:30
发布于:浙江
0阅读
0回复
0点赞
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
int n,m,ord;
vector<int> node;
cin>>n>>m;
while(n--){
int x;
cin>>x;
node.push_back(x);
}
while(m--){
int x;
cin>>x;
node.erase(find(node.begin(),node.end(),x));
}
cin>>ord;
for (int i=0;i<node.size();++i){
if (node[i]==ord){cout<<i+1;return 0;}
}
throw "Not found";
return 1;
}
这里空空如也
有帮助,赞一个