V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
urnoob
V2EX  ›  程序员

误入软件行业的老年人第一次独立做出了某算法网站 hard 题

  •  
  •   urnoob · 2022-07-26 17:35:29 +08:00 · 1184 次点击
    这是一个创建于 611 天前的主题,其中的信息可能已经有所发展或是发生改变。
    第 124 题
    本来用
    PriorityQueue<Integer> q = new PriorityQueue<>(1, (o1, o2) -> o2 - o1)
    保存最大值
    就只超过了 5%的提交 6 ms 48.6 MB

    后来直接用 1 个元素的数组保存
    Runtime: 1 ms, faster than 99.67% of Java online submissions for Binary Tree Maximum Path Sum.
    Memory Usage: 48 MB, less than 38.84% of Java online submissions for Binary Tree Maximum Path Sum.
    1 条回复    2022-07-26 21:37:07 +08:00
    codefever
        1
    codefever  
       2022-07-26 21:37:07 +08:00
    再接再厉!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3213 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 11:56 · PVG 19:56 · LAX 04:56 · JFK 07:56
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.