Description
Farmer John has purchased a lush new rectangular pasture composed of M by
N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of square...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 05:46:43   
                                阅读次数:
323
                             
                         
                    
                        
                            
                            
                                题意:在n*m(1
解法;很经典的状压模型。先将每一行的合法状态求出来,12的时候最多377个合法状态。然后进行与行之间的状态转移。最坏复杂度12*(377^2)
代码:/****************************************************
* author:xiefubao
*********************************...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 09:21:40   
                                阅读次数:
301
                             
                         
                    
                        
                            
                            
                                Corn Fields
Time Limit: 2000MS
 
Memory Limit: 65536K
Total Submissions: 6460
 
Accepted: 3436
Description
Farmer John has purchased a lush new rectangular pasture compos...
                            
                            
                                分类:
其他好文   时间:
2014-04-29 13:37:20   
                                阅读次数:
339
                             
                         
                    
                        
                            
                            
                                题目链接:http://poj.org/problem?id=3254
题意:给出一个n行m列的草地,1表示肥沃,0表示贫瘠,现在要把一些牛放在肥沃的草地上,但是要求所有牛不能相邻,问你有多少种放法。
分析:假如我们知道第 i-1 行的所有的可以放的情况,那么对于第 i 行的可以放的一种情况,我们只要判断它和 i - 1 行的所有情况的能不能满足题目的所有牛不相邻,如果有种中满...
                            
                            
                                分类:
其他好文   时间:
2014-04-29 13:33:20   
                                阅读次数:
242