只有20分
查看原帖
只有20分
1347243
JYF_go楼主2024/6/27 08:00
#include<cstdio>
#include<algorithm>
#include<iostream>
using namespace std;
struct node
{
    int shu;
    char zhen;
    string ming;
};
bool cmp(node x,node y)
{
    if(x.zhen != y.zhen)
        return x.zhen < y.zhen;
    else if(x.shu != y.shu)
        return x.shu > y.shu;
}
int n,m;
node h[100001];
int main()
{
    scanf("%d%d",&n,&m);
    int t=m + n;
    for(int i=1;i<=t;i++)
    {
        cin >> h[i].ming >> h[i].zhen >> h[i].shu;
    }
    sort(h+1,h+t+1,cmp);
    cout << h[3].ming << "\n";
    int u = n;
    n += 5;
    for(int i = u;i <= n ;i ++)
    {
        cout << h[i].ming << endl ;
    }
    return 0;
    
}

2024/6/27 08:00
加载中...