勤劳的小蜗牛许愿简历通过
勤劳的小蜗牛许愿简历通过
全部文章
分类
归档
标签
去牛客网
登录
/
注册
勤劳的小蜗牛许愿简历通过的博客
全部文章
(共83篇)
题解 | #三角形最小路径和#
自底向上逐行计算最小路径和 更新当前节点值为底部或底部旁边元素的加和 class Solution { public: int dp[200][200]{0}; int minTrace(vector<vector<int> >& triangle)...
2024-11-05
0
38
题解 | #跳台阶#
递归 int jumpFloor(int number) { if(number <= 1) return 1; return jumpFloor(number - 1) + jumpFloor(number - 2); } 记忆化搜索 int f[50]{0}; int j...
2024-11-05
0
59
题解 | #相差不超过k的最多数#
双指针,i = 0, j = 1当j指向的元素与i指向的元素差值小于等于k时,j不断地向前移动直到指向一个差值大于k的值 i向前移动一位假设这个时候差值又变成小于等于k的情况,j继续向前移动 不断更新max 直到遍历完整个数组最终找到整个数组最长的相减不超过k的数列 #include <alg...
2024-11-04
0
65
题解 | #【模板】哈夫曼编码#
使用最小堆来解决,构建哈夫曼树从优先队列中取出两个最小的频率 合并成一个新的结点将新的节点重新插入堆中重复n - 1次 直到堆中只剩下1个节点为止 #include<iostream> #include<queue> #include<vector> using ...
2024-11-04
0
86
题解 | #活动安排#
#include <iostream> #include <utility> #include<vector> #include<algorithm> using namespace std; int main() { int n; ...
2024-11-04
0
50
题解 | #排序#
#include <fstream> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * 将给定数组排序 * @param arr int整型v...
2024-11-01
0
46
题解 | #快速乘#
#include <iostream> #include<algorithm> using namespace std; typedef long long LL; int qmul(int a, int b, int p){ LL res = 0; whil...
2024-11-01
0
56
题解 | #快速幂#
#include <iostream> #include<algorithm> using namespace std; typedef long long LL; int qmi(int a, int b, int p){ int res = 1; wh...
2024-11-01
0
31
题解 | #汉诺塔问题#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param n int整型 * @return string字符串vector ...
2024-11-01
0
71
题解 | #汉诺塔问题#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param n int整型 * @return string字符串vector ...
2024-10-31
0
35
首页
上一页
1
2
3
4
5
6
7
8
9
下一页
末页