#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<cstring>
#include<cstdio>
#include<algorithm>
#include<set>
#include<queue>
#include<unordered_set>
using namespace std;
int n, m, k;
struct node
{
string name;
int gp, gm, gf, g;
};
map<string, int>mm;
bool cmp(node a, node b)
{
if (a.g != b.g)
return a.g > b.g;
else if (a.name != b.name)
return a.name < b.name;
}
int main()
{
cin >> n >> m >> k;
string name; int score;
vector<node>v,ans; int cnt = 1;
for (int i = 0; i < n; i++)
{
cin >> name >> score;
if (score >= 200)
{
v.push_back(node{ name,score,-1,-1,0 });
mm[name] = cnt++;
}
}
for (int i = 0; i < m; i++)
{
cin >> name >> score;
if (mm[name] != 0) v[mm[name]-1].gm = score;
}
for (int i = 0; i < k; i++)
{
cin >> name >> score;
if (mm[name] != 0)
{
v[mm[name]-1].gf = v[mm[name]-1].g=score;
if (v[mm[name]-1].gm > score)
{
v[mm[name]-1].g = int(v[mm[name]-1].gm * 0.4 + score * 0.6+0.5);
}
}
}
for (int i = 0; i < v.size(); i++)
{
if (v[i].g >= 60) ans.push_back(v[i]);
}
sort(ans.begin(), ans.end(), cmp);
for (int i = 0; i < ans.size(); i++)
cout << ans[i].name <<" "<<ans[i].gp << " " << ans[i].gm << " " << ans[i].gf << " " << ans[i].g << endl;
return 0;
}
A1137 Final Grading
最新推荐文章于 2022-09-30 13:46:35 发布