首页 > 其他 > 详细

ural 1433. Diamonds

时间:2015-11-19 22:32:48      阅读:302      评论:0      收藏:0      [点我收藏+]

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

inputoutput
RGRB
GRRB
equal
Problem Author: Pavel Egorov, Stanislav Vasilyev
Problem Source: The 7th USU Open Personal Contest - February 25, 2006

ural 1433. Diamonds

原文:http://www.cnblogs.com/StupidBoy/p/4979107.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!