countRectangles
来源:互联网 发布:linux 切换root用户 编辑:程序博客网 时间:2024/06/04 23:34
#include<iostream>
using namespace std;
long long countRectangles(int width,int height)
{
long long count=0;
for(int i=width;i>0;--i)
{
for(int j=1;j<=height;++j)
{
if(i!=j)
count+=(width+1-i)*(height+1-j);
}
}
return count;
}
int main()
{
cout<<countRectangles(592,964)<<endl;
return 0;
}
using namespace std;
long long countRectangles(int width,int height)
{
long long count=0;
for(int i=width;i>0;--i)
{
for(int j=1;j<=height;++j)
{
if(i!=j)
count+=(width+1-i)*(height+1-j);
}
}
return count;
}
int main()
{
cout<<countRectangles(592,964)<<endl;
return 0;
}
0 0
- countRectangles
- 2015 ACM/ICPC Asia Regional Shanghai Online-1010-A Sweet Journey
- 图像处理中的数学原理详解(Part3)
- 解决IOS "Illegal instruction:4"
- iOS中类似java抽象类理解。
- 红外遥控解码原理及代码实现
- countRectangles
- JavaScript高级程序设计之基本概念之操作符之乘性操作符第3.5.4讲笔记
- MySQL的大小写敏感性[lower_case_table_names]
- java.lang.OutOfMemoryError: Java heap space解决方法
- Mongodb
- 【Java】interface
- 矩阵乘法的并行化算法讨论
- 模拟Spring的内部实现
- Understanding the digital signature