P1817 棋盘染色

题目

题目

思路

额,显然这破题打表啊!7*8打表出奇迹啊!打表代码见这玩意啊
code:

#include<cstring>
#include<iostream>
#include<cmath>
#include<queue>
#include<algorithm>
using namespace std;
long long s[7][8]={
    
    {
    
    0,2,4,6,8,10,12,14},{
    
    2,12,30,56,90,132,182,240},{
    
    4,30,104,286,700,1598,3488,7390},{
    
    6,56,286,1228,4862,18368,67206,240180},{
    
    8,90,700,4862,32000,204294,1274660,7807790},{
    
    10,132,1598,18368,204294,2228788,23896710,252488208},{
    
    12,182,3488,67206,1274660,23896710,441524056,8056291934}};
int main()
{
    
    
	int n,m;
	cin>>n>>m;
	if (n==0||m==0)
	{
    
    
		cout<<0;
		return 0;
	}
	cout<<s[n-1][m-1];
	return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_49843717/article/details/113815837