L1-1 帅到没朋友 (20分)
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<cstring>
using namespace std;
#define STDIN freopen("in.in", "r", stdin);freopen("out.out", "w", stdout);
int main()
{
// STDIN
int n; cin >> n;
map<string, bool > ma;
set<string> se;
for (int i = 1; i <= n; i++)
{
int m;
cin >> m;
for (int i = 1; i <= m; i++)
{
string s;
cin >> s;
if (m >= 2){
ma[s] = true;
}
}
}
cin >> n;
vector<string> ans;
se.clear();
for (int i = 1; i <= n; i++)
{
string s; cin>>s;
if (ma.count(s) == 0 && se.find(s) == se.end()) ans.push_back(s),se.insert(s);
if (ma.count(s) && ma[s] == false && se.find(s) == se.end()) ans.push_back(s),se.insert(s);
}
int len = ans.size();
if (len == 0) {
puts("No one is handsome");return 0;
}
for (int i = 0; i < len ;i++)
{
cout << ans[i];
if (i == len - 1) cout << endl;
else cout << " ";
}
}