摘要: 问题描述 问题求解 本题还挺巧妙,有点类似两数和的扩展题。 对于两个线段,我们可以固定右线段,然后寻找左线段的最大值。 固定右线段使用到的算法是滑动窗口,寻找左线段最大值的算法是动态规划。 时间复杂度:O(n) class Solution: def maximizeWin(self, prizeP 阅读全文
posted @ 2024-09-11 18:17 hyserendipity 阅读(1) 评论(0) 推荐(0) 编辑
摘要: LLAMA paper:https://readpaper.com/paper/1669077195157493760 模型参数:7B、13B、33B、65B 主要贡献:完全使用开源数据进行训练,训练完成的模型开源 Overall, our entire training dataset conta 阅读全文
posted @ 2023-09-15 17:33 hyserendipity 阅读(3) 评论(0) 推荐(0) 编辑
摘要: # [2791\. 树中可以形成回文的路径数](https://leetcode.cn/problems/count-paths-that-can-form-a-palindrome-in-a-tree/description/) ## Description Difficulty: **困难** 阅读全文
posted @ 2023-07-30 18:00 hyserendipity 阅读(13) 评论(0) 推荐(0) 编辑
摘要: # [2761\. 和等于目标值的质数对](https://leetcode.cn/problems/prime-pairs-with-target-sum/) ## Description Difficulty: **中等** Related Topics: 给你一个整数 `n` 。如果两个整数 阅读全文
posted @ 2023-07-04 22:36 hyserendipity 阅读(16) 评论(0) 推荐(0) 编辑
摘要: # [1262\. 可被三整除的最大和](https://leetcode.cn/problems/greatest-sum-divisible-by-three/) ## Description Difficulty: **1762** Related Topics: [贪心](https://l 阅读全文
posted @ 2023-06-19 22:41 hyserendipity 阅读(2) 评论(0) 推荐(0) 编辑
摘要: # [6447\. 给墙壁刷油漆](https://leetcode.cn/problems/painting-the-walls/description/) ## Description Difficulty: **困难** Related Topics: 给你两个长度为 `n` 下标从 **0* 阅读全文
posted @ 2023-06-18 22:08 hyserendipity 阅读(4) 评论(0) 推荐(0) 编辑
摘要: # [6893\. 特别的排列](https://leetcode.cn/problems/special-permutations/) ## Description Difficulty: **中等** Related Topics: 给你一个下标从 **0** 开始的整数数组 `nums` ,它 阅读全文
posted @ 2023-06-18 21:18 hyserendipity 阅读(4) 评论(0) 推荐(0) 编辑
摘要: 6365. 将整数减少到零需要的最少操作数 Description Difficulty: 简单 Related Topics: 给你一个正整数 n ,你可以执行下述操作 任意 次: n 加上或减去 2 的某个 幂 返回使 n 等于 0 需要执行的 最少 操作数。 如果 x == 2i 且其中 i 阅读全文
posted @ 2023-02-19 21:52 hyserendipity 阅读(42) 评论(0) 推荐(0) 编辑
摘要: 基本概念 Precision 精确率 Precision(精确率)指的是在所有预测为正的样本中,实际上是正样本的比例。 $Precision = \frac{TP}{TP + FP}$ Recall 召回率 Recall(召回率)指的是所有正样本中,被预测为正的比例。 $Recall = \frac 阅读全文
posted @ 2023-01-28 10:54 hyserendipity 阅读(102) 评论(0) 推荐(0) 编辑
摘要: 304. 二维区域和检索 - 矩阵不可变 Description Difficulty: 中等 Related Topics: 设计, 数组, 矩阵, 前缀和 给定一个二维矩阵 matrix,以下类型的多个请求: 计算其子矩形范围内元素的总和,该子矩阵的 左上角 为 (row1, col1) ,右下 阅读全文
posted @ 2023-01-15 17:47 hyserendipity 阅读(29) 评论(0) 推荐(0) 编辑