mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
bd4f730b16
1900-1999
41 lines
747 B
C++
41 lines
747 B
C++
#include<stdio.h>
|
|
#include<string>
|
|
#include<algorithm>
|
|
#include<iostream>
|
|
#include<map>
|
|
using namespace std;
|
|
int s[10001][6];
|
|
int main()
|
|
{
|
|
int n,i,j,sum,max,num;
|
|
map<string,int>::iterator it;
|
|
map<string,int>ans;
|
|
while(scanf("%d",&n),n)
|
|
{
|
|
ans.clear();
|
|
for(i=1;i<=n;i++)
|
|
for(j=0;j<5;j++)
|
|
scanf("%d",&s[i][j]);
|
|
for(i=1;i<=n;i++)
|
|
sort(s[i],s[i]+5);
|
|
for(i=1;i<=n;i++)
|
|
{
|
|
string str;
|
|
for(j=0;j<5;j++)
|
|
{
|
|
char a[5];
|
|
itoa(s[i][j],a,10);
|
|
str+=a;
|
|
}
|
|
ans[str]++;
|
|
}
|
|
max=num=0;
|
|
for(it=ans.begin();it!=ans.end();it++)
|
|
if(it->second>max)max=it->second;
|
|
for(it=ans.begin();it!=ans.end();it++)
|
|
if(it->second==max)num++;
|
|
printf("%d\n",num*max);
|
|
}
|
|
return 0;
|
|
}
|