Result: Accepted
Time: 481ms
Memory: 1756kB
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define INF 0x3f3f3f3f
#define lowbit(x) (x&(-x))
using namespace std;
typedef long long ll;
const int maxn = 1e6 + 10;
string s[105];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
int n;
scanf("%d",&n);
for(int i = 0; i < n; i++)
cin>>s[i];
int maxx = -1;
for(int i = 0; i < n; i++)
{
int ans = 0;
for(int j = 0; j < n; j++)
{
if(s[i] == s[j])
ans++;
}
maxx = max(maxx,ans);
}
printf("%d\n",maxx);
}
}