第九届ACM山东省省赛 H 题 - Dominoes ( BFS )

博客介绍了第九届ACM山东省省赛H题,题目涉及在一个有空格的n*m棋盘上,用k个1*2大小的多米诺骨牌移动形成的不同状态。博主通过BFS算法详细解析了解题思路,包括如何标记骨牌状态,判断空格位置,并进行广度优先搜索来计算可能的最终状态数量,模1000000009。
摘要由CSDN通过智能技术生成

欢迎访问https://blog.csdn.net/lxt_Lucia~~

宇宙第一小仙女\(^o^)/~萌量爆表求带飞=≡Σ((( つ^o^)つ~ dalao们点个关注呗~

 

--------------------------------我只是一条可爱哒分界线-------------------------------

 

一、问题:

Description

Orz likes to play dominoes. Now giving an n∗mn∗m chessboard and kk dominoes whose size are 1∗21∗2, Orz finds that there is exactly one grid empty, so that he can move dominoes without overlapping them. An initial situation is given, he wants to know how many final situation could be achieved, except the initial situation. Note every domino is different, as they have their own serial number. Since the answer may be very large, please output the answer modulo 1000000009. 

 

Input

There will be multiple test cases. For each test case:
The first line contains three integers: n,m,k(n≤9,m≤10000)n,m,k(n≤9,m≤10000).
The following kk lines, each line contains four integers: a   b  c  d, indicating that this domino occupies (a, b) and (c, d). 
The input guarantees that the domino does not overlap, and there is exactly one empty grid.

 

Output

For each test cases, output the answer modulo 10000000091000000009.

 <

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值