NC19910. [CQOI2007]矩形RECT
描述
输入描述
输入仅一行,为两个整数a,b。,
输出描述
输出仅一行,即方案总数。
示例1
输入:
3 2
输出:
15
示例2
输入:
3 3
输出:
52
C++ 解法, 执行用时: 3ms, 内存消耗: 396K, 提交时间: 2022-07-15 13:48:14
#include <iostream> #include <algorithm> using namespace std; int a,b; int ans[7][8]={ {0,0,0,0,0,0,0,0}, {0,0,1,2,3,4,5,6}, {0,0,6,15,28,45,66,91}, {0,0,0,52,143,350,799,1744}, {0,0,0,0,614,2431,9184,33603}, {0,0,0,0,0,16000,102147,637330}, {0,0,0,0,0,0,1114394,11948355} }; int main(){ cin>>a>>b; if(a>b) swap(a,b); cout<<ans[a][b]<<endl; return 0; }