本来是一道插头dp的题目,可是CLJ来一句打表,这个题就被结束了。。。
#include <cstdio>
#include <cstring>
#include <cstdlib>
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() {
int A, B;
scanf("%d %d", &A, &B);
if (A > B) { int t = A; A = B; B = t; }
printf("%d\n", ans[A][B]);
return 0;
}