1433. Diamonds

Time limit: 1.0 second
Memory limit: 64 MB
Sasha is lucky to have a diamond in the form of a regular tetrahedron. Incidentally, his friend Pasha has got a diamond of exactly the same shape and size. In order to distinguish between their diamonds, the friends decided to paint the crystals. Each of them painted each face of his diamond a certain color. The diamonds became very beautiful, so Pasha and Sasha were happy. But their happiness did not last long. That night, Sasha woke up with a sudden thought — what if his and Pasha's diamonds are still indistinguishable? He decided to call Pahsa immediately. Sasha ran up to the phone, tried to grasp the receiver, but at that moment the phone rang. Of course, it was Pasha, who had the same sudden thought. So Sasha and Pasha hastened to tell each other the colors of their diamonds' faces… Their worst fears were confirmed. Their diamonds were identical, and to see it one simply had to turn one of the diamonds.
You are to write a program that could prevent this horrible mistake. Given a scheme of the supposed coloring of the diamonds, determine if these colorings are identical, i.e., if one of them can be obtained from the other by turning the crystal.

Input

The input contains two lines. Each line contains four letters, which denote the colors of the faces in the following order: the base face, the "left front" face, the "right front" face, and the back face. There are only four paints available: red, green, blue, and yellow, denoted by the letters R, G, B, and Y, respectively.

Output

Output the word "equal" if the colored tetrahedrons will be identical, and the word "different" otherwise.

Sample

input output
RGRB
GRRB
equal
Problem Author: Pavel Egorov, Stanislav Vasilyev
Problem Source: The 7th USU Open Personal Contest - February 25, 2006
Difficulty: 252
题意:给两个正四面的的四个面的颜色,判断两个四面体是否相等。
分析:所以我们只要将所有匹对方式打个表就好。
 /**
Create By yzx - stupidboy
*/
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <vector>
#include <queue>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <ctime>
#include <iomanip>
using namespace std;
typedef long long LL;
typedef double DB;
#define For(i, s, t) for(int i = (s); i <= (t); i++)
#define Ford(i, s, t) for(int i = (s); i >= (t); i--)
#define Rep(i, t) for(int i = (0); i < (t); i++)
#define Repn(i, t) for(int i = ((t)-1); i >= (0); i--)
#define rep(i, x, t) for(int i = (x); i < (t); i++)
#define MIT (2147483647)
#define INF (1000000001)
#define MLL (1000000000000000001LL)
#define sz(x) ((int) (x).size())
#define clr(x, y) memset(x, y, sizeof(x))
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define ft first
#define sd second
#define mk make_pair
inline void SetIO(string Name)
{
string Input = Name+".in",
Output = Name+".out";
freopen(Input.c_str(), "r", stdin),
freopen(Output.c_str(), "w", stdout);
} inline int Getint()
{
int Ret = ;
char Ch = ' ';
bool Flag = ;
while(!(Ch >= '' && Ch <= ''))
{
if(Ch == '-') Flag ^= ;
Ch = getchar();
}
while(Ch >= '' && Ch <= '')
{
Ret = Ret * + Ch - '';
Ch = getchar();
}
return Flag ? -Ret : Ret;
} const int N = , M = ;
int Face[][]={
{, , , }, {, , , }, {, , , },
{, , , }, {, , , }, {, , , },
{, , , }, {, , , }, {, , , },
{, , , }, {, , , }, {, , , }
};
struct Node
{
int Arr[];
inline void Read()
{
string Str;
cin >> Str;
Rep(i, ) Arr[i] = Str[i];
}
} A, B; inline void Input()
{
A.Read();
B.Read();
} inline void Solve()
{
Rep(i, )
{
bool Flag = ;
Rep(j, )
if(A.Arr[Face[i][j]] != B.Arr[j])
{
Flag = ;
break;
}
if(!Flag)
{
puts("equal");
return;
}
}
puts("different");
} int main()
{
#ifndef ONLINE_JUDGE
SetIO("B");
#endif
Input();
Solve();
return ;
}

最新文章

  1. SQLite 的创建与编辑
  2. firefox 下event事件失效的解决方法
  3. Web应用程序系统的多用户权限控制设计及实现-权限模块【10】
  4. sdutoj 2608 Alice and Bob
  5. 【Android】Handler、Looper源码分析
  6. PHP中的抽象类和接口
  7. Entity Framework 6.1 学习系列1--概况、安装
  8. PHP foreach()跳出本次或当前循环与终止循环方法
  9. 分享一个自己写的基于JQuery的一个Web背景切换的Demo
  10. Apache HTTP Server
  11. vs2013 linq to mysql
  12. Google HTML/CSS 编码规范
  13. NodeJs之crypto
  14. 控制结构(8) 线性化(linearization)
  15. [Swift]LeetCode248.对称数 III $ Strobogrammatic Number III
  16. Spring AOP @AspectJ 入门基础
  17. BZOJ 2173 luoguo P4451 [国家集训队]整数的lqp拆分
  18. Codeforces 960D - Full Binary Tree Queries
  19. 随机取出数组中的某些值,并删除它们array_splice,array_slice
  20. oracle之 变更OS时间对数据库的影响

热门文章

  1. xcode注释
  2. 使用JDBC获取各数据库的Meta信息——表以及对应的列
  3. 极客教学:如何使用树莓派击落&amp;劫持无人机
  4. DICOM:DICOM标准学习路线图(初稿)
  5. 【SpringMVC】SpringMVC系列6之@CookieValue 映射请求Cookie 值
  6. 尖刀出鞘的display常用属性及css盒模型深入研究
  7. Xenomai 安装准备工作
  8. 在SharePoint 2010 母版页里添加自定义用户控件
  9. Eclipse 一直提示 loading descriptor for 的解决方法(转)
  10. Python多线程(1)——介绍