#include using namespace std; const int mod = 1e9 + 7; vectordp; void calc(int i, int m, int mask, int next_mask, vector& next) { if(i == m) { next.push_back(next_mask); return; } int x = (mask>>i)&1; int y = (mask>>(i+1))&1; if(x == 0) { // horizontal block placement calc(i+1, m, mask, next_mask|(1m>>n; dp.resize(n, vector(pow(2, m), -1)); int ans = solve(0, 0, m, n); cout
#include
using namespace std;
const int mod = 1e9 + 7;
vectordp;
void calc(int i, int m, int mask, int next_mask, vector& next)
{
if(i == m)
{
next.push_back(next_mask);
return;
}
int x = (mask>>i)&1;
int y = (mask>>(i+1))&1;
if(x == 0)
{
// horizontal block placement
calc(i+1, m, mask, next_mask|(1m>>n;
dp.resize(n, vector(pow(2, m), -1));
int ans = solve(0, 0, m, n);
cout
Wonderful Explanation Annayya 👏
Just arrived at one of the Great Explaination of this problem... Thank u
Thank you bro , it means a lot..
You explained sooo beautifully❤ excellent teaching skill
Thank you
Bro, great explanation ..
Kudos!!!!
Thank you