Language: C++

#include <iostream>
using namespace std;

void EAST(int dice[100][6], int k) {
    int copy = dice[k][0];
    dice[k][0] = dice[k][3];
    dice[k][3] = dice[k][5];
    dice[k][5] = dice[k][2];
    dice[k][2] = copy;
}

void NORTH(int dice[100][6], int k) {
    int copy = dice[k][0];
    dice[k][0] = dice[k][1];
    dice[k][1] = dice[k][5];
    dice[k][5] = dice[k][4];
    dice[k][4] = copy;
}

void ROTATE(int dice[100][6], int index, int k) {
    switch(index) {
        case 1 : break;
        case 2 : {
            int copy = dice[k][1];
            dice[k][1] = dice[k][2];
            dice[k][2] = dice[k][4];
            dice[k][4] = dice[k][3];
            dice[k][3] = copy;
            break;
        }
        case 4 : {
            int copy = dice[k][1];
            dice[k][1] = dice[k][4];
            dice[k][4] = copy;
            copy = dice[k][2];
            dice[k][2] = dice[k][3];
            dice[k][3] = copy;
            break;
        }
        case 3 : {
            int copy = dice[k][1];
            dice[k][1] = dice[k][3];
            dice[k][3] = dice[k][4];
            dice[k][4] = dice[k][2];
            dice[k][2] = copy;
            break;
        }
    }
}

int main(void) {
    int dice[100][6];
    int dice_sub[6];
    int n;
    int CHECK = 0;
    for(int i = 0; i < n; ++i) {
        for(int j = 0; j < 6; ++j) {
            cin >> dice1[i][j];
        }
    }
    for(int i = 0; i < 6; ++i) {
        cin >> dice2[i];
        dice2sub[i] = dice2[i];
    }
    for(int k = 1; k < n; ++k) {
        int DICE = 0;
        for(int l = 0; l < 6; ++l) {
            dice_sub[l] = dice[k][l];
        }
    
        for(int i = 0; i < 4; ++i) {
            EAST(dice, 0);
            int check = 0;
            for(int j = 0; j < 6; ++j) {
                dice[k][j] = dice_sub[j];
            }
            int start = dice[k][0];
            while(dice[k][0] != dice[0][0]) {
                EAST(dice, k);
                if(dice[k][0] == dice[0][0])   break;
                NORTH(dice, k);
                if(dice[k][0] == start) {
                    break;
                }
            }
            int index = 1;
            while(true) {
                if(dice[k][index] == dice[0][1])   break;
                ++index;
                if(index == 5) {
                    break;
                }
            }
            ROTATE(dice, index, k);
            for(int i = 0; i < 6; ++i) {
                if(dice[0][i] == dice[k][i]) {
                    ++check;
                }
            }
            if(check == 6) {
                DICE++;
            }
        }
        for(int i = 0; i < 4; ++i) {
            NORTH(dice[0]);
            int check = 0;
            for(int j = 0; j < 6; ++j) {
                dice[k][j] = dice_sub[j];
            }
            int start = dice[k][0];
            while(dice[k][0] != dice[0][0]) {
                EAST(dice, k);
                if(dice[k][0] == dice[0][0])   break;
                NORTH(dice, k);
                if(dice[k][0] == start) {
                    break;
                }
            }
        
            int index = 1;
            while(true) {
                if(dice[k][index] == dice[0][1])   break;
                ++index;
                if(index == 5) {
                    break;
                }
            }
            ROTATE(dice, index, k);
            for(int i = 0; i < 6; ++i) {
                if(dice[0][i] == dice[k][i]) {
                    ++check;
                }
            }
            if(check == 6) {
                DICE++;
            }
        }
        if(DICE == 0) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:58:20: error: 'dice1' was not declared in this scope; did you mean 'dice'?
   58 |             cin >> dice1[i][j];
      |                    ^~~~~
      |                    dice
a.cc:62:16: error: 'dice2' was not declared in this scope; did you mean 'dice'?
   62 |         cin >> dice2[i];
      |                ^~~~~
      |                dice
a.cc:63:9: error: 'dice2sub' was not declared in this scope; did you mean 'dice_sub'?
   63 |         dice2sub[i] = dice2[i];
      |         ^~~~~~~~
      |         dice_sub
a.cc:105:25: error: cannot convert 'int*' to 'int (*)[6]'
  105 |             NORTH(dice[0]);
      |                   ~~~~~~^
      |                         |
      |                         int*
a.cc:12:16: note:   initializing argument 1 of 'void NORTH(int (*)[6], int)'
   12 | void NORTH(int dice[100][6], int k) {
      |            ~~~~^~~~~~~~~~~~