Language: C++

#include <iostream>
#include <vector>
using namespace std;

class Dice{
public:
    long r[6];
    Dice(){};
    void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
    void spin(char c){
        if (c == 'W') roll(0, 2, 5, 3);
        else roll(0, 1, 5, 4);
    }
};

int main() {
    bool ans = 0;
    int n;
    cin >> n;
    vector<Dice> D(n);
    for (int i = 0; i < n ; i++) {
        for (int j = 0; j < 6; j++) cin >> D[i].r[j];
    }
    for (int i = 0; i < n - 1; 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]){
                        cout << "No" << endl; return 0;
                    }
                }
                D[j].spin('W');
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Compiler output:
a.cc:9:45: error: expected ';' at end of member declaration
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                             ^
      |                                              ;
a.cc:9:52: error: 'r' is not a type
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                    ^
a.cc:9:54: error: 'a' was not declared in this scope
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                      ^
a.cc:9:58: error: 'r' is not a type
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                          ^
a.cc:9:60: error: 'b' was not declared in this scope
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                            ^
a.cc:9:47: error: ISO C++ forbids declaration of 'swap' with no type [-fpermissive]
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                               ^~~~
a.cc:9:69: error: 'r' is not a type
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                     ^
a.cc:9:71: error: 'b' was not declared in this scope
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                       ^
a.cc:9:75: error: 'r' is not a type
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                           ^
a.cc:9:77: error: 'c' was not declared in this scope
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                             ^
a.cc:9:64: error: ISO C++ forbids declaration of 'swap' with no type [-fpermissive]
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                ^~~~
a.cc:9:64: error: 'int Dice::swap(...)' cannot be overloaded with 'int Dice::swap(...)'
a.cc:9:47: note: previous declaration 'int Dice::swap(...)'
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                               ^~~~
a.cc:9:86: error: 'r' is not a type
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                                      ^
a.cc:9:88: error: 'c' was not declared in this scope
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                                        ^
a.cc:9:92: error: 'r' is not a type
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                                            ^
a.cc:9:94: error: 'd' was not declared in this scope
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                                              ^
a.cc:9:81: error: ISO C++ forbids declaration of 'swap' with no type [-fpermissive]
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                                                                 ^~~~
a.cc:9:81: error: 'int Dice::swap(...)' cannot be overloaded with 'int Dice::swap(...)'
a.cc:9:47: note: previous declaration 'int Dice::swap(...)'
    9 |     void roll(long a, long b, long c, long d) swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);
      |                                               ^~~~