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 ;
}

ural 1433. Diamonds的更多相关文章

  1. Spark on Yarn:java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://localhost\\db_instance_name:1433;databaseName=db_name

    本文只是针对当前特定环境下,出现的问题找不到sqljdbc驱动的案例.具体出现原因,可能是spark版本问题,也可能是集群配置问题. yarn-client方式下: 通过--jars参数指定驱动文件位 ...

  2. 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome

    题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...

  3. ural 2071. Juice Cocktails

    2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...

  4. ural 2073. Log Files

    2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...

  5. ural 2070. Interesting Numbers

    2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...

  6. ural 2069. Hard Rock

    2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...

  7. ural 2068. Game of Nuts

    2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...

  8. ural 2067. Friends and Berries

    2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...

  9. ural 2066. Simple Expression

    2066. Simple Expression Time limit: 1.0 secondMemory limit: 64 MB You probably know that Alex is a v ...

随机推荐

  1. [Effective JavaScript 笔记]第51条:在类数组对象上复用通用的数组方法

    前面有几条都讲过关于Array.prototype的标准方法.这些标准方法被设计成其他对象可复用的方法,即使这些对象并没有继承Array. arguments对象 在22条中提到的函数argument ...

  2. Dmaven.multiModuleProjectDirectory system propery is not set.

    eclipse中使用maven插件的时候,运行run as maven build的时候报错-Dmaven.multiModuleProjectDirectory system propery is ...

  3. spring+hibernate常见异常集合

    spring+hibernate出错小结: (1)java.lang.NoClassDefFoundError: org/hibernate/context/CurrentSessionContext ...

  4. 【GoLang】GoLang fmt 占位符详解

    golang 的fmt 包实现了格式化I/O函数,类似于C的 printf 和 scanf. # 定义示例类型和变量 type Human struct { Name string } var peo ...

  5. 【SpringMVC】SpringMVC系列8之Servlet API 作为入参

    8.Servlet API 作为入参 8.1.概述 MVC 的 Handler 方法可以接受哪些 ServletAPI 类型的参数: HttpServletRequest HttpServletRes ...

  6. php中常用魔术方法的举例

    魔术方法是php面向对象特有的功能,并且有时候能实现意想不到的效果,包括前面提到的构造函数.析构函数.还有__clone函数,另外再简单的介绍几个: 1.__toSring和__invoke clas ...

  7. Java for LeetCode 070 Climbing Stairs

    You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb ...

  8. 6.python模块(导入,内置,自定义,开源)

    一.模块 1.模块简介 模块是一个包含所有你定义的函数和变量的文件,其后缀名是.py.模块可以被别的程序引入,以使用该模块中的函数等功能.这也是使用python标准库的方法. 类似于函数式编程和面向过 ...

  9. codeforces 485A.Factory 解题报告

    题目链接:http://codeforces.com/problemset/problem/485/A 题目意思:给出 a 和 m,a 表示第一日的details,要求该日结束时要多生产 a mod ...

  10. codeforces A. Rook, Bishop and King 解题报告

    题目链接:http://codeforces.com/problemset/problem/370/A 题目意思:根据rook(每次可以移动垂直或水平的任意步数(>=1)),bishop(每次可 ...