Language: C++

#include <iostream>
#include <vector>
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);
}


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] = {};
    vector<Dice> D(n);
    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:14:40: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   14 |     for (long i = 0; i < 6; i++) (this.r)[i] = D[i];
      |                                        ^
a.cc: In member function 'void Dice::rotate(long int*)':
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[0]], this.r[s[1]]);
      |               ^
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[0]], this.r[s[1]]);
      |                             ^
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[1]], this.r[s[2]]);
      |               ^
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[1]], this.r[s[2]]);
      |                             ^
a.cc:20:15: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   20 |     swap(this.r[s[2]], this.r[s[3]]);
      |               ^
a.cc:20:29: error: request for member 'r' in '(Dice*)this', which is of pointer type 'Dice*' (maybe you meant to use '->' ?)
   20 |     swap(this.r[s[2]], this.r[s[3]]);
      |                             ^
a.cc: In member function 'void Dice::spin(char)':
a.cc:24:32: error: 'n' was not declared in this scope
   24 |     if (c == 'W') Dice::rotate(n, 0, 2, 5, 3);
      |                                ^
a.cc:25:23: error: 'n' was not declared in this scope
   25 |     else Dice::rotate(n, 0, 1, 5, 4);
      |                       ^
a.cc: In function 'void rotate(long int, long int, long int, long int, long int)':
a.cc:30:10: error: 'D' was not declared in this scope
   30 |     swap(D[n][a], D[n][b]); swap(D[n][b], D[n][c]); swap(D[n][c], D[n][d]);
      |          ^