AcWing 1944. 记录保存
原题链接
简单
作者:
凡尘_4
,
2022-04-20 21:03:51
,
所有人可见
,
阅读 166
C++ 代码
#include <iostream>
#include <cstring>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
typedef set<string> S;
map<S, int> h;
// typedef unordered_set<string> S;
// unordered_map<S, int> h;
int n;
int main()
{
cin>>n;
for(int i=0;i<n;i++)
{
string s;
S ss;
for(int j=0;j<3;j++) cin>>s, ss.insert(s);
h[ss]++;
}
auto it = max_element(h.begin(),h.end(),
[](const auto a, const auto b)->bool{return a.second < b.second;});
cout<<it->second;
return 0;
}