memset 破坏string
memset就不用了 反正也是更优的
#include <bits/stdc++.h>
using namespace std;
struct node
{
string na;int n,t;
bool operator < (const node &it) const
{
if(n==it.n) return t<it.t;
else return n>it.n;
}
}e[10005];
int main()
{
int c;cin>>c;
while(c--)
{
int n;cin>>n;
for(int i=0;i<n;i++)
{
string nn;int nnn,tt;
cin>>nn>>nnn>>tt;
e[i]={nn,nnn,tt};
}
sort(e,e+n);
cout<<e[0].na<<" "<<e[0].n<<" "<<e[0].t<<endl;
}
}

浙公网安备 33010602011771号