Problem C HDU 5224
Description
Input
T\leq 10,n\leq {10}^{9}
Output
Sample Input
2
7
12
Sample Output
16
14
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
int t,s;
double m;
scanf("%d",&t);
while(t--)
{
int x,y,c;
int mini=1e9;
scanf("%d",&s);
m=(double)sqrt(s);
for(x=1;x<=m;x++)
{
if(s%x==0)
{
y=s/x;
c=(x+y)*2;
mini=min(c,mini);
}
}
printf("%d\n",mini); }
}
Problem C HDU 5224的更多相关文章
- HDU 5224 Tom and paper(最小周长)
HDU 5224 Tom and paper(最小周长) Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d &a ...
- A * B Problem Plus HDU - 1402 (FFT)
A * B Problem Plus HDU - 1402 (FFT) Calculate A * B. InputEach line will contain two integers A and ...
- hdu 5224 Tom and paper
题目连接 http://acm.hdu.edu.cn/showproblem.php?pid=5224 Tom and paper Description There is a piece of pa ...
- 2013多校联合3 G The Unsolvable Problem(hdu 4627)
2013-07-30 20:35 388人阅读 评论(0) 收藏 举报 http://acm.hdu.edu.cn/showproblem.php?pid=4627 The Unsolvable Pr ...
- Train Problem I hdu 1022(栈)
http://acm.split.hdu.edu.cn/showproblem.php?pid=1022 题意:给出火车的进站与出站顺序,判断是否可以按照给出的出站顺序出站. #include < ...
- Train Problem I (HDU 100题纪念)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission( ...
- BestCoder Round #70 Jam's math problem(hdu 5615)
Problem Description Jam has a math problem. He just learned factorization. He is trying to factorize ...
- Polynomial Problem(hdu 1296 表达式求值)
We have learned how to obtain the value of a polynomial when we were a middle school student. If f(x ...
- 刷题总结——Tree chain problem(HDU 5293 树形dp+dfs序+树状数组)
题目: Problem Description Coco has a tree, whose vertices are conveniently labeled by 1,2,…,n.There ar ...
随机推荐
- openfire升级指南
原文:http://www.liuhaihua.cn/archives/355.html 升级Openfire是和从头开始安装Openfire几乎一样简单.作为升级过程的一部分,它强烈建议您先备份当前 ...
- Html_在线客服静态网页
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- mysql使用笔记(二)
一.启动和关闭mysql服务 windows下 启动 (方法1)管理员权限进入cmd,执行 net start mysql (方法2)管理员权限进入cmd,执行 mysqld -uroot --con ...
- 界面显示这个时间格式的js代码: 2016年1月19日 星期二 乙未(羊)年 腊月初十
today=new Date();function initArray(){ this.length=initArray.arguments.length for(var i=0;i<this. ...
- HTML5中的文本级语义
<p>这篇文章的发布时间是<time datetime="2016-02-26T16:30+08:00" pubdate>今天</time>&l ...
- 向html中添加节点
简单: ①,js中: (function () { var box=document.querySelector("#box"); var con1=document.create ...
- python 练习 30
Python从设计之初就已经是一门面向对象的语言,正因为如此,在Python中创建一个类和对象是很容易的.本章节我们将详细介绍Python的面向对象编程. 如果你以前没有接触过面向对象的编程语言,那你 ...
- ThreadLocal 那点事儿
原文出处: 黄勇 ThreadLocal,直译为“线程本地”或“本地线程”,如果你真的这么认为,那就错了!其实,它就是一个容器,用于存放线程的局部变量,我认为应该叫做 ThreadLocalVaria ...
- zoj3822 Domination(概率dp)
Domination Time Limit: 8 Seconds Memory Limit: 131072 KB Special Judge Edward is the headm ...
- 使用Eclipse构建Maven的SpringMVC项目
一.直接建立Maven项目方法1.建立Maven项目 接下来使用Eclipse的maven构建一个web项目,以构建SpringMVC项目为例: 1.1 选择建立Maven Project 选择Fil ...