-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUVA 11286 Conformity.cpp
More file actions
45 lines (41 loc) · 1005 Bytes
/
UVA 11286 Conformity.cpp
File metadata and controls
45 lines (41 loc) · 1005 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
int main()
{
int n;
while (cin >> n) {
int max_amount = 0, max = 0, temp;
map<string, int> m;
while (n--) {
vector<int> vec;
for (int i = 0; i < 5; i++) {
cin >> temp;
vec.push_back(temp);
}
sort(vec.begin(), vec.end());
string word;
for (int i = 0; i < 5; i++) {
word += to_string(vec[i]);
}
m[word]++;
if (m[word] == max) {
max_amount++;
}
else if (m[word] > max) {
max = m[word];
max_amount = 1;
}
}
cout << max * max_amount << endl;
}
return 0;
}