洛谷混了三个月,连个黄题都做不出来了
#1 #2 WA,其他点AC,不知道为啥
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
using namespace std;
int n,m;
struct t
{
int ind;
string val;
bool operator<(const t& b) const{
return val < b.val;
}
bool operator>(const t& b) const{
return val > b.val;
}
}nu[100001];
int main(){
//int n;
scanf("%d",&n);
for(int i=0;i<n;i++){
nu[i].ind=i+1;
nu[i].val.resize(1000);
scanf("%s",&nu[i].val[0]);
}
sort(nu,nu+n);
//printf("%d\n%d",nu[n-2].ind,nu[n-2].val);
// for(int i=0;i<n;i++){
// printf("%lld %lld\n",nu[i].ind,nu[i].val);
// }
printf("%d\n%s",nu[n-1].ind,nu[n-1].val.c_str());
//system("pause");
return 0;
}