Language: C++

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

// http://www.prefield.com/algorithm/misc/dice.html
enum FACE { TOP, BOTTOM, FRONT, BACK, LEFT, RIGHT };
class dice {
public:
	dice(int top,int front,int right,int left,int back,int bottom) {
		id[TOP] = top; id[FRONT] = front; id[RIGHT] = right;
		id[LEFT] = left; id[BACK] = back; id[BOTTOM] = bottom;
	}
	int& operator[] (FACE f) { return id[f]; }
	const int& operator[] (FACE f) const { return id[f]; }
	bool operator==(const dice &b) const {
		const dice &a = *this;
		return a[TOP] == b[TOP] && a[BOTTOM] == b[BOTTOM] &&
			a[FRONT] == b[FRONT] && a[BACK] == b[BACK] &&
			 a[LEFT] == b[LEFT] && a[RIGHT] == b[RIGHT];
	}
	void roll_north() { roll(TOP, FRONT, BOTTOM, BACK); }
	void roll_south() { roll(TOP, BACK, BOTTOM, FRONT); }
	void roll_east() { roll(TOP, LEFT, BOTTOM, RIGHT); }
	void roll_west() { roll(TOP, RIGHT, BOTTOM, LEFT); }
	void roll_right() { roll(FRONT, LEFT, BACK, RIGHT); }
	void roll_left() { roll(FRONT, RIGHT, BACK, LEFT); }
	bool equivalent_to(const dice& di){
		for (int k = 0; k < 6; (k&1?roll_east():roll_north()),++k)
			for (int i = 0; i < 4; roll_right(), ++i)
				if (*this == di) return true;
		return false;
	}
private:
	void roll(FACE a, FACE b, FACE c, FACE d){
		int tmp = id[a];
		id[a] = id[b]; id[b] = id[c];
		id[c] = id[d]; id[d] = tmp;
	}
	int id[6];
};

int main(){
	int d[6];
	for(int i=0;i<6;i++)cin>>d[i];
	dice di(d[0],d[1],d[2],d[3],d[4],d[5]);
	for(int i=0;i<6;i++)cin>>d[i];
	dice di2(d[0],d[1],d[2],d[3],d[4],d[5]);
	cout<<(di.equivalent_to(di2) ? "Yes" : "No")<<endl;
}

int main(){
	int n,d[6];
	cin>>n;
	vector<dice>v(n);
	for(int j=0;j<n;j++){
		for(int i=0;i<6;i++)cin>>d[i];
		v[j]=dice(d[0],d[1],d[2],d[3],d[4],d[5]);
	}
	for(int j=0;j<n-1;j++)for(int i=j+1;i<n;i++)if(v[j].equivalent_to(v[i])){
		cout<<"No"<<endl;
		return 0;
	}
	cout<<"Yes"<<endl;
}

Compiler output:
a.cc:51:5: error: redefinition of 'int main()'
   51 | int main(){
      |     ^~~~
a.cc:42:5: note: 'int main()' previously defined here
   42 | int main(){
      |     ^~~~
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:54:17:   required from here
   54 |         vector<dice>v(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:9:9: note: candidate: 'dice::dice(int, int, int, int, int, int)'
    9 |         dice(int top,int front,int right,int left,int back,int bottom) {
      |         ^~~~
a.cc:9:9: note:   candidate expects 6 arguments, 0 provided
a.cc:7:7: note: candidate: 'constexpr dice::dice(const dice&)'
    7 | class dice {
      |       ^~~~
a.cc:7:7: note:   candidate expects 1 argument, 0 provided
a.cc:7:7: note: candidate: 'constexpr dice::dice(dice&&)'
a.cc:7:7: note:   candidate expects 1 argument, 0 provided