Language: C++

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

const long long modi = 998244353;
const int size = 3001;
long long dp2[size][size];
long long dp[size][size][3];
int main(){
	long long a,b,c,d;
	cin >> a >> b >> c >> d;

	long long rows = (c-a); // for each r op i can palong long one of the nodes black
	long long cols = (d-b); // for eeach c op i can palong long one of hte nodes black

	// long long  dp[c+1][d+1][3];
	// memset(dp,1LL,sizeof(dp));
	for(long long i =1;i<=a;i++){
		for(long long j =1;j<=b;j++){
			dp[i][j][0] = 1LL;
			dp[i][j][1] = 1LL;
			dp[i][j][2] = 1LL;
		}
	}
	
	for(long long i =a+1;i<=c;i++){
		dp[i][b][0] = 0;
		dp[i][b][1] = dp[i-1][b][1]*b%modi;
		dp[i][b][2] = dp[i][b][1];
		dp[i][b][2]%=modi;
	}
	for(long long i =b+1;i<=d;i++){
		dp[a][i][1] = 0;
		dp[a][i][0] = dp[a][i-1][0]*a%modi;
		dp[a][i][2] = dp[a][i][0];
		dp[a][i][2]%=modi;
	}

	for(long long i =a+1;i<=c;i++){
		for(long long j = b+1;j<=d;j++){
			dp[i][j][2] = dp[i-1][j][2] + (dp[i][j-1][2]*i)%modi;
			// dp[i][j][0] = dp[i-1][j][2]*(j)%modi;
			// dp[i][j][1] = dp[i][j-1][2]*(i)%modi;
			dp[i][j][2]%=modi;
			// cout << dp[i][j][2] << " " << i << " " << j << endl;
		}

	}
	// cout << dp[c][d][2] << endl;
	memset(dp2,0,sizeof(dp2));
	dp2[a][b] = 1;
	for(int i =a;i<=c;i++){
		for(int j =b;j<=d;j++){
			dp2[i][j] = dp2[i][j] + (modi+ dp2[i-1][j]*j%modi+dp2[i][j-1]*i%modi-dp2[i-1][j-1]*(i-1)%modi*(j-1)%modi)%modi;
			dp2[i][j]%=modi;
		}
	}

	cout << dp2[c][d] << endl;

}

Compiler output:
a.cc:6:15: error: reference to 'size' is ambiguous
    6 | long long dp2[size][size];
      |               ^~~~
In file included from /usr/include/c++/14/string:53,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:5:11: note:                 'const int size'
    5 | const int size = 3001;
      |           ^~~~
a.cc:6:21: error: reference to 'size' is ambiguous
    6 | long long dp2[size][size];
      |                     ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:5:11: note:                 'const int size'
    5 | const int size = 3001;
      |           ^~~~
a.cc:7:14: error: reference to 'size' is ambiguous
    7 | long long dp[size][size][3];
      |              ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:5:11: note:                 'const int size'
    5 | const int size = 3001;
      |           ^~~~
a.cc:7:20: error: reference to 'size' is ambiguous
    7 | long long dp[size][size][3];
      |                    ^~~~
/usr/include/c++/14/bits/range_access.h:272:5: note: candidates are: 'template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])'
  272 |     size(const _Tp (&)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:262:5: note:                 'template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)'
  262 |     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
      |     ^~~~
a.cc:5:11: note:                 'const int size'
    5 | const int size = 3001;
      |           ^~~~
a.cc: In function 'int main()':
a.cc:19:25: error: 'dp' was not declared in this scope; did you mean 'd'?
   19 |                         dp[i][j][0] = 1LL;
      |                         ^~
      |                         d
a.cc:26:17: error: 'dp' was not declared in this scope; did you mean 'd'?
   26 |                 dp[i][b][0] = 0;
      |                 ^~
      |                 d
a.cc:32:17: error: 'dp' was not declared in this scope; did you mean 'd'?
   32 |                 dp[a][i][1] = 0;
      |                 ^~
      |                 d
a.cc:40:25: error: 'dp' was not declared in this scope; did you mean 'd'?
   40 |                         dp[i][j][2] = dp[i-1][j][2] + (dp[i][j-1][2]*i)%modi;
      |                         ^~
      |                         d
a.cc:49:16: error: 'dp2' was not declared in this scope; did you mean 'dup2'?
   49 |         memset(dp2,0,sizeof(dp2));
      |                ^~~
      |                dup2