用心的布莱克刷牛客
用心的布莱克刷牛客
全部文章
分类
归档
标签
去牛客网
登录
/
注册
用心的布莱克刷牛客的博客
全部文章
(共32篇)
题解 | 最长公共子序列
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
47
题解 | 【模板】二分
#include <iostream> #include<vector> #include<algorithm> using namespace std; //方法一:直接使用内置的函数 //方法二:自己实现二分查找 vector<int>::iter...
2025-05-16
0
65
题解 | 二分查找-I
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums int整型vector * @param target int整型...
2025-05-16
0
51
题解 | 二分查找
class BinarySearch { public: int getPos(vector<int> A, int n, int val) { // write code here //algorithm中有二分查找法的lower_bound可以...
2025-05-16
0
69
题解 | 最长上升子序列(一)
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 给定数组的最长严格上升子序列的长度。 * @param arr int整型vector 给定的数组 * @ret...
2025-05-16
0
71
题解 | 删除字符串中出现次数最少的字符
#include <iostream> #include<array> using namespace std; //用一个长26的数组记录每个字母出现的次数,记录下非0的最小次数,最后遍历原字符串,输出其中出现次数不为最小次数的字符即可 int main() { ...
2025-05-14
0
58
题解 | 简单密码
#include <iostream> using namespace std; //字符串处理,遍历字符串中的字符依次判断即可 int main() { string pwd;//原密码 string npwd;//记录变化后的密码 getline(cin,p...
2025-05-14
0
73
题解 | 密码验证合格程序
#include <iostream> #include<regex> using namespace std; //难点就是判断字符串是否存在两个相同的独立子串,题目要求存在长度大于二,我们就只需要判断是否有长度为三的重复子串即可,因为更长的重复子串必然包括了长度为三的重复...
2025-05-14
0
71
题解 | 简单错误记录
#include <iostream> #include<vector> #include<sstream> using namespace std; int main() { //可以考虑使用map容器,将文件名和行号作为key值,报错次数作为valu...
2025-05-13
0
49
题解 | 坐标移动
#include <cctype> #include <iostream> using namespace std; #include<sstream> bool isnumber(string tmp)//判断是否为纯数字字符串 { for(char ...
2025-05-13
0
76
首页
上一页
1
2
3
4
下一页
末页