Language: C++

#include <iostream>
using namespace std;

class Dice{
public:
    long r[6];
    void setroll(long D[]);
    void rotate(long s[]);
    void spin(char c);
};

void Dice::setroll(long D[]){
    for (long i = 0; i < 6; i++) this.r[i] = D[i];
}

void Dice::rotate(long s[]){
    swap(this.r[s[0]], this.r[s[1]]);
    swap(this.r[s[1]], this.r[s[2]]);
    swap(this.r[s[2]], this.r[s[3]]);
}

void Dice::spin(char c){
    if (c == 'W') Dice::rotate(n, 0, 2, 5, 3);
    else Dice::rotate(n, 0, 1, 5, 4);
}

long D[100][6];

void rotate(long n, long a, long b, long c, long d){
    swap(D[n][a], D[n][b]); swap(D[n][b], D[n][c]); swap(D[n][c], D[n][d]);
}

void spin(long n, char c){
    if (c=='W') rotate(n, 0, 2, 5, 3);
    else rotate(n, 0, 1, 5, 4);
}

int main() {
    int ans = 0;
    int n;
    cin >> n;
    long d[6] = {};
    Dice D[100];
    for (int i = 0; i < n ; i++) {
        for (int j = 0; j < 6; j++) cin >> d[j];
        D[i].setroll(d);
    }
    for (int i = 0; i < n ; i++) {
        for (int j = i + 1 ; j <= n ; j++) {
            char SWS[8]={"NNNWNNN"};
            for (int k = 0; k < 8; k++){
                if (D[i].r[1] == D[j].r[1]) break;
                D[j].spin(SWS[k]);
            }
            for (int k = 0; k < 4; k++){
                if (D[i].r[0] == D[j].r[0]){
                    if (D[i].r[1] == D[j].r[1] && D[i].r[2] == D[j].r[2] && D[i].r[3]==D[j].r[3] && D[i].r[4] == D[j].r[4] && D[i].r[5] == D[j].r[5])
                        ans++;
                }
                D[j].spin('W');
            }
        }
    }

    if (ans == 0) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Compiler output:
a.cc: In member function 'void Dice::setroll(long int*)':
a.cc:13:39: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   13 |     for (long i = 0; i < 6; i++) this.r[i] = D[i];
      |                                       ^
a.cc: In member function 'void Dice::rotate(long int*)':
a.cc:17:15: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   17 |     swap(this.r[s[0]], this.r[s[1]]);
      |               ^
a.cc:17:29: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   17 |     swap(this.r[s[0]], this.r[s[1]]);
      |                             ^
a.cc:18:15: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   18 |     swap(this.r[s[1]], this.r[s[2]]);
      |               ^
a.cc:18:29: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   18 |     swap(this.r[s[1]], this.r[s[2]]);
      |                             ^
a.cc:19:15: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   19 |     swap(this.r[s[2]], this.r[s[3]]);
      |               ^
a.cc:19:29: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   19 |     swap(this.r[s[2]], this.r[s[3]]);
      |                             ^
a.cc: In member function 'void Dice::spin(char)':
a.cc:23:32: error: 'n' was not declared in this scope
   23 |     if (c == 'W') Dice::rotate(n, 0, 2, 5, 3);
      |                                ^
a.cc:24:23: error: 'n' was not declared in this scope
   24 |     else Dice::rotate(n, 0, 1, 5, 4);
      |                       ^