mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1600.cpp
This commit is contained in:
parent
3a84d2d28c
commit
7b4f83ff48
37
QUSTOJ/1600.cpp
Normal file
37
QUSTOJ/1600.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include<bits/stdc++.h>
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
ios::sync_with_stdio(false); cin.tie(0);
|
||||
int a, b, c;
|
||||
string name;
|
||||
while (cin >> a >> b >> c) {
|
||||
set<string> s;
|
||||
vector<string> v;
|
||||
for (int i=0; i<a; i++) {
|
||||
cin >> name;
|
||||
s.insert(name);
|
||||
}
|
||||
for (int j=0; j<b; j++) {
|
||||
cin >> name;
|
||||
if (s.count(name)) v.push_back(name);
|
||||
}
|
||||
for (int k=0; k<c; k++) {
|
||||
cin >> name;
|
||||
for (int i=0; i<v.size(); i++) {
|
||||
if (v[i] == name) {
|
||||
v.erase(v.begin()+i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (v.empty()) cout << "No enemy spy\n";
|
||||
else {
|
||||
int sz = v.size();
|
||||
cout << v[0];
|
||||
for (int i=1; i<sz; i++)
|
||||
cout << " " << v[i];
|
||||
cout << "\n";
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user