Language: C++

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

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

Dice::Dice(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 constructor 'Dice::Dice(long int*)':
a.cc:14:39: 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]);
      |          ^
a.cc: In function 'int main()':
a.cc:46:14: error: '__gnu_cxx::__alloc_traits<std::allocator<Dice>, Dice>::value_type' {aka 'class Dice'} has no member named 'setroll'
   46 |         D[i].setroll(d);
      |              ^~~~~~~
In file included from /usr/include/c++/14/bits/alloc_traits.h:33,
                 from /usr/include/c++/14/ext/alloc_traits.h:34,
                 from /usr/include/c++/14/bits/basic_string.h:39,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_construct.h: In instantiation of 'void std::_Construct(_Tp*, _Args&& ...) [with _Tp = Dice; _Args = {}]':
/usr/include/c++/14/bits/stl_uninitialized.h:643:18:   required from 'static _ForwardIterator std::__uninitialized_default_n_1<_TrivialValueType>::__uninit_default_n(_ForwardIterator, _Size) [with _ForwardIterator = Dice*; _Size = long unsigned int; bool _TrivialValueType = false]'
  643 |                 std::_Construct(std::__addressof(*__cur));
      |                 ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_uninitialized.h:712:20:   required from '_ForwardIterator std::__uninitialized_default_n(_ForwardIterator, _Size) [with _ForwardIterator = Dice*; _Size = long unsigned int]'
  710 |       return __uninitialized_default_n_1<__is_trivial(_ValueType)
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  711 |                                          && __can_fill>::
      |                                          ~~~~~~~~~~~~~~~~
  712 |         __uninit_default_n(__first, __n);
      |         ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_uninitialized.h:779:44:   required from '_ForwardIterator std::__uninitialized_default_n_a(_ForwardIterator, _Size, allocator<_Tp>&) [with _ForwardIterator = Dice*; _Size = long unsigned int; _Tp = Dice]'
  779 |     { return std::__uninitialized_default_n(__first, __n); }
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1720:36:   required from 'void std::vector<_Tp, _Alloc>::_M_default_initialize(size_type) [with _Tp = Dice; _Alloc = std::allocator<Dice>; size_type = long unsigned int]'
 1720 |           std::__uninitialized_default_n_a(this->_M_impl._M_start, __n,
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 1721 |                                            _M_get_Tp_allocator());
      |                                            ~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:558:9:   required from 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = Dice; _Alloc = std::allocator<Dice>; size_type = long unsigned int; allocator_type = std::allocator<Dice>]'
  558 |       { _M_default_initialize(__n); }
      |         ^~~~~~~~~~~~~~~~~~~~~
a.cc:43:21:   required from here
   43 |     vector<Dice> D(n);
      |                     ^
/usr/include/c++/14/bits/stl_construct.h:119:7: error: no matching function for call to 'Dice::Dice()'
  119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:13:1: note: candidate: 'Dice::Dice(long int*)'
   13 | Dice::Dice(long D[]){
      | ^~~~
a.cc:13:1: note:   candidate expects 1 argument, 0 provided
a.cc:5:7: note: candidate: 'constexpr Dice::Dice(const Dice&)'
    5 | class Dice{
      |       ^~~~
a.cc:5:7: note:   candidate expects 1 argument, 0 provided
a.cc:5:7: note: candidate: 'constexpr Dice::Dice(Dice&&)'
a.cc:5:7: note:   candidate expects 1 argument, 0 provided