CF50A Domino piling 题解
description:
给定一个n×m的矩阵,问能放置几个1×2的多米诺骨牌
solution:
这道题仅仅是要求放置的个数而不是方案数。
这样应该就能想到解答了:
矩阵的面积算出来再÷(1×2)就行了
于是就是要输出2n×m
code:
#include<cstdio>
using namespace std;
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",a*b/2);
return 0;
}