其他分享
首页 > 其他分享> > A. Ivan the Fool and the Probability Theory

A. Ivan the Fool and the Probability Theory

作者:互联网

https://codeforces.com/contest/1239/problem/A

discription

given a \(n*m\) field in which every grid can be painted black and white. count the number of different situation, where every grid has at most one adjacent grid that shares the same color.

breakthrough

no idea. hard limitation causes headache.

but it turns out that we should utilize the harsh contraint wisely.
classial and direct solutions are excluded due to scope of \(n,m\). and once you take up looking for a pattern you will succeed

then you will find that if you have controlled the first row you will have controlled the whole universe unless what you have in the first row is:

apart from that, the partial answer is the number of ways of all situation of the first row except the situation mentioned above.

add them up and you will get the answer

标签:Fool,Theory,number,will,grid,Ivan,situation,row,first
来源: https://www.cnblogs.com/reshuffle/p/12543085.html