#include<iterator>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<functional>
#include<iostream>
using namespace std;
string zrotate(string s)//anticlockwise
{
char temp = s[1];
s[1] = s[2], s[2] = s[4], s[4] = s[3], s[3] = temp;
return s;
}
string xrotate(string s)
{
char temp = s[3];
s[3] = s[5], s[5] = s[2], s[2] = s[0], s[0] = temp;
return s;
}
string yrotate(string s)
{
char temp = s[1];
s[1] = s[0], s[0] = s[4], s[4] = s[5], s[5] = temp;
return s;
}
inline string rotate(int x, int y, int z, string s)
{
for (int i = 0; i < x; ++i)
s = xrotate(s);
for (int i = 0; i < y; ++i)
s = yrotate(s);
for (int i = 0; i < z; ++i)
s = zrotate(s);
return s;
}
int main()
{
string s;
while (cin >> s)
{
string s1(s, 0, 6), s2(s, 6, 6);
int equal = 0;
for (int i = 0; i <= 3; ++i)
{
for (int j = 0; j <= 3; ++j)
{
for (int k = 0; k <= 3; ++k)
{
if (rotate(i, j, k, s2) == s1)
{
equal = 1;
break;
}
}
}
}
if (equal == 1)
cout << "TRUE" << endl;
else
cout << "FALSE" << endl;
}
}
UVa 253
最新推荐文章于 2022-02-03 17:26:26 发布