1 2 3 4 5 ··· 94 下一页
摘要: 简介 树状树 是在线段树的基础上生成的,更精简,用在快速求 一串数据的区间和 code public class BinaryIndexedTree { private int[] tree; private int n; public BinaryIndexedTree(int [] arr) { 阅读全文
posted @ 2024-12-28 22:13 HDU李少帅 阅读(8) 评论(0) 推荐(0)
摘要: 线段树 简而言之:就是 层数是 log2(n) 的树,然后用来快速求其中的区间和 代码 public class SegmentTree { private int[] tree; private int n; public SegmentTree(int [] arr) { n = arr.len 阅读全文
posted @ 2024-12-28 21:22 HDU李少帅 阅读(24) 评论(2) 推荐(0)
摘要: # 简介 RT # 命令 ``` sudo npm cache clean -f sudo npm install -g n sudo n stable ``` # 参考链接 https://askubuntu.com/questions/426750/how-can-i-update-my-nod 阅读全文
posted @ 2023-07-06 21:34 HDU李少帅 阅读(35) 评论(1) 推荐(0)
摘要: RT https://leetcode.cn/problems/replace-employee-id-with-the-unique-identifier/solution/ select b.unique_id, a.name from Employees a left join Employe 阅读全文
posted @ 2023-04-22 09:21 HDU李少帅 阅读(102) 评论(0) 推荐(0)
摘要: leetcode 2619 遇到了 ?? 语法糖,简而言之 可选链功能 就是防止抛出异常 caught TypeError: Cannot read properties of undefined (reading 'salary') at <anonymous>:1:12 const user = 阅读全文
posted @ 2023-04-18 23:28 HDU李少帅 阅读(99) 评论(0) 推荐(0)
摘要: 简介 二分查找经常搞不清楚边界问题,直接记录模板 code public class Solution extends VersionControl { public int firstBadVersion(int n) { int low = 1; int high = n; int mid; w 阅读全文
posted @ 2022-11-13 20:21 HDU李少帅 阅读(23) 评论(0) 推荐(0)
摘要: 简介 最近 无聊看了一下 数值解法 已知 $\frac{dy}{dx} = y$ 我们知道其有一个解析解为 $y = e^x$ 同时我们知道 其初值 $y(0) = 1$, x 的范围为 $0<= x <= 1$ 我们需要求解其数值解,也就是$y$ 值在 $0<= x <= 1$ 的分布 我们猜想显 阅读全文
posted @ 2022-11-13 10:46 HDU李少帅 阅读(172) 评论(0) 推荐(0)
摘要: 名词解释 git clean -f 清除untract file HEAD 表示当前版本 HEAD^ 表示上一个版本 HEAD^^ 上上一个版本 HEAD~100 上100个版本 git reset --hard HEAD^ 丢弃当前版本返回上一个版本 --soft 是将修改放回本地退回到commi 阅读全文
posted @ 2022-11-13 10:27 HDU李少帅 阅读(30) 评论(0) 推荐(0)
摘要: 简介 简单题 code class Solution { public Integer count = 0; public void dfs(StringBuffer time, int [] aws, int rlt, int maxNumber){ if(rlt >= maxNumber) re 阅读全文
posted @ 2022-11-05 09:46 HDU李少帅 阅读(24) 评论(0) 推荐(0)
摘要: 简介 如何寻求一个数组中的出现次数最多的书 虽然最开始想到了这个方法但是不知道如何去表达,grep就利用了这个算法 class Solution { public int majorityElement(int[] nums) { Integer candidate = null; int coun 阅读全文
posted @ 2022-11-04 23:01 HDU李少帅 阅读(25) 评论(0) 推荐(0)
1 2 3 4 5 ··· 94 下一页