题目描述
思路:
模拟题,一大堆细节需要调试,具体细节看代码
c o d e code code
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int n;
struct node
{
string s;
int x, y, id, v;
bool bz;
}a[1010100];
bool cmp(node x, node y)
{
return x.x>y.x;
}
bool cmp1(node x, node y)
{
return x.y>y.y;
}
bool cmp2(node x, node y)
{
if(x.v!=y.v)
return x.v<y.v;
else return x.id<y.id;
}
int main()
{
scanf("%d", &n);
for(int i=1; i<=n; i++)
{
cin>>a[i].s>>a[i].x>>a[i].y;
a[i].id=i, a[i].v=1;
}
sort(a+1, a+1+n, cmp);
{
int rank=0, i;
for(i=1; i<=n/2||a[i].x==a[i-1].x; i++)
{
if(a[i].x!=a[i-1].x)
rank=i;
a[i].v*=rank;
}
for(; i<=n; i++)
a[i].bz=1;
}
sort(a+1, a+1+n, cmp1);
{
int rank=0, i;
for(i=1; i<=n/2||a[i].y==a[i-1].y; i++)
{
if(a[i].y!=a[i-1].y)
rank=i;
a[i].v*=rank;
}
for(; i<=n; i++)
a[i].bz=1;
}
sort(a+1, a+1+n, cmp2);
bool flag=0;
for(int i=1; i<=n; i++)
if(!a[i].bz)
cout<<a[i].s<<endl, flag=1;
if(!flag)
printf("none");
return 0;
}