首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

一道acm简单题,思路不明解决方案

2012-02-22 
一道acm简单题,思路不明题目:Problem DescriptionBy counting carefully it can be seen that a rectangul

一道acm简单题,思路不明
题目:Problem Description 
By counting carefully it can be seen that a rectangular grid measuring 3 by 2 contains eighteen rectangles:

But how many rectangles a rectangular grid measuring n by m contains ?

 
 
Input 
The input file consists of one line containing n and m (1 <= n <= 100, 1 <= m <= 100).
 
Output 
The output should print the number of rectangulars.

 
 
Sample Input 
3 2
 
Sample Output 
18
 ;
我想问下下这道题的思路,那位大牛能指点一下谢谢


[解决办法]
n*(n+1)/2 * m*(m+1)/2
[解决办法]
哦 我懂了 意思是说画出2行3列的表格(3行2列也行,都一样) 然后数出你所能看见的所有矩形 但不能重复 可是我只数出14个
[解决办法]

探讨

n*(n+1)/2 * m*(m+1)/2

热点排行