Language: C++

#include <bits/stdc++.h>
using namespace std ;

#define pb(n) push_back(n)
#define fi first
#define se second
#define X real()
#define Y imag()
#define value(x,y,w,h) (x >= 0 && x < w && y >= 0 && y < h)
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(Type,Arg,W,H,Init) (vector<vector<(Type)>> Arg ((W),(vector<(Type)>(H,Init))))

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

typedef long long ll ;
typedef deque<int> di ;
typedef deque<ll> dl ;
typedef map<string,int> dict;
typedef complex<double> comd;
typedef pair<int,int> pii;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

double CalcDist(comd p1, comd p2){
  return sqrt(pow(p1.X - p2.X,2.0) + pow(p1.Y -p2.Y,2.0));
}

  template <typename T>
void out(deque < T > d)
{
  for(size_t i = 0; i < d.size(); i++)
  {
    debug(d[i]);
  }
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}
int N,K,a,b;
int p[110];
// int dp[45][100];
// vary(int,dp,45,100,0);
int ans = 0;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> N >> K;
  rep(i,K){
    cin >> a >> b;
    p[a] = b ;
  }
  vector<vector<vector<int>>> dp(N+1,vector<vector<int>>(4,vector<int>(4)));
// 1:11 2:12 3:13 4:21 5:22 6:23 7:31 8:32 9:33
  rep(i,3){
    if(p[1] == i){
      dp[1][c][0] = 1;
    }
  }
  REP(i,2,N+1){
    REP(c,1,4){
      if(p[i] == c || p[i] == 0){//c????????\???????£??????????
        REP(pc1,1,4){//?????\
          REP(pc2,1,4){//????????\
            if(!(c == pc1 && pc1 == pc2)){//?????\??£?¶???§??????
              dp[i][c][pc1] += dp[i-1][pc1][pc2];
              dp[i][c][pc1] %= 10000;
            }
          }
        }
      }
    }
  }
  ll ans = 0;
  REP(i,1,4){
    REP(j,1,4){
      ans += dp[N][i][j];
      ans %= 10000;
    }
  }
  cout << ans % 10000 << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:75:13: error: 'c' was not declared in this scope
   75 |       dp[1][c][0] = 1;
      |             ^
a.cc:84:45: error: 'pc2' was not declared in this scope; did you mean 'pc1'?
   84 |               dp[i][c][pc1] += dp[i-1][pc1][pc2];
      |                                             ^~~
      |                                             pc1
a.cc: At global scope:
a.cc:91:3: error: expected declaration before '}' token
   91 |   }
      |   ^
a.cc:92:6: error: conflicting declaration 'll ans'
   92 |   ll ans = 0;
      |      ^~~
a.cc:62:5: note: previous declaration as 'int ans'
   62 | int ans = 0;
      |     ^~~
a.cc:20:20: error: expected unqualified-id before 'for'
   20 | #define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
      |                    ^~~
a.cc:93:3: note: in expansion of macro 'REP'
   93 |   REP(i,1,4){
      |   ^~~
a.cc:93:7: error: 'i' does not name a type; did you mean 'di'?
   93 |   REP(i,1,4){
      |       ^
a.cc:20:36: note: in definition of macro 'REP'
   20 | #define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
      |                                    ^
a.cc:20:49: error: expected unqualified-id before '++' token
   20 | #define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
      |                                                 ^~
a.cc:93:3: note: in expansion of macro 'REP'
   93 |   REP(i,1,4){
      |   ^~~
a.cc:99:3: error: 'cout' does not name a type; did you mean 'fcout'?
   99 |   cout << ans % 10000 << endl;
      |   ^~~~
      |   fcout
a.cc:100:3: error: expected unqualified-id before 'return'
  100 |   return 0;
      |   ^~~~~~
a.cc:101:1: error: expected declaration before '}' token
  101 | }
      | ^