#include <iostream> #include <vector> #include <cstring> #include <algorithm> using namespace std; vector<string> v; int main() { int count = 0; string a = "xxxyyyyzzzzz"; do { int i; for (i = 0; i < v.size(); i++) { if (v[i].find(a) != string::npos) { break; } } if (i != v.size()) continue; string b = a + a; v.push_back(b); reverse(b.begin(), b.end()); v.push_back(b); count++; } while (next_permutation(a.begin(), a.end())); cout << count; }