用心的布莱克刷牛客
用心的布莱克刷牛客
全部文章
分类
归档
标签
去牛客网
登录
/
注册
用心的布莱克刷牛客的博客
全部文章
(共27篇)
题解 | 编辑距离(二)
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * min edit cost * @param str1 string字符串 the string ...
2025-05-20
1
20
题解 | 编辑距离为一
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param s string字符串 * @param t string字符串 ...
2025-05-20
0
28
题解 | 编辑距离(一)
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param str1 string字符串 * @param str2 string字符串...
2025-05-20
0
27
题解 | 计算字符串的编辑距离
#include <iostream> #include<vector> using namespace std; //动态规划,dp[i][j]代表将s的前i个字符转变为t的前j个字符所需要的最小编辑次数 //优化空间复杂度,只用到了左,上,左上的三个位置的记录,我们只用一...
2025-05-20
0
32
题解 | 最长公共子串
class LongestSubstring { public: int findLongest(string A, int n, string B, int m) { // write code here //动态规划,dp[i][j]代表以A[i-1]和B...
2025-05-19
0
33
题解 | 最长公共子序列
class LCS { public: int findLCS(string A, int n, string B, int m) { // write code here //动态规划,dp[i][j]代表A的前i个字符和B的前j个字符的LCS ...
2025-05-19
0
26
题解 | 【模板】二分
#include <iostream> #include<vector> #include<algorithm> using namespace std; //方法一:直接使用内置的函数 //方法二:自己实现二分查找 vector<int>::iter...
2025-05-16
0
27
题解 | 二分查找-I
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector * @param target int整型...
2025-05-16
0
26
题解 | 二分查找
class BinarySearch { public: int getPos(vector<int> A, int n, int val) { // write code here //algorithm中有二分查找法的lower_bound可以...
2025-05-16
0
29
题解 | 最长上升子序列(一)
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 给定数组的最长严格上升子序列的长度。 * @param arr int整型vector 给定的数组 * @ret...
2025-05-16
0
30
首页
上一页
1
2
3
下一页
末页