PAT L2-019. 悄悄关注
原题链接
简单
作者:
青丝蛊
,
2021-04-10 11:10:46
,
所有人可见
,
阅读 195
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin >> n;
set<string> se1, se2;
while (n--)
{
string s; cin >> s;
se1.insert(s);
}
cin >> n;
int sum = 0;
unordered_map<string, int> mp;
for (int i = 0; i < n; i++)
{
string s; cin >> s; cin >> mp[s];
sum += mp[s];
}
for (auto c : mp)
if (c.second > 1.0 * sum / n && !se1.count(c.first))
se2.insert(c.first);
if (se2.empty()) puts("Bing Mei You");
else
for (auto c : se2) cout << c << endl;
return 0;
}