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 ...
随机推荐
- php中array_map和array_walk的使用对比_php技巧
一.array_map() 1.array_map() 函数将用户自定义函数作用到数组中的每个值上,并返回用户自定义函数作用后的带有新值的数组,若函数作用后无返回值,则对应的新值数组中为空. 2.回调 ...
- 【转】Maven中-DskipTests和-Dmaven.test.skip=true的区别
主要区别是:是否编译测试类 -DskipTests:编译测试类,但不运行 -Dmaven.test.skip=true:不编译.不运行 转自 http://zephiruswt.blog.51cto. ...
- Windows 忘记密码
能进入windows,以前保存的凭据,但是不知道啥. windows下进入cmd net user administrator abc123 这样可以重置密码
- FDMemTable 数据集
c++builder FDMemTable 内存表 内存数据表:现在应该首选 TFDMemTable 了(之前是 TClientDataSet) FDMemTable->CloneCursor( ...
- gevent 实现单线程下的socket链接
通过gevent实现socket的多并发 server 端: import geventfrom gevent import socket, monkey monkey.patch_all() #进行 ...
- java开源项目jremoting
https://github.com/jremoting/jremoting jremoting是一个类似dubbo的rpc服务治理框架,并且可以与dubbo相互调用.jremoting的实现是参考了 ...
- python 写hive循环脚本
要一个月的数据 一次跑一周的数据 ,建表用插入数据的方法: import os, sys reload(sys); sys.setdefaultencoding( "utf-8" ...
- JAVA的String类的常用方法(转载)
Java-String类的常用方法总结 一.String类String类在java.lang包中,java使用String类创建一个字符串变量,字符串变量属于对象.java把String类声明的f ...
- docker 入門
http://dockone.io/article/277 我的碎碎念:Docker入门指南 [编者的话]之前曾经翻译过很多Docker入门介绍的文章,之所以再翻译这篇,是因为Anders的角度很独特 ...
- vmstat工具
vmstat vmstat是Virtual Meomory Statistics(虚拟内存统计)的缩写, 是实时系统监控工具.该命令通过使用knlist子程序和/dev/kmen伪设备驱动器访问这些数 ...