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 ...
随机推荐
- openSUSE 国内镜像和镜像使用帮助 (zhuan)
https://my.oschina.net/u/2475751/blog/631036?p={{currentPage-1}} https://lug.ustc.edu.cn/wiki/mirror ...
- Windows 内存架构
理解 Virtual Memory, Physical Memory, Committed Memory, Page File, Working Set, Modified Pages, Standb ...
- 如何从NFS文件系统启动
笔记,备忘! 步骤: 1.设置好NFS服务器 2.修改uboot启动参数bootarg setenv bootargs console=ttySAC0 root=/dev/nfs nfsroot=19 ...
- Django缓存优化之redis
Redis 概述 Redis 是一个开源的Inmemory key-value 存储系统,性能高,很大程度上补偿了 memcached 的不足.支持多种存储类型,包括 string, list, se ...
- 推荐两篇Unity与Android交互的文章
http://www.xuanyusong.com/archives/676 里面18,19介绍
- iOS 轻量级的数据库leveldb
轻量级的数据库leveldb https://github.com/google/leveldb 一:在iOS下编译leveldb 终端: 1: git clone https://github.co ...
- java 多线程3(线程安全)
需求:模拟三个窗口同时买票. 问题1:static 修饰num,只创建一份在内存中,要不就会创建3份. 问题2:线程安全问题.(代码重1的红色字体) 出现的原因:存在两个或两个以上的线程对象,而且线程 ...
- clip API实现遮罩
(function () { var img; var canvas = document.getElementById("canvas"); var con = canvas.g ...
- hibernate的懒加载问题
产生原因: 当使用hibernate查询一个对象的时候,如果Session关闭,再调用该对象关联的集合或者对象的时候,会产生懒加载异常! 解决方案: 方案一: 在Session关闭之前,查询对象关联的 ...
- Python中一些内建函数及os等模块的用法
len(obj) # 求长度:obj可以是str.list等对象 split(str, num) # str-分割符,默认空格: ...