首页 > TAG信息列表 > 492

492. 构造矩形

492. 构造矩形 先开平方,然后依次判断是否可以整除即可 class Solution {public:    vector<int> constructRectangle(int area) {        int w = sqrt(1.0 * area);        while(area%w)       {            --w;       }        return {area/w,w

LeetCode——492. 构造矩形(Java)

题目描述 题干: 作为一位web开发者, 懂得怎样去规划一个页面的尺寸是很重要的。 现给定一个具体的矩形页面面积 你的任务是设计一个长度为 L 和宽度为 W 且满足以下要求的矩形的页面。要求: 1. 你设计的矩形页面必须等于给定的目标面积。 2. 宽度 W 不应大于长度 L,换言之,要求 L >= W

AIRTEST 剑与远征 推图脚本

# -*- encoding=utf8 -*- __author__ = "kangpc" from airtest.core.api import * from airtest.core.win.win import * from airtest.aircv.template import * auto_setup(__file__) connect_device("Windows:///328782") touch(Template(r"tpl1

492-构造矩形

492-构造矩形 作为一位web开发者, 懂得怎样去规划一个页面的尺寸是很重要的。 现给定一个具体的矩形页面面积,你的任务是设计一个长度为 L 和宽度为 W 且满足以下要求的矩形的页面。要求: 1. 你设计的矩形页面必须等于给定的目标面积。 2. 宽度 W 不应大于长度 L,换言之,要求 L >= W 。

492. Construct the Rectangle - LeetCode

Description: For a web developer, it is very important to know how to design a web page's size. So, given a specific rectangular web page’s area, your job by now is to design a rectangular web page, whose length L and width W satisfy the following r