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. Project Euler Problem 15-Lattice paths

    组合数,2n中选n个.向右走有n步,向下走有n步.共2n步.有n步是向右走的,计算向右走的这n步的所有情况,即C(2n,n). 或者,每一步,只能从右边或者上边走过来,只有这两种情况,即step[i] ...

  2. SuperSocket 中的日志系统

    当 SuperSocket boostrap 启动时,日志系统将会自动启动. 所以你无须创建自己的日志工具,最好直接使用SuperSocket内置的日志功能. SuperSocket 默认使用log4 ...

  3. HTML静态网页---样式属性

    一.背景与前景 1.背景: 2.前景字体: 二.边界和边框 border(表格边框.样式等).margin(表外间距).padding(内容与单元格间距). 三.列表与方块 width.height. ...

  4. Python--day72--ajax完整版

    来源: AJAX准备知识:JSON 什么是 JSON ? JSON 指的是 JavaScript 对象表示法(JavaScript Object Notation) JSON 是轻量级的文本数据交换格 ...

  5. CentOS7增加或修改SSH端口号

    https://blog.csdn.net/ausboyue/article/details/53691953 前言:开启某服务或软件的端口,要从该服务或软件监听的端口(多以修改配置文件为主),SeL ...

  6. vue-lazyload: 想弃坑,但没有找到合适的替代品

    vue-lazyload,相信在vue项目中大家都有用到过它,同时也遇到过大大小小的坑.笔者也遇到过这样一个bug,在一个图片列表页面中,总有一定的概率图片的状态为load,导致图片一直加载中...这 ...

  7. MySQL视图操作命令详解

    内容目录 创建视图 删除视图 修改视图 查看视图 §创建视图 在MySQL中,创建视图的完整语法如下: CREATE [OR REPLACE] [ALGORITHM = {UNDEFINED | ME ...

  8. H3C FTP被动数据传输方式

  9. keep-alive及路由渲染

    切换路由的时候,每次切换的时候得重新渲染一遍,这样的话会影响到性能的.此时用<keep-alive>包裹着app里的<router-view>,进行缓存. 如果一个页面涉及到了 ...

  10. 2019-8-31-dotnet-Framework-源代码-·-Ink

    title author date CreateTime categories dotnet Framework 源代码 · Ink lindexi 2019-08-31 16:55:58 +0800 ...