Start: Jul, 03, 2019 08:38:00
2019年度暑期短学期第七天 助教场
End: Jul, 04, 2019 23:00:00
Time elapsed:
Time remaining:

Problem_ID: B
Result: Accepted
Time: 412ms
Memory: 1756kB
Author: 2018212212161
In contest: 1292

#include<bits/stdc++.h>
using namespace std;

const int maxn=100+6;
const int inf=0x3f3f3f3f;

string a[maxn];
int cnt[maxn];

int main()
{
    int t;
    cin>>t;
    while(t--)
    {
        memset(cnt,0,sizeof cnt);
        int n,ans=0;
        cin>>n;
        for(int i=1;i<=n;i++) cin>>a[i];
        for(int i=1;i<=n;i++)
        {
            for(int j=i+1;j<=n;j++)
                if(a[i]==a[j])  cnt[i]++;
            ans=max(ans,cnt[i]);
        }
        cout<<ans+1<<endl;
    }
}