博客
关于我
Leetcode 492. 构造矩形
阅读量:101 次
发布时间:2019-02-26

本文共 636 字,大约阅读时间需要 2 分钟。

?????????????L???W??????????????????????????????????

  • ?????????????????????????L???W?????
  • ?????????????????????i???i???????
  • ??????????????i????????L=??/i?????W=i???L >= W????????
  • ???????

    #include 
    #include
    using namespace std;vector
    constructRectangle(int area) { int a = static_cast
    (sqrt(area)); for (int i = a; i >= 1; --i) { if (area % i == 0) { return {i, area / i}; } } // ???????????????????i=1?area%1==0? return {area, 1};}

    ?????

    ???????????????????????????????L???W???L >= W??????

    ?????

    • ???4???[2, 2]

    • ???12???[3, 4]

    • ???15???[3, 5]

    转载地址:http://vvzu.baihongyu.com/

    你可能感兴趣的文章
    Netty源码—2.Reactor线程模型一
    查看>>
    Netty源码—4.客户端接入流程一
    查看>>
    Netty源码—4.客户端接入流程二
    查看>>
    Netty源码—5.Pipeline和Handler一
    查看>>
    Netty源码—6.ByteBuf原理二
    查看>>
    Netty源码—7.ByteBuf原理三
    查看>>
    Netty源码—7.ByteBuf原理四
    查看>>
    Netty源码—8.编解码原理二
    查看>>
    Netty源码解读
    查看>>
    Netty的Socket编程详解-搭建服务端与客户端并进行数据传输
    查看>>
    Netty相关
    查看>>
    Network Dissection:Quantifying Interpretability of Deep Visual Representations(深层视觉表征的量化解释)
    查看>>
    Network Sniffer and Connection Analyzer
    查看>>
    NFS共享文件系统搭建
    查看>>
    ng 指令的自定义、使用
    查看>>
    nginx + etcd 动态负载均衡实践(二)—— 组件安装
    查看>>
    Nginx + uWSGI + Flask + Vhost
    查看>>
    Nginx Location配置总结
    查看>>
    Nginx 动静分离与负载均衡的实现
    查看>>
    Nginx 反向代理解决跨域问题
    查看>>