Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <unordered_map>
- #include <vector>
- using namespace std;
- unordered_map<char, int> cm;
- int m[10][10][10][10];
- string cv = "ABCGORSVWY";
- void f(string &o) {
- for (int i = 0; i < 4; i++) {
- m[cm[o[i % 4]]][cm[o[(i + 1) % 4]]][cm[o[(i + 2) % 4]]][cm[o[(i + 3) % 4]]]++;
- }
- }
- int main() {
- for (int i = 0; i < 10; i++) {
- cm[cv[i]] = i;
- }
- int n;
- cin >> n;
- for (int i = 0; i < n; i++) {
- string s;
- cin >> s;
- string o1 = {s[0], s[1], s[3], s[2]};
- string o2 = {s[0], s[5], s[3], s[4]};
- string o3 = {s[5], s[1], s[4], s[2]};
- // int pv = m[0][7][3][9];
- f(o1);
- f(o2);
- f(o3);
- // if (m[0][7][3][9] > pv) {
- // cout << i << ' ';
- // }
- }
- // cout << endl << "-------------" << endl;
- int mh = -1;
- for (int a = 0; a < 10; a++) {
- for (int b = 0; b < 10; b++) {
- for (int c = 0; c < 10; c++) {
- for (int d = 0; d < 10; d++) {
- if (m[a][b][c][d] > mh) {
- mh = m[a][b][c][d];
- // cout << a << ' ' << b << ' ' << c << ' ' << d << ": " << mh << " | ";
- }
- }
- }
- }
- }
- // cout << endl;
- cout << mh;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement