Language: C++

#include <iostream>
#include <iomanip>
#include <string>

namespace Simulation
{

class Dice
{
public:
    struct DiceStruct{
        int top;
        int front;
        int right;
        int left;
        int back;
        int botom;

        //?????¢????????§???
        int current;
    };

    void set(int a, int b, int c, int d, int e, int f);
    void printTop();
    void printFront();
    void printRight();
    void printLeft();
    void printBack();
    void printBotom();

    void TurnNorth();
    void TurnEast();
    void TurnSouth();
    void TurnWest();


    DiceStruct m_dice{0,0,0,0,0,0,0};
}; //namespace Dice


std::unique_ptr<Dice> dice1(new Dice());
std::unique_ptr<Dice> dice2(new Dice());

} //namespace Simulation 

int main()
{
    using namespace Simulation;

    bool judge = true;
    int a, b, c, d, e, f;
    std::cin >> a >> b >> c >> d >> e >> f;
    dice1->set(a, b, c, d, e, f);

    int g, h, i, j, k, l;
    std::cin >> g >> h >> i >> j >> k >> l;
    dice2->set(g, h, i, j, k, l);

    int count = 1;

    for (int i = 0; i < 7; i++) {
        if (dice1->m_dice.front != dice2->m_dice.front && count < 5) {
            dice2->TurnNorth();
            count++;
        } else if (dice1->m_dice.front != dice2->m_dice.front && count == 5) {
            dice2->TurnEast();
            dice2->TurnNorth();
            count++;
        } else if (dice1->m_dice.front != dice2->m_dice.front && count == 6) {
            dice2->TurnNorth();
            dice2->TurnNorth();
            count = 1;
            break;
        } else if (dice1->m_dice.front == dice2->m_dice.front) {
            count = 1;
            break;
        } else {
            judge = false;
        }
    }

    if (judge == true) {
        for (int i = 0; i < 5; i++) {
            if (dice1->m_dice.top != dice2->m_dice.top && count < 4) {
                dice2->TurnEast();
                count++;
            } else if (dice1->m_dice.top == dice2->m_dice.top) {
                count = 1;
                break;
            } else {
                judge = false;
            }
        }
    }

    if (judge == true) {
        if (dice1->m_dice.right != dice2->m_dice.right) {
            judge = false;
        } else if (dice1->m_dice.left != dice2->m_dice.left) {
            judge = false;
        } else if (dice1->m_dice.back != dice2->m_dice.back) {
            judge = false;
        } else if (dice1->m_dice.botom != dice2->m_dice.botom) {
            judge = false;
        }
    }

    if (judge == true) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }


    return 0;
}

namespace Simulation
{

void Dice::set(int a, int b, int c, int d, int e, int f)
{
    m_dice.top = a;
    m_dice.front = b;
    m_dice.right = c;
    m_dice.left = d;
    m_dice.back = e;
    m_dice.botom = f;

}

void Dice::printTop()
{
    std::cout << m_dice.top << std::endl;
}

void Dice::printFront()
{
    std::cout << m_dice.front << std::endl;
}

void Dice::printRight()
{
    std::cout << m_dice.right << std::endl;
}

void Dice::printLeft()
{
    std::cout << m_dice.left << std::endl;
}

void Dice::printBack()
{
    std::cout << m_dice.back << std::endl;
}

void Dice::printBotom()
{
    std::cout << m_dice.botom << std::endl;
}

void Dice::TurnNorth()
{
    m_dice.current = m_dice.top;
    m_dice.top = m_dice.front;
    m_dice.front = m_dice.botom;
    m_dice.botom = m_dice.back;
    m_dice.back = m_dice.current;
    m_dice.current = 0;
}

void Dice::TurnEast()
{
    m_dice.current = m_dice.top;
    m_dice.top = m_dice.left;
    m_dice.left = m_dice.botom;
    m_dice.botom = m_dice.right;
    m_dice.right = m_dice.current;
    m_dice.current = 0;
}

void Dice::TurnSouth()
{
    m_dice.current = m_dice.top;
    m_dice.top = m_dice.back;
    m_dice.back = m_dice.botom;
    m_dice.botom = m_dice.front;
    m_dice.front = m_dice.current;
    m_dice.current = 0;
}

void Dice::TurnWest()
{
    m_dice.current = m_dice.top;
    m_dice.top = m_dice.right;
    m_dice.right = m_dice.botom;
    m_dice.botom = m_dice.left;
    m_dice.left = m_dice.current;
    m_dice.current = 0;
}

}//namespace Simulation

Compiler output:
a.cc:41:6: error: 'unique_ptr' in namespace 'std' does not name a template type
   41 | std::unique_ptr<Dice> dice1(new Dice());
      |      ^~~~~~~~~~
a.cc:3:1: note: 'std::unique_ptr' is defined in header '<memory>'; this is probably fixable by adding '#include <memory>'
    2 | #include <iomanip>
  +++ |+#include <memory>
    3 | #include <string>
a.cc:42:6: error: 'unique_ptr' in namespace 'std' does not name a template type
   42 | std::unique_ptr<Dice> dice2(new Dice());
      |      ^~~~~~~~~~
a.cc:42:1: note: 'std::unique_ptr' is defined in header '<memory>'; this is probably fixable by adding '#include <memory>'
   42 | std::unique_ptr<Dice> dice2(new Dice());
      | ^~~
a.cc: In function 'int main()':
a.cc:53:5: error: 'dice1' was not declared in this scope
   53 |     dice1->set(a, b, c, d, e, f);
      |     ^~~~~
a.cc:57:5: error: 'dice2' was not declared in this scope
   57 |     dice2->set(g, h, i, j, k, l);
      |     ^~~~~