Language: C++

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#define rep(i,j,k) for(int i=(j);i<(k);i++)
using namespace std;
int data[3][100005];
int rdata[100005];
int _abs(int a)
{
    return a>0?a:-a;
}
int main()
{
    int n;
    scanf("%d",&n);
    rep(j,0,3)rep(i,1,n+1)scanf("%d",&data[j][i]);
    rep(i,1,n+1)
    {
        if(data[1][i]%3!=2)
        {
            puts("No");
            return 0;
        }
        rdata[i]=(data[1][i]+1)/3;
    }
    rep(i,1,n+1)if((data[0][i]+2)/3!=rdata[i]||(data[2][i]+2)/3!=rdata[i])
    {
        puts("No");
        return 0;
    }
    rep(i,1,n+1)if(rdata[i]%2!=i%2)
    {
        puts("No");
        return 0;
    }
    ll cnt[2]={0,0},nxd[2]={0,0};
    rep(i,1,n+1)if(data[0][i]%3==0)cnt[i%2]++;
    rep(i,1,n+1)nxd[i%2]+=_abs(i-rdata[i]);
    nxd[0]/=4;nxd[1]/=4;
    if(cnt[0]%2==nxd[1]%2&&cnt[1]%2==nxd[0]%2)puts("Yes");
    else puts("No");
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:19:39: error: reference to 'data' is ambiguous
   19 |     rep(j,0,3)rep(i,1,n+1)scanf("%d",&data[j][i]);
      |                                       ^~~~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:9:5: note:                 'int data [3][100005]'
    9 | int data[3][100005];
      |     ^~~~
a.cc:22:12: error: reference to 'data' is ambiguous
   22 |         if(data[1][i]%3!=2)
      |            ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:9:5: note:                 'int data [3][100005]'
    9 | int data[3][100005];
      |     ^~~~
a.cc:27:19: error: reference to 'data' is ambiguous
   27 |         rdata[i]=(data[1][i]+1)/3;
      |                   ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:9:5: note:                 'int data [3][100005]'
    9 | int data[3][100005];
      |     ^~~~
a.cc:29:21: error: reference to 'data' is ambiguous
   29 |     rep(i,1,n+1)if((data[0][i]+2)/3!=rdata[i]||(data[2][i]+2)/3!=rdata[i])
      |                     ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:9:5: note:                 'int data [3][100005]'
    9 | int data[3][100005];
      |     ^~~~
a.cc:29:49: error: reference to 'data' is ambiguous
   29 |     rep(i,1,n+1)if((data[0][i]+2)/3!=rdata[i]||(data[2][i]+2)/3!=rdata[i])
      |                                                 ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:9:5: note:                 'int data [3][100005]'
    9 | int data[3][100005];
      |     ^~~~
a.cc:39:5: error: 'll' was not declared in this scope
   39 |     ll cnt[2]={0,0},nxd[2]={0,0};
      |     ^~
a.cc:39:20: error: expected primary-expression before ',' token
   39 |     ll cnt[2]={0,0},nxd[2]={0,0};
      |                    ^
a.cc:39:21: error: 'nxd' was not declared in this scope
   39 |     ll cnt[2]={0,0},nxd[2]={0,0};
      |                     ^~~
a.cc:40:20: error: reference to 'data' is ambiguous
   40 |     rep(i,1,n+1)if(data[0][i]%3==0)cnt[i%2]++;
      |                    ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:9:5: note:                 'int data [3][100005]'
    9 | int data[3][100005];
      |     ^~~~
a.cc:40:36: error: 'cnt' was not declared in this scope; did you mean 'int'?
   40 |     rep(i,1,n+1)if(data[0][i]%3==0)cnt[i%2]++;
      |                                    ^~~
      |                                    int
a.cc:43:8: error: 'cnt' was not declared in this scope; did you mean 'int'?
   43 |     if(cnt[0]%2==nxd[1]%2&&cnt[1]%2==nxd[0]%2)puts("Yes");
      |        ^~~
      |        int