You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
498 B
27 lines
498 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
int n;
|
|
const int N = 30;
|
|
|
|
struct Node {
|
|
string x;
|
|
int sq_sum;
|
|
} a[N];
|
|
|
|
bool cmp(const Node &A, const Node &B) {
|
|
if (A.x.size() != B.x.size()) return A.x.size() > B.x.size();
|
|
return A.x > B.x;
|
|
}
|
|
|
|
int main() {
|
|
cin >> n;
|
|
for (int i = 0; i < n; i++) {
|
|
cin >> a[i].x;
|
|
a[i].num = i + 1;
|
|
}
|
|
sort(a, a + n, cmp);
|
|
cout << a[0].num << endl;
|
|
cout << a[0].x << endl;
|
|
return 0;
|
|
} |