题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5224

题意:

给出矩形的面积,求出最小的周长。

样例:

Sample Input

3
2
7
12
 

Sample Output

6
16
14
思路:
这个题只需要注意时间就可以了。
  刚开始就就是直接从1开始循环找出满足条件的后比较,结果超时了。。。。
后来又开始从n/2开始查找,这个不需要比较只要找到满足条件就可以了可是还是超时了。。。。
最后是从sqrt()开始才过的。
 #include<iostream>
#include<cmath>
using namespace std;
int i;
int main()
{
int t,n;
cin>>t;
while(t--)
{
cin>>n;
int m;
for(i=sqrt(n);i<=n;i++)
{
if(n%i==)
{ m=i+n/i;
break;
}
}
cout<<m*<<endl;
}
return ;
}
 

Tom and paper的更多相关文章

  1. hdu 5224 Tom and paper

    题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5224 Tom and paper Description There is a piece of pa ...

  2. HDU 5224 Tom and paper(最小周长)

    HDU 5224 Tom and paper(最小周长) Time Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d &a ...

  3. c.Tom and paper

    Tom and paper Description There is a piece of paper in front of Tom, its length and width are intege ...

  4. hdu 5224 Tom and paper 水题

    Tom and paper Time Limit: 20 Sec  Memory Limit: 256 MB 题目连接 http://acm.uestc.edu.cn/#/contest/show/6 ...

  5. 数据挖掘方面重要会议的最佳paper集合

    数据挖掘方面重要会议的最佳paper集合,兴许将陆续分析一下内容: 主要有KDD.SIGMOD.VLDB.ICML.SIGIR KDD (Data Mining) 2013 Simple and De ...

  6. Summary on Visual Tracking: Paper List, Benchmarks and Top Groups

    Summary on Visual Tracking: Paper List, Benchmarks and Top Groups 2018-07-26 10:32:15 This blog is c ...

  7. CVPR2016 Paper list

    CVPR2016 Paper list ORAL SESSIONImage Captioning and Question Answering Monday, June 27th, 9:00AM - ...

  8. CVPR 2017 Paper list

    CVPR2017 paper list Machine Learning 1 Spotlight 1-1A Exclusivity-Consistency Regularized Multi-View ...

  9. 激光打印机的Color/paper, Xerography介绍

    Color Basic 看见色彩三要素: 光源,物体,视觉 加色色彩模型:R,G,B 多用于显示器 减色色彩模型:C,M,Y,K 多用于打印复印 Paper 东亚地区常用A系列标准用纸,在多功能一体机 ...

随机推荐

  1. phpcms v9 黄页实现手机访问手机版,电脑访问电脑版(双模板)

    第一步.模板文件夹下,yp复制一份,改名字 ypwap 第二步.修改phpcms/modules/yp/index.php和phpcms/modules/ypwap/index.php //判断客户端 ...

  2. C# 创建Windows Service

    当我们需要一个程序长期运行,但是不需要界面显示时可以考虑使用Windows Service来实现.这篇博客将简单介绍一下如何创建一个Windows Service,安装/卸载Windows Servi ...

  3. 总结之HashMap

    前言:在上班途中使用博客园的客户端看了看文章,恰好两天之中看了同一个主题关于HashMap的两篇文章: http://www.cnblogs.com/chenssy/p/3521565.html ht ...

  4. JQuery初探

    [TOC] jquery 通过jQuery,您可以选取(查询,query)HTML元素,并对它们执行"操作"(actions). jQuery 使用的语法是 XPath 与 CSS ...

  5. iOS沙盒机制的基本操作总结

    每个ios程序都有自己的沙盒(sandBox),ios8之后提供沙盒部分开放 我们可以访问沙盒下的文件夹 文件夹包括: 1,documents:保存应用运行时生成的需要持久化的数据 2.tem:保存临 ...

  6. UI背景构建

    个中原因不是很明白 <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android=& ...

  7. js日期格式化

    <html> <head> <script> function test(){ //Js获取当前日期时间及其它操作 var myDate = new Date(); ...

  8. 构造函数创建对象和Object.create()实现继承

    第一个方法用构造函数创建对象,实现方法的继承 /*创建一个对象把所有公用的属性和方法,放进去*/ function Person() { this.name = "W3cplus" ...

  9. HTTP 请求方式: GET和POST的比较(转)

    GET和POST是HTTP的两个常用方法.   什么是HTTP? 超文本传输协议(HyperText Transfer Protocol -- HTTP)是一个设计来使客户端和服务器顺利进行通讯的协议 ...

  10. 如何创建一个Android项目

    第一步: File -->New ---->Android Application Project 点击创建 第二步:接下来是几个下拉选择框. Minimum Required SDK 是 ...