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的更多相关文章

  1. 【leetcode】492. Construct the Rectangle

    problem 492. Construct the Rectangle 参考 1. Leetcode_492. Construct the Rectangle; 完

  2. LeetCode——Construct the Rectangle

    LeetCode--Construct the Rectangle Question For a web developer, it is very important to know how to ...

  3. 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 ...

  4. [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 ...

  5. [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 ...

  6. [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 ...

  7. LeetCode Construct the Rectangle

    原题链接在这里:https://leetcode.com/problems/construct-the-rectangle/ 题目: For a web developer, it is very i ...

  8. 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 ...

  9. 【LeetCode】492. Construct the Rectangle 解题报告(Java & Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 Java解法 python解法 日期 题目地址:ht ...

随机推荐

  1. POJ3080 Blue Jeans 题解 KMP算法

    题目链接:http://poj.org/problem?id=3080 题目大意:给你N个长度为60的字符串(N<=10),求他们的最长公共子串(长度>=3). 题目分析:KMP字符串匹配 ...

  2. H3C V.35接口线缆

  3. 全面解读Python Web开发框架Django,利用Django构建web应用及其部署

    全面解读Python Web开发框架Django Django是一个开源的Web应用框架,由Python写成.采用MVC的软件设计模式,主要目标是使得开发复杂的.数据库驱动的网站变得简单.Django ...

  4. js点击按钮为元素随机字体颜色和背景色

    文章地址 https://www.cnblogs.com/sandraryan/ 写两个button和一个div,点击按钮分别改变背景色和前景色(字体颜色).产生的是一个随机颜色. <!DOCT ...

  5. Spring Security实现禁止用户重复登陆(配置及原理)

    系统使用了Spring Security做权限管理,现在对于系统的用户,需要改动配置,实现无法多地登陆.   一.SpringMVC项目,配置如下: 首先在修改Security相关的XML,我这里是s ...

  6. HTML DOM clearInterval() 方法

    定义和用法 clearInterval() 方法可取消由 setInterval() 设置的 timeout. clearInterval() 方法的参数必须是由 setInterval() 返回的 ...

  7. tf.truncates_normal()

    转载自:https://blog.csdn.net/uestc_c2_403/article/details/72235565 tf.truncated_normal(shape, mean, std ...

  8. C# 任务并行

    . List<int> ids = new List<int>(); ; i < ; i++) { ids.Add(i); } ;//最大并行数量 List<Tas ...

  9. 【Linux】CentOS 7.5 修改时区

    1⃣️查看当前CentOS系统版本: [parallels@k8s-node2 ~]$ cat /etc/redhat-release CentOS Linux release 7.5.1804 (C ...

  10. 聊聊固态硬盘1--人生头两块SSD

    第一块固态硬盘--浦科特m6s   来源:京东双11   价格:319rmb           第二款固态--饥饿鲨ocz arc100   来源:美国亚马逊 黑色星期五 价格:366rmb     ...