#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
string vote;
string max="";
int index;
cin>>n;
for (int i=0;i<n;i++){
cin>>vote;
if ((vote.size()>max.size()) || (vote.size()==max.size() && vote>max)){//位数不同比位数,位数相同比大小
index=i+1;
max=vote;
}
}
cout<<index<<endl<<max<<endl;
return 0;
}
洛谷-P1781-宇宙总统
最新推荐文章于 2024-07-14 13:39:50 发布