题目链接:uva 211 - The Domino Effect
题目大意:给出一些7*8的矩阵,每两个相邻的数字可以表示一个骨牌,问说骨牌有多少种摆法。
解题思路:总共有28块骨牌,dfs枚举每一个位置,考虑当前位置和下面右边组成的骨牌。
#include <stdio.h>
#include <string.h>
const int R = 7;
const int C = 8;
const int N = 30;
const int d[2][2] = {
{0, 1}, {1, 0}};
int ans, t[R][C], g[R][C], vis[R][C], rec[N];
bool init() {