poj2965专题

poj2965--The Pilots Brothers' refrigerator

The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 17642 Accepted: 6685 Special Judge Description The game “The Pilots Brothers: following the stripy

poj2965_refrigerator(BFS+枚举)

结题思想: 1.此题一定要使用枚举,将每一个位置的值变化的可能都枚举一下。但是个要么变,要么不变,并且和改变的顺序无关。(具体的证明我还不是很清楚,希望看到博客的朋友,如果知道怎么证明,请不吝赐教)。 2.要找最少的情况,则一定是要使用广度优先遍历各种情况。 介绍代码中的几个变量: q[i] 做队列使用,用于存储矩阵的不同状态。 f[i] 此数组和q配合起来,用来记录对应位置状态的是由谁