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;
	}
}
posted @ 2025-11-27 22:39  ll今天也要加油啊  阅读(3)  评论(0)    收藏  举报