492. Construct the Rectangle
static int wing=[]()
{
std::ios::sync_with_stdio(false);
cin.tie(NULL);
return ;
}(); class Solution
{
public:
vector<int> constructRectangle(int area)
{
vector<int> res;
int test=sqrt(area);
for(;test>;test--)
{
if(area%test==)
return {area/test,test};
}
}
};
从开方出来的数一个个找
492. Construct the Rectangle的更多相关文章
- 【leetcode】492. Construct the Rectangle
problem 492. Construct the Rectangle 参考 1. Leetcode_492. Construct the Rectangle; 完
- LeetCode - 492. Construct the Rectangle
For a web developer, it is very important to know how to design a web page's size. So, given a speci ...
- [LeetCode&Python] Problem 492. Construct the Rectangle
For a web developer, it is very important to know how to design a web page's size. So, given a speci ...
- LeetCode: 492 Construct the Rectangle(easy)
题目: or a web developer, it is very important to know how to design a web page's size. So, given a sp ...
- 【LeetCode】492. Construct the Rectangle 解题报告(Java & Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 Java解法 python解法 日期 题目地址:ht ...
- 492 Construct the Rectangle 构建矩形
详见:https://leetcode.com/problems/construct-the-rectangle/description/ C++: class Solution { public: ...
- LeetCode——Construct the Rectangle
LeetCode--Construct the Rectangle Question For a web developer, it is very important to know how to ...
- 1209. Construct the Rectangle
1209. Construct the Rectangle class Solution { public: /** * @param area: web page’s area * @retur ...
- [LeetCode] Construct the Rectangle 构建矩形
For a web developer, it is very important to know how to design a web page's size. So, given a speci ...
随机推荐
- Tomcat 多项目管理
有时我们会在一个服务下存在多个项目的情况,为了统一管理和服务运行安全考虑,有时候我们需要重新部署一个项目但又不能停掉其它项目,就可以用manager进行管理. Tomcat manager和Root访 ...
- UI5-文档-4.3-Controls
现在是时候构建我们的第一个小UI了,将HTML主体中的“Hello World”文本替换为SAPUI5控件sap.m.Text.首先,我们将使用JavaScript控件接口来设置UI,然后将控件实例放 ...
- ios tableview header 透明
当将tableview的style属性设为grouped时,header或footer会变成透明,如果设为plain,header或footer会保持默认颜色
- object-c语法
Objective-C:C的超集 Objective-Objective-C是C语言的严格超集--任何C语言程序不经修改就可以直接通过Objective-C编译器,在Objective-C中使用C语言 ...
- DOM 练习
练习一: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3 ...
- distinct top執行順序
select distinct top 3 from table; 先distinct后top
- docker在centos和Ubuntu的安装
CentOS: http://blog.csdn.net/wuapeng/article/details/51728614 rpm -Uvh http://www.elrepo.org/elrepo- ...
- 使用百度网盘配置私有Git服务
GitHub上免费的版本只能开源代码库,有时候需要配置些私有的服务,不方便公开.现在免费的网盘的容量越来越大,可以用来做存储的服务,如果只使用网盘存储合并代码很不方便,所以使用网盘+git 配置私有仓 ...
- 编辑距离12 · Edit Distance12
[抄题]: 给出两个单词word1和word2,计算出将word1 转换为word2的最少操作次数. 你总共三种操作方法: 插入一个字符 删除一个字符 替换一个字符 [思维问题]: [一句话思路]: ...
- [leetcode]173. Binary Search Tree Iterator 二叉搜索树迭代器
Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the ro ...