题目连接
https://pintia.cn/problem-sets/994805046380707840/problems/994805059731177472
思路对于关注列表的名字,我们通过一个map
进行标记是否出现,然后下面的用户和点赞信息可以通过pair
进行存储,最后遍历一遍点赞的用户,找出其中不在关注用户且点赞数量大于平均的人,最后排序输出即可,如果没有的话输出Bing Mei You
#include
using namespace std;
#define ll long long
#define mod 1000000007
#define endl "\n"
#define PII pair
#define INF 0x3f3f3f3f
int n,m;
map vis;
int main()
{
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n;
string name;
for(int i = 1;i >name;
vis[name] = true;
}
cin>>n;
int star,sum = 0;
vector Vec;
for(int i = 1;i >name>>star;
Vec.push_back({name,star});
sum += star;
}
vector ans;
for(int i = 0;i sum && vis[Vec[i].first] == false)
ans.push_back(Vec[i].first);
}
if(ans.size() == 0) cout
关注
打赏