Create 3527.cpp

This commit is contained in:
KiritoTRw 2016-05-22 23:08:18 +08:00
parent 7b4f83ff48
commit 2d00ec1698

46
HDOJ/3527.cpp Normal file
View File

@ -0,0 +1,46 @@
#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;
}