D - Rectangles
来源:互联网 发布:mac抓取网页视频 编辑:程序博客网 时间:2024/06/05 21:14
Two rectangles are considered different if none of them can be rotated and moved to obtain the second one. During rectangle construction, Byteman can neither deform the squares nor put any squares upon any other ones.
Input
The first and only line of the standard input contains one integer N (1 <= N <= 10000).
Output
The first and only line of the standard output should contain a single integer equal to the number of different rectangles that Byteman can form using his squares.
Example
For the input data:
6
the correct result is:
8
#include<cstdio>
using namespace std;
int main()
{
int n,c;
while(scanf("%d",&n)!=EOF)
{
c=0;
for(int i=1;i*i<=n;i++)
{
for(int u=i;i*u<=n;u++)
{
if(i*u<=n)
{
c++;
}
}
}
printf("%d\n",c);
}
return 0;
}
思路很简单!由于数据不是很大,遍历即可!
- D - Rectangles
- CF371 D Searching Rectangles
- D. Timofey and rectangles
- CodeForces 714D Searching Rectangles
- CF-333D- Characteristics of Rectangles
- Codeforces 333D Characteristics of Rectangles
- Gym 101102D Rectangles 【单调栈】
- 764D Timofey and rectangles[思维][染色]
- GYM 101102 D.Rectangles(单调栈)
- CodeForces 764D Timofey and rectangles【四色问题】
- Code forces -764D Timofey and rectangles
- Codeforces Problem 333D. Characteristics of Rectangles
- Rectangles
- Rectangles
- Rectangles
- Rectangles
- Rectangles
- Codeforces Round #219 (Div. 2) D. Counting Rectangles is Fun
- Windows 下 使用 Fiddler + nginx 本地 debug 手机APP所访问的后台代码
- 1010. 一元多项式求导 (25)
- 安卓源码(一)下载与同步
- Netty系列之Netty百万级推送服务设计要点
- javamail 实现邮件发送(基于qq邮箱)
- D - Rectangles
- 联机Unity Profile性能调试技巧
- Apache Kafka笔记(一):基础架构
- javascript 笔记
- 构建基于 JPA 的 Hibernate 环境
- Leetcode-61. Rotate List
- selenium-java-Firefox 特殊异常:界面找不到元素
- 【通信框架】Google的开源通信框架protobuf概述
- [Codeforces734E]Anton and Tree 树的直径