#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
class Person
{
string first;
string last;
int age;
public:
Person(string first_name, string last_name, int the_age);
string getFirstName() const { return first; }
string getLastName() const { return last; }
int getAge() const { return age; }
};
Person::Person(string first_name, string last_name, int the_age){
first = first_name;
last = last_name;
age = the_age;
}
int main()
{
vector<Person> people;
people.emplace_back("Joe", "Smoe", 25);
people.emplace_back("John", "Cool-Johnson", 15);
people.emplace_back("Paul", "Bob", 1000);
auto max_name = max_element(
people.begin(), people.end(),
[](const Person &a, const Person &b){
return a.getFirstName().size() < b.getFirstName().size();
}
)->getFirstName().size();
cout << max_name;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8YWxnb3JpdGhtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwogCmNsYXNzIFBlcnNvbgp7CglzdHJpbmcgZmlyc3Q7CiAgICBzdHJpbmcgbGFzdDsKICAgIGludCBhZ2U7CiAKcHVibGljOgoJUGVyc29uKHN0cmluZyBmaXJzdF9uYW1lLCBzdHJpbmcgbGFzdF9uYW1lLCBpbnQgdGhlX2FnZSk7CiAKCXN0cmluZyBnZXRGaXJzdE5hbWUoKSBjb25zdCB7IHJldHVybiBmaXJzdDsgfQoJc3RyaW5nIGdldExhc3ROYW1lKCkgY29uc3QgeyByZXR1cm4gbGFzdDsgfQogICAgaW50IGdldEFnZSgpIGNvbnN0IHsgcmV0dXJuIGFnZTsgfQp9OwogClBlcnNvbjo6UGVyc29uKHN0cmluZyBmaXJzdF9uYW1lLCBzdHJpbmcgbGFzdF9uYW1lLCBpbnQgdGhlX2FnZSl7CglmaXJzdCA9IGZpcnN0X25hbWU7CglsYXN0ID0gbGFzdF9uYW1lOwoJYWdlID0gdGhlX2FnZTsKfSAKIAppbnQgbWFpbigpCnsKCXZlY3RvcjxQZXJzb24+IHBlb3BsZTsKCXBlb3BsZS5lbXB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