题目链接: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. js判断手机端Android手机还是iPhone手机

    /*判断当前设备是平板.安卓.苹果设备*/ <script type="text/javascript"> function fBrowserRedirect(){ v ...

  2. Android开发的教程和资源

    Android 设计指南非官方简体中文版 http://www.apkbus.com/design/index.html NDK下载 http://developer.android.com/tool ...

  3. loj 1271

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=26981 思路:题目的意思是求给定的起点到终点的最短路径序列,并且这 ...

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

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

  5. Ubuntu14 搭载vim环境查看源码

    首先是下载完整的vim74,然后编译安装.遗憾的是当编译时,没有开启图形界面. 在安装新版本的Vim之前,你需要卸载原来安装的老版本Vim,依次在终端下执行下列命令: sudo apt-get rem ...

  6. LoadRunner 事务函数

    status 包括LR_PASS, LR_FAIL,  LR_AUTO,  LR_STOP(这个没用过) lr_set_transaction_instance_status(status); 可以根 ...

  7. 关于解决haswell赛扬和奔腾 不能安装的问题

    打开EFI\CLOVER\config.plist,并找到KernelAndKextPatches字段,在子集内插入下面代码. <key>FakeCPUID</key> < ...

  8. Adobe Flash Media Server安装

    Flash Media Server(FMS)是一个流媒体服务器 使用 实时消息传送协议(RTMP),RTMP是一种未加密的TCP/IP协议,专门设计用来高速传送音频.视频和数据信息. 3.5版32位 ...

  9. DSP using MATLAB 示例 Example3.10

    用到的性质 上代码: n = -5:10; x = rand(1,length(n)) + j * rand(1,length(n)); k = -100:100; w = (pi/100)*k; % ...

  10. 04 DOM一窥

    BOM 浏览器对象模型 * window       alert(); 弹出框 confirm() 询问框 setInterval("run()",1000); 每隔1秒执行run ...