Result: Accepted
Time: 540ms
Memory: 1760kB
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <vector>
#include <set>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <deque>
#define clr(a,b) memset(a,b,sizeof(a))
#define ll long long
using namespace std;
const int maxn=1e2+10;
int t,n,maxi;
string s;
map<string,int>mp;
int main()
{
cin>>t;
while(t--)
{
maxi=0,mp.clear();
cin>>n;
while(n--)
{
cin>>s;
mp[s]++;
maxi=max(maxi,mp[s]);
}
cout<<maxi<<endl;
}
}