1209. Construct the Rectangle
1209. Construct the Rectangle
class Solution {
public:
/**
* @param area: web page’s area
* @return: the length L and the width W of the web page you designed in sequence
*/
vector<int> constructRectangle(int area) {
// Write your code here
int start = sqrt(area);
while(area%start != 0 && start<area)
{
start ++;
}
vector<int> res;
res.push_back(start);
res.push_back(area/start);
return res;
}
};
1209. Construct the Rectangle的更多相关文章
- 【leetcode】492. Construct the Rectangle
problem 492. Construct the Rectangle 参考 1. Leetcode_492. Construct the Rectangle; 完
- LeetCode——Construct the Rectangle
LeetCode--Construct the Rectangle Question For a web developer, it is very important to know how to ...
- 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] 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 ...
- [Swift]LeetCode492. 构造矩形 | 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 Construct the Rectangle
原题链接在这里:https://leetcode.com/problems/construct-the-rectangle/ 题目: For a web developer, it is very i ...
- 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 ...
随机推荐
- Laravel实现找回密码及密码重置的例子
https://mp.weixin.qq.com/s/PO5f5OJPt5FzUZr-7Xz8-g Laravel实现找回密码及密码重置功能在php实现与在这里实现会有什么区别呢,下面我们来看看Lar ...
- 微软产品开发文档:包括.net core .net vs等等
Browse all https://docs.microsoft.com/en-us/learn/browse/?roles=developer&products=xamarin%2Cef- ...
- pytorch中squeeze()和unsqueeze()函数介绍
一.unsqueeze()函数 1. 首先初始化一个a 可以看出a的维度为(2,3) 2. 在第二维增加一个维度,使其维度变为(2,1,3) 可以看出a的维度已经变为(2,1,3)了,同样如果需要在倒 ...
- Python--day62--删除出版社
删除成出版社关键代码:
- java io流与序列化反序列化
java的io是实现输入和输出的基础,可以方便的实现数据的输入和输出操作. 序列化 (Serialization)是将对象的状态信息转换为可以存储或传输的形式的过程.在序列化期间,对象将其当前状态写入 ...
- Redux 初始化完整结构
文件管理 目录文档 ★★★index.js★★★ ★★★app.js★★★ ★★★store->index.js★★★ ★★★actions->index.js★★★ ★★★store-& ...
- H3C RIPv1的缺点
- ESB总线的核心架构
根据近期对开源ESB产品的研究,已经对Oracle和Tibco的ESB总线产品的实施经验积累,对ESB总线的核心产品架构有了进一步的清晰认识,将ESB的核心架构整理为上图,上图中看到的内容也是做为一款 ...
- H3C DNS域名解析原理
- the password has expired
Oracle提示错误消息ORA-28001: the password has expired,是由于Oracle11G的新特性所致, Oracle11G创建用户时缺省密码过期限制是180天(即6个月 ...