Problem:


  MathJax.Hub.Config({ tex2jax: { inlineMath: [["$","$"], ["\\(","\\)"]], processEscapes: true }});

Dice III

  Write a program which reads the two dices constructed in the same way as Dice I, and determines whether these two dices are identical. You can roll a dice in the same way as Dice I, and if all integers observed from the six directions are the same as that of another dice, these dices can be considered as identical.

Input

  In the first line, six integers assigned to faces of a dice are given in ascending order of their corresponding labels.

    In the second line, six integers assigned to faces of another dice are given in ascending order of their corresponding labels.

Output

  Print "Yes" if two dices are identical, otherwise "No" in a line.

Constraints

$0 \leq $ the integer assigned to a face $ \leq 100$

Sample Input 1

1 2 3 4 5 6
6 2 4 3 5 1

Sample Output 1

Yes

Sample Input 2

1 2 3 4 5 6
6 5 4 3 2 1

Sample Output 2

No



Sample input:
1 2 3 4 5 6
6 2 4 3 5 1


Sample output:
Yes

Submission status: Wrong Answer

Solution code:
n1 = [int(i) for i in input().split()]
n2 = [int(i) for i in input().split()]


class Dice(object):
    def __init__(self,num):
        self.n = num[4]
        self.e = num[2]
        self.w = num[3]
        self.s = num[1]
        self.center = num[0]
        self.back = num[5]

    def number(self):
        number = [self.center, self.s, self.e, self.w, self.n, self.back]
        return number

    def move(self,str):
        if str == 'N':
            x = self.n
            self.n = self.center
            self.center = self.s
            self.s = self.back
            self.back = x
            return self.center
        elif str == 'S':
            x = self.s
            self.s = self.center
            self.center = self.n
            self.n = self.back
            self.back = x
            return self.center
        elif str== 'E':
            x = self.e
            self.e = self.center
            self.center = self.w
            self.w = self.back
            self.back = x
            return self.center
        elif str == 'W':
            x = self.w
            self.w = self.center
            self.center = self.e
            self.e = self.back
            self.back = x
            return self.center

dice1 = Dice(n1)
dice2 = Dice(n2)
bool = False
status = dice1.center

while True:
    if dice1.center == dice2.center:
        break
    else:
        dice1.move('N')
    set = dice1.center
    while True:
        if dice1.center == dice2.center:
            break
        else:
            dice1.move('E')
        if set == dice1.center:
            break


for i in range(4):
    # print(dice1.number(), dice2.number())
    if dice1.number() == dice2.number():
        bool = True
    else:
        dice1.move('N')
        dice1.move('E')
        dice1.move('S')



print('Yes') if bool == True else print('No')

Submission status: Wrong Answer

Solution code:
class Dice:

    __top = 0
    __front = 1
    __right = 2
    __left = 3
    __back = 4
    __bottom = 5

    def __init__(self, a, b, c, d, e, f):
        self.__dice = [a,b,c,d,e,f]

    def S(self):
        dice_before = self.__dice[:]
        self.__dice[Dice.__top]    = dice_before[Dice.__back]
        self.__dice[Dice.__front]  = dice_before[Dice.__top]
        self.__dice[Dice.__right]  = dice_before[Dice.__right]
        self.__dice[Dice.__left]   = dice_before[Dice.__left]
        self.__dice[Dice.__back]   = dice_before[Dice.__bottom]
        self.__dice[Dice.__bottom] = dice_before[Dice.__front]

    def E(self):
        dice_before = self.__dice[:]
        self.__dice[Dice.__top]    = dice_before[Dice.__left]
        self.__dice[Dice.__front]  = dice_before[Dice.__front]
        self.__dice[Dice.__right]  = dice_before[Dice.__top]
        self.__dice[Dice.__left]   = dice_before[Dice.__bottom]
        self.__dice[Dice.__back]   = dice_before[Dice.__back]
        self.__dice[Dice.__bottom] = dice_before[Dice.__right]

    def W(self):
        dice_before = self.__dice[:]
        self.__dice[Dice.__top]    = dice_before[Dice.__right]
        self.__dice[Dice.__front]  = dice_before[Dice.__front]
        self.__dice[Dice.__right]  = dice_before[Dice.__bottom]
        self.__dice[Dice.__left]   = dice_before[Dice.__top]
        self.__dice[Dice.__back]   = dice_before[Dice.__back]
        self.__dice[Dice.__bottom] = dice_before[Dice.__left]

    def N(self):
        dice_before = self.__dice[:]
        self.__dice[Dice.__top]    = dice_before[Dice.__front]
        self.__dice[Dice.__front]  = dice_before[Dice.__bottom]
        self.__dice[Dice.__right]  = dice_before[Dice.__right]
        self.__dice[Dice.__left]   = dice_before[Dice.__left]
        self.__dice[Dice.__back]   = dice_before[Dice.__top]
        self.__dice[Dice.__bottom] = dice_before[Dice.__back]

    def turn(self):
        dice_before = self.__dice[:]
        self.__dice[Dice.__top]    = dice_before[Dice.__top]
        self.__dice[Dice.__front]  = dice_before[Dice.__right]
        self.__dice[Dice.__right]  = dice_before[Dice.__back]
        self.__dice[Dice.__left]   = dice_before[Dice.__front]
        self.__dice[Dice.__back]   = dice_before[Dice.__left]
        self.__dice[Dice.__bottom] = dice_before[Dice.__bottom]

    def top(self):
        return(self.__dice[Dice.__top])

    def front(self):
        return(self.__dice[Dice.__front])

    def right(self):
        return(self.__dice[Dice.__right])

    def left(self):
        return(self.__dice[Dice.__left])

    def back(self):
        return(self.__dice[Dice.__back])

    def bottom(self):
        return(self.__dice[Dice.__bottom])

    def compare(self, dice):
        if (self.__dice[Dice.__top]    == dice.__dice[Dice.__top] and
            self.__dice[Dice.__front]  == dice.__dice[Dice.__front] and
            self.__dice[Dice.__right]  == dice.__dice[Dice.__right] and
            self.__dice[Dice.__left]   == dice.__dice[Dice.__left] and
            self.__dice[Dice.__back]   == dice.__dice[Dice.__back] and
            self.__dice[Dice.__bottom] == dice.__dice[Dice.__bottom]):
            print("Yes")
        else:
            print("No")

    def print(self):
        print('[top   ] :', self.__dice[Dice.__top])
        print('[front ] :', self.__dice[Dice.__front])
        print('[right ] :', self.__dice[Dice.__right])
        print('[left  ] :', self.__dice[Dice.__left])
        print('[back  ] :', self.__dice[Dice.__back])
        print('[bottom] :', self.__dice[Dice.__bottom])


def S(dice, top):
    for t in range(4):
        if dice.top() == top:
            return dice
        dice.S()
    return dice

def turn(dice, front):
    for t in range(4):
        if dice.front() == front:
            return dice
        dice.turn()
    return dice

a,b,c,d,e,f = input().split()
dice1 = Dice(a,b,c,d,e,f)

a,b,c,d,e,f = input().split()
dice2 = Dice(a,b,c,d,e,f)

top = dice1.top()
front = dice1.front()

for to in range(2):
    dice2 = S(dice2, top)
    if dice2.top() == top:
        break
    else:
        dice2.turn()

for fr in range(4):
    dice2 = turn(dice2, front)
    if dice2.front() == front:
        break

dice1.compare(dice2)

Submission status: Wrong Answer

Solution code:
class Dice:
    def __init__(self,l1,l2,l3,l4,l5,l6):
        self.l1 = l1
        self.l2 = l2
        self.l3 = l3
        self.l4 = l4
        self.l5 = l5
        self.l6 = l6
        self.top = 1
        self.front = 2
        self.right = 3

    def get_top(self):
        return eval("self." + 'l' + str(self.top))

    def get_right(self):
        return eval("self." + 'l' + str(self.right))

    def get_front(self):
        return eval("self." + 'l' + str(self.front))

    def get_bottom(self):
        return eval("self." + 'l' + str(7-self.top))

    def get_left(self):
        return eval("self." + 'l' + str(7-self.right))

    def get_back(self):
        return eval("self." + 'l' + str(7-self.front))

    def rot(self):
        self.front,self.right = self.right,7-self.front

    def move(self, order):
        if order == 'S':
            pretop = self.top
            self.top = 7 - self.front
            self.front = pretop
        elif order == 'E':
            pretop = self.top
            self.top = 7 - self.right
            self.right = pretop


def match_top(dice,target):
    for i in range(4):
        dice.move('S')
        if dice.get_top() == target:
            return dice
    return False


l = list(map(int,input().split()))
d1 = Dice(l[0],l[1],l[2],l[3],l[4],l[5])

l = list(map(int,input().split()))
d2 = Dice(l[0],l[1],l[2],l[3],l[4],l[5])

d1_top = d1.get_top()
d1_front = d1.get_front()
d1_right = d1.get_right()
d1_bottom = d1.get_bottom()
d1_back = d1.get_back()
d1_left = d1.get_left()
ret = match_top(d2,d1_top)

if ret == False:
    d2.move('E')
    ret = match_top(d2,d1_top)
if ret == False:
    print('No')
else:
    matched = False
    for i in range(4):
        d2.rot()
        if d2.get_front() == d1_front and \
        d2.get_right() == d1_right and \
        d2.get_bottom() == d1_bottom and \
        d2.get_left() == d1_left and \
        d2.get_back == d1_back:
            matched = True
            print ('Yes')
            break
    if not matched:
        print('No')

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3

import sys


class Die:
    def __init__(self, pips):
        self.pips = pips

    def move_die(self, direction):
        if direction == 'N':
            tmp = self.pips[0]
            self.pips[0] = self.pips[1]
            self.pips[1] = self.pips[5]
            self.pips[5] = self.pips[4]
            self.pips[4] = tmp
            del tmp
        elif direction == 'S':
            tmp = self.pips[0]
            self.pips[0] = self.pips[4]
            self.pips[4] = self.pips[5]
            self.pips[5] = self.pips[1]
            self.pips[1] = tmp
            del tmp
        elif direction == 'E':
            tmp = self.pips[0]
            self.pips[0] = self.pips[3]
            self.pips[3] = self.pips[5]
            self.pips[5] = self.pips[2]
            self.pips[2] = tmp
            del tmp
        elif direction == 'W':
            tmp = self.pips[0]
            self.pips[0] = self.pips[2]
            self.pips[2] = self.pips[5]
            self.pips[5] = self.pips[3]
            self.pips[3] = tmp
            del tmp

    def spin_die_clockwise(self):
        tmp = self.pips[1]
        self.pips[1] = self.pips[2]
        self.pips[2] = self.pips[4]
        self.pips[4] = self.pips[3]
        self.pips[3] = tmp
        del tmp

    def get_upside(self):
        return self.pips[0]

    def get_frontside(self):
        return self.pips[1]

    def get_rightside(self):
        return self.pips[2]


def init_die():
    pips = [int(pip) for pip in sys.stdin.readline().strip('\n').split()]
    die = Die(pips)

    return die


def roll_die(die):
    directions = list(sys.stdin.readline().strip('\n'))

    for direction in directions:
        die.move_die(direction)

    return die


def question_rightside(die):
    q = int(sys.stdin.readline().strip('\n'))

    for question in range(q):
        q_pips = [int(pip) for pip in sys.stdin.readline().strip('\n').split()]

        if q_pips[0] == die.pips[1]:
            die.move_die('N')
        elif q_pips[0] == die.pips[2]:
            die.move_die('W')
        elif q_pips[0] == die.pips[3]:
            die.move_die('E')
        elif q_pips[0] == die.pips[4]:
            die.move_die('S')
        elif q_pips[0] == die.pips[5]:
            die.move_die('N')
            die.move_die('N')

        while die.get_frontside() != q_pips[1]:
            die.spin_die_clockwise()

        print(die.get_rightside())


def main():
    die1 = init_die()
    die2 = init_die()

    pip_count = int()

    for pip in die1.pips:
        if pip in die2.pips:
            pip_count += 1

    if pip_count < 6:
        print('No')
    else:
        while die1.pips[0] != die2.pips[0]:
            if die1.pips[0] == die2.pips[1]:
                die2.move_die('N')
            elif die1.pips[0] == die2.pips[2]:
                die2.move_die('W')
            elif die1.pips[0] == die2.pips[3]:
                die2.move_die('E')
            elif die1.pips[0] == die2.pips[4]:
                die2.move_die('S')
            elif die1.pips[0] == die2.pips[5]:
                die2.move_die('N')
                die2.move_die('N')

        spin_count = int()

        while True:
            if spin_count == 3:
                print('No')
                break
            if die1.pips[1] == die2.pips[1] and \
               die1.pips[2] == die2.pips[2] and \
               die1.pips[3] == die2.pips[3] and \
               die1.pips[4] == die2.pips[4] and \
               die1.pips[5] == die2.pips[5]:
                print('Yes')
                break
            die2.spin_die_clockwise()
            spin_count += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3

import sys


class Die:
    def __init__(self, pips):
        self.pips = pips

    def move_die(self, direction):
        if direction == 'N':
            tmp = self.pips[0]
            self.pips[0] = self.pips[1]
            self.pips[1] = self.pips[5]
            self.pips[5] = self.pips[4]
            self.pips[4] = tmp
            del tmp
        elif direction == 'S':
            tmp = self.pips[0]
            self.pips[0] = self.pips[4]
            self.pips[4] = self.pips[5]
            self.pips[5] = self.pips[1]
            self.pips[1] = tmp
            del tmp
        elif direction == 'E':
            tmp = self.pips[0]
            self.pips[0] = self.pips[3]
            self.pips[3] = self.pips[5]
            self.pips[5] = self.pips[2]
            self.pips[2] = tmp
            del tmp
        elif direction == 'W':
            tmp = self.pips[0]
            self.pips[0] = self.pips[2]
            self.pips[2] = self.pips[5]
            self.pips[5] = self.pips[3]
            self.pips[3] = tmp
            del tmp

    def spin_die_clockwise(self):
        tmp = self.pips[1]
        self.pips[1] = self.pips[2]
        self.pips[2] = self.pips[4]
        self.pips[4] = self.pips[3]
        self.pips[3] = tmp
        del tmp


def init_die():
    pips = [int(pip) for pip in sys.stdin.readline().strip('\n').split()]
    die = Die(pips)

    return die


def roll_die(die):
    directions = list(sys.stdin.readline().strip('\n'))

    for direction in directions:
        die.move_die(direction)

    return die


def question_rightside(die):
    q = int(sys.stdin.readline().strip('\n'))

    for question in range(q):
        q_pips = [int(pip) for pip in sys.stdin.readline().strip('\n').split()]

        if q_pips[0] == die.pips[1]:
            die.move_die('N')
        elif q_pips[0] == die.pips[2]:
            die.move_die('W')
        elif q_pips[0] == die.pips[3]:
            die.move_die('E')
        elif q_pips[0] == die.pips[4]:
            die.move_die('S')
        elif q_pips[0] == die.pips[5]:
            die.move_die('N')
            die.move_die('N')

        while die.pips[1] != q_pips[1]:
            die.spin_die_clockwise()

        print(die.pips[2])


def main():
    die1 = init_die()
    die2 = init_die()

    if sorted(die1.pips) != sorted(die2.pips):
        print('No')
    else:
        for idx, pip in enumerate(die2.pips):
            for spin in range(4):
                if die1.pips == die2.pips:
                    print('Yes')
                    sys.exit(0)
                else:
                    die2.spin_die_clockwise()
            if idx in {0, 1, 2, 3}:
                die2.move_die('N')
            if idx in {4}:
                die2.move_die('E')
            if idx in {5}:
                die2.move_die('E')
                die2.move_die('E')

        print('No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3

import sys


class Die:
    def __init__(self, pips):
        self.pips = pips

    def move_die(self, direction):
        if direction == 'N':
            tmp = self.pips[0]
            self.pips[0] = self.pips[1]
            self.pips[1] = self.pips[5]
            self.pips[5] = self.pips[4]
            self.pips[4] = tmp
            del tmp
        elif direction == 'S':
            tmp = self.pips[0]
            self.pips[0] = self.pips[4]
            self.pips[4] = self.pips[5]
            self.pips[5] = self.pips[1]
            self.pips[1] = tmp
            del tmp
        elif direction == 'E':
            tmp = self.pips[0]
            self.pips[0] = self.pips[3]
            self.pips[3] = self.pips[5]
            self.pips[5] = self.pips[2]
            self.pips[2] = tmp
            del tmp
        elif direction == 'W':
            tmp = self.pips[0]
            self.pips[0] = self.pips[2]
            self.pips[2] = self.pips[5]
            self.pips[5] = self.pips[3]
            self.pips[3] = tmp
            del tmp

    def spin_die_clockwise(self):
        tmp = self.pips[1]
        self.pips[1] = self.pips[2]
        self.pips[2] = self.pips[4]
        self.pips[4] = self.pips[3]
        self.pips[3] = tmp
        del tmp


def init_die():
    pips = [int(pip) for pip in sys.stdin.readline().strip('\n').split()]
    die = Die(pips)

    return die


def roll_die(die):
    directions = list(sys.stdin.readline().strip('\n'))

    for direction in directions:
        die.move_die(direction)

    return die


def question_rightside(die):
    q = int(sys.stdin.readline().strip('\n'))

    for question in range(q):
        q_pips = [int(pip) for pip in sys.stdin.readline().strip('\n').split()]

        if q_pips[0] == die.pips[1]:
            die.move_die('N')
        elif q_pips[0] == die.pips[2]:
            die.move_die('W')
        elif q_pips[0] == die.pips[3]:
            die.move_die('E')
        elif q_pips[0] == die.pips[4]:
            die.move_die('S')
        elif q_pips[0] == die.pips[5]:
            die.move_die('N')
            die.move_die('N')

        while die.pips[1] != q_pips[1]:
            die.spin_die_clockwise()

        print(die.pips[2])


def main():
    die1 = init_die()
    die2 = init_die()

    if sorted(die1.pips) != sorted(die2.pips):
        print('No')
    else:
        for idx, pip in enumerate(die2.pips):
            for spin in range(4):
                if die1.pips == die2.pips:
                    print('Yes')
                    sys.exit(0)
                else:
                    die2.spin_die_clockwise()
            if idx in {0, 1, 2, 3}:
                die2.spin_die_clockwise()
                die2.move_die('N')
            if idx in {4}:
                die2.spin_die_clockwise()
                die2.move_die('E')
            if idx in {5}:
                die2.spin_die_clockwise()
                die2.move_die('E')
                die2.move_die('E')

        print('No')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
A,B,C,D,E,F = map(int, input().split())
u,v,w,x,y,z = map(int, input().split())
s = 0

for i in range(3):
    if A == u:
        break
    A,B,C,D,E,F = D,B,A,F,E,C #E
    if A == u:
        break
    A,B,C,D,E,F = B,F,C,D,A,E #N
else:
    print("No")
    s += 1
if s <= 0:    
    for i in range(3):
        if B == v:
            break
        A,B,C,D,E,F = A,C,E,B,D,F #R
        if B == v:
            break
    else:
        print("No")
        s += 1

if s <= 0:
    if C == w and D == x and E == y and F == z:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

Solution code:
A,B,C,D,E,F = map(int, input().split())
u,v,w,x,y,z = map(int, input().split())
s = 0
for i in range(3):
    if s > 0:
        break
    
    for i in range(3):
        if A == u:
            break
        A,B,C,D,E,F = D,B,A,F,E,C #E
        if A == u:
            break
        A,B,C,D,E,F = B,F,C,D,A,E #N
    else:
        print("No")
        s += 1
    if s <= 0:    
        for i in range(3):
            if B == v:
                break
            A,B,C,D,E,F = A,C,E,B,D,F #R
            if B == v:
                break
        else:
            print("No")
            s += 1

    if s <= 0:
        if C == w and D == x and E == y and F == z:
            print("Yes")
            s += 1
        
    A,B,C,D,E,F = D,B,A,F,E,C
    if s > 0:
        break
    
    for i in range(3):
        if A == u:
            break
        A,B,C,D,E,F = D,B,A,F,E,C #E
        if A == u:
            break
        A,B,C,D,E,F = B,F,C,D,A,E #N
    else:
        print("No")
        s += 1
    if s <= 0:    
        for i in range(3):
            if B == v:
                break
            A,B,C,D,E,F = A,C,E,B,D,F #R
            if B == v:
                break
        else:
            print("No")
            s += 1

    if s <= 0:
        if C == w and D == x and E == y and F == z:
            print("Yes")
            s += 1
    A,B,C,D,E,F = B,F,C,D,A,E #N
    
if s == 0:
    print("No")

Submission status: Wrong Answer

Solution code:
class Dice:
    """Dice class"""
    def __init__(self):                  # ?????????????????????
        self.eyeIndex = 1        #center
        self.eyeIndex_E = 3      #east
        self.eyeIndex_W = 4      #west
        self.eyeIndex_N = 5      #north
        self.eyeIndex_S = 2      #south
        self.eye = 0
        self.eye_S = 0
        self.eye_E = 0
        self.eyes = []

    def convEyesIndexToEyes(self):
        self.eye = self.eyes[self.eyeIndex]
        self.eye_S = self.eyes[self.eyeIndex_S]
        self.eye_E = self.eyes[self.eyeIndex_E]
        self.eye_N = self.eyes[self.eyeIndex_N]
        self.eye_W = self.eyes[self.eyeIndex_W]
 

    def shakeDice(self, in_command):
        pre_eyeIndex = self.eyeIndex
        if in_command == "E":
            self.eyeIndex = self.eyeIndex_W 
            self.eyeIndex_E = pre_eyeIndex 
            self.eyeIndex_W = 7 - self.eyeIndex_E
            
        elif in_command == "W":
            self.eyeIndex = self.eyeIndex_E 
            self.eyeIndex_W = pre_eyeIndex
            self.eyeIndex_E = 7 - self.eyeIndex_W
            
        elif in_command == "N":
            self.eyeIndex = self.eyeIndex_S 
            self.eyeIndex_N = pre_eyeIndex 
            self.eyeIndex_S = 7 - self.eyeIndex_N

        elif in_command == "S":
            self.eyeIndex = self.eyeIndex_N         
            self.eyeIndex_S = pre_eyeIndex 
            self.eyeIndex_N = 7 - self.eyeIndex_S 
        
        self.convEyesIndexToEyes()


    def rotateDice(self):
        #rotate clockwise
        pre_E = self.eyeIndex_E
        pre_S = self.eyeIndex_S
        pre_W = self.eyeIndex_W
        pre_N = self.eyeIndex_N
        
        self.eyeIndex_E = pre_N
        self.eyeIndex_S = pre_E
        self.eyeIndex_W = pre_S
        self.eyeIndex_N = pre_W

        self.convEyesIndexToEyes()
        
    def getEye(self):
        return self.eye
        
    def getEye_S(self):
        return self.eye_S
    
    def getEye_E(self):
        return self.eye_E

    def getEye_N(self):
        return self.eye_N

    def getEye_W(self):
        return self.eye_W

    def setEyes(self, eyes):             # setEyes()???????????? ???????????????
        eyes = "0 " + eyes
        self.eyes = list(map(int, eyes.split(" ")))
        self.convEyesIndexToEyes()
        
dice_1 = Dice()
dice_1.setEyes(input().rstrip())

dice_2 = Dice()
dice_2.setEyes(input().rstrip())


shake_direction = "E"
judge = ""

def_eye = dice_2.getEye()
shake_cnt = 0
while True:
    if dice_2.getEye() == dice_1.getEye():
        break

    dice_2.shakeDice(shake_direction)
    shake_cnt = shake_cnt + 1
    
    if shake_cnt >= 4:
        shake_direction = "N"

def_eye_S = dice_2.getEye_S()

rotate_cnt = 0
while True:
    if dice_2.getEye_S() == dice_2.getEye_S():
        break
    
    dice_2.rotateDice()
    rotate_cnt = rotate_cnt + 1
    if rotate_cnt >= 4:
        break

if dice_1.getEye() == dice_2.getEye() and dice_1.getEye_E() == dice_2.getEye_E() and \
    dice_1.getEye_S() == dice_2.getEye_S() and dice_1.getEye_W() == dice_2.getEye_W() and \
    dice_1.getEye_N() == dice_2.getEye_N():
    
    dice_1.shakeDice(shake_direction)
    dice_1.shakeDice(shake_direction)

    dice_2.shakeDice(shake_direction)
    dice_2.shakeDice(shake_direction)

    if dice_1.getEye() == dice_2.getEye():
        judge = "Yes"
    else:
        judge = "No"
        
else:
    judge = "No"
    

print(judge)

Submission status: Wrong Answer

Solution code:
class Dice:
    def __init__(self):
        self.faces=[]

    def rotate(self, direction):
        tmp = self.faces.copy()

        if direction =="N":
            self.faces[5-1] = tmp[1-1]
            self.faces[1-1] = tmp[2-1]
            self.faces[2-1] = tmp[6-1]
            self.faces[6-1] = tmp[5-1]
        if direction =="S":
            self.faces[5-1] = tmp[6-1]
            self.faces[1-1] = tmp[5-1]
            self.faces[2-1] = tmp[1-1]
            self.faces[6-1] = tmp[2-1]
        if direction =="W":
            self.faces[4-1] = tmp[1-1]
            self.faces[1-1] = tmp[3-1]
            self.faces[3-1] = tmp[6-1]
            self.faces[6-1] = tmp[4-1]
        if direction =="E":
            self.faces[3-1] = tmp[1-1]
            self.faces[1-1] = tmp[4-1]
            self.faces[4-1] = tmp[6-1]
            self.faces[6-1] = tmp[3-1]
        return 0

    def spin(self):
        self.faces[4-1], self.faces[2-1],self.faces[5-1],self.faces[3-1] =\
        self.faces[2-1], self.faces[3-1],self.faces[4-1],self.faces[5-1]

        return 0

d1 = Dice()
d2 = Dice()
d1.faces=[int(x) for x in input().split(" ")]
d2.faces=[int(x) for x in input().split(" ")]
up = d1.faces[0]

res = "No"
#set up side
for _ in range(3):
    if d2.faces[0] == up:
        break
    d2.rotate("N")

for _ in range(3):
    if d2.faces[0] == up:
        break
    d2.rotate("W")

#set front side
for _ in range(3):
    if d1.faces == d2.faces:
        res = "Yes"
        break
    d2.spin()

print(res)

Submission status: Wrong Answer

Solution code:
class Dice:
    def __init__(self):
        self.faces=[]

    def rotate(self, direction):
        tmp = self.faces.copy()

        if direction =="N":
            self.faces[5-1] = tmp[1-1]
            self.faces[1-1] = tmp[2-1]
            self.faces[2-1] = tmp[6-1]
            self.faces[6-1] = tmp[5-1]
        if direction =="S":
            self.faces[5-1] = tmp[6-1]
            self.faces[1-1] = tmp[5-1]
            self.faces[2-1] = tmp[1-1]
            self.faces[6-1] = tmp[2-1]
        if direction =="W":
            self.faces[4-1] = tmp[1-1]
            self.faces[1-1] = tmp[3-1]
            self.faces[3-1] = tmp[6-1]
            self.faces[6-1] = tmp[4-1]
        if direction =="E":
            self.faces[3-1] = tmp[1-1]
            self.faces[1-1] = tmp[4-1]
            self.faces[4-1] = tmp[6-1]
            self.faces[6-1] = tmp[3-1]
        return 0

    def spin(self):
        self.faces[4-1], self.faces[2-1],self.faces[5-1],self.faces[3-1] =\
        self.faces[2-1], self.faces[3-1],self.faces[4-1],self.faces[5-1]

        return 0

d1 = Dice()
d2 = Dice()
d1.faces=[int(x) for x in input().split(" ")]
d2.faces=[int(x) for x in input().split(" ")]
up,front = d1.faces[0], d1.faces[1]

res = "No"
#set up side
for _ in range(3):
    if d2.faces[0] == up:
        break
    d2.rotate("N")

for _ in range(3):
    for __ in range(3):
        #print("d1: {}".format(d1.faces))
        #print("d2: {}".format(d2.faces))

        if d1.faces == d2.faces:
            res = "Yes"
            break
        d2.spin()
    d2.rotate("N")


print(res)

Submission status: Wrong Answer

Solution code:
class Dice:
    def __init__(self):
        self.faces=[]

    def rotate(self, direction):
        tmp = self.faces.copy()

        if direction =="N":
            self.faces[5-1] = tmp[1-1]
            self.faces[1-1] = tmp[2-1]
            self.faces[2-1] = tmp[6-1]
            self.faces[6-1] = tmp[5-1]
        if direction =="S":
            self.faces[5-1] = tmp[6-1]
            self.faces[1-1] = tmp[5-1]
            self.faces[2-1] = tmp[1-1]
            self.faces[6-1] = tmp[2-1]
        if direction =="W":
            self.faces[4-1] = tmp[1-1]
            self.faces[1-1] = tmp[3-1]
            self.faces[3-1] = tmp[6-1]
            self.faces[6-1] = tmp[4-1]
        if direction =="E":
            self.faces[3-1] = tmp[1-1]
            self.faces[1-1] = tmp[4-1]
            self.faces[4-1] = tmp[6-1]
            self.faces[6-1] = tmp[3-1]
        return 0

    def spin(self):
        self.faces[4-1], self.faces[2-1],self.faces[5-1],self.faces[3-1] =\
        self.faces[2-1], self.faces[3-1],self.faces[4-1],self.faces[5-1]

        return 0

d1 = Dice()
d2 = Dice()
d1.faces=[int(x) for x in input().split(" ")]
d2.faces=[int(x) for x in input().split(" ")]
up,front = d1.faces[0], d1.faces[1]

res = "No"
#set up side
for _ in range(3):
    for _ in range(4):
        for ___ in range(4):
            #print("d1: {}".format(d1.faces))
            #print("d2: {}".format(d2.faces))
            if d1.faces != d2.faces:
                res = "Yes"
                break
            d2.spin()
        d2.rotate("W")
    d2.rotate("N")

print(res)

Submission status: Wrong Answer

Solution code:
import sys
answer = [i for i in input().split()]
inp = [i for i in input().split()]
if answer == inp:
    print("Yes")
    sys.exit()
for i in range(1,12):
    if i == 4 or 8:
        s = "W"
    else:
        s = "N"
    if s == "N":
        a = []
        a.append(inp[1])
        a.append(inp[5])
        a.append(inp[2])
        a.append(inp[3])
        a.append(inp[0])
        a.append(inp[4])
        inp = a
        if answer == inp:
            print("Yes")
            break
    elif s == "W":
        a = []
        a.append(inp[2])
        a.append(inp[1])
        a.append(inp[5])
        a.append(inp[0])
        a.append(inp[4])
        a.append(inp[3])
        inp = a
        if answer == inp:
            print("Yes")
            break
    if i == 11:
        print ("No")

Submission status: Wrong Answer

Solution code:
import sys
answer = [i for i in input().split()]
inp = [i for i in input().split()]
if answer == inp:
    print("Yes")
    sys.exit()
for i in range(1,12):
    s = "N"
    if i == 4 or i == 8:
        s = "W"
    if s == "N":
        a = []
        a.append(inp[1])
        a.append(inp[5])
        a.append(inp[2])
        a.append(inp[3])
        a.append(inp[0])
        a.append(inp[4])
        inp = a
        if answer == inp:
            print("Yes")
            break
    elif s == "W":
        a = []
        a.append(inp[2])
        a.append(inp[1])
        a.append(inp[5])
        a.append(inp[0])
        a.append(inp[4])
        a.append(inp[3])
        inp = a
        if answer == inp:
            print("Yes")
            break
    if i == 11:
        print ("No")

Submission status: Wrong Answer

Solution code:
import sys
answer = [i for i in input().split()]
inp = [i for i in input().split()]
if answer == inp:
    print("Yes")
    sys.exit()
for i in range(1,15):
    if i == 5 or i == 10:
        s = "W"
    else:
        s = "N"
    if s == "N":
        a = []
        a.append(inp[1])
        a.append(inp[5])
        a.append(inp[2])
        a.append(inp[3])
        a.append(inp[0])
        a.append(inp[4])
        inp = a
        if answer == inp:
            print("Yes")
            break
    elif s == "W":
        a = []
        a.append(inp[2])
        a.append(inp[1])
        a.append(inp[5])
        a.append(inp[0])
        a.append(inp[4])
        a.append(inp[3])
        inp = a
        if answer == inp:
            print("Yes")
            break
    if i == 11:
        print ("No")