-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuva11286.cpp
More file actions
30 lines (28 loc) · 708 Bytes
/
Copy pathuva11286.cpp
File metadata and controls
30 lines (28 loc) · 708 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include<map>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
map<vector<int>, int> m;
int n;
while(cin >> n, n) {
m.clear();
while(n--) {
vector<int> v(5);
for(int i = 0; i < 5; i++) {
cin >> v[i];
}
sort(v.begin(), v.end());
m[v] += 1;
}
int maxval=0;
for(auto it = m.begin(); it != m.end(); it++)
maxval = max(maxval, it->second);
int answer = 0;
for(auto it = m.begin(); it != m.end(); it++)
if (it->second == maxval)
answer += maxval;
printf("%d\n", answer);
}
}