ttgt
2025-06-21 18:26:49
发布于:浙江
1阅读
0回复
0点赞
#include <iostream>
#include <vector>
#include <unordered_set>
#include <string>
using namespace std;
int main() {
int n, m;
cin >> n >> m;
vector<string> all_students(n);
for (int i = 0; i < n; ++i) {
cin >> all_students[i];
}
unordered_set<string> present_students;
for (int i = 0; i < m; ++i) {
string name;
cin >> name;
present_students.insert(name);
}
for (int i = 0; i < n; ++i) {
if (present_students.find(all_students[i]) == present_students.end()) {
cout << all_students[i] << endl;
}
}
return 0;
}
这里空空如也
有帮助,赞一个