daydayup牛
daydayup牛
全部文章
题解
归档
标签
去牛客网
登录
/
注册
daydayup牛的博客
全部文章
/ 题解
(共96篇)
题解 | #数组分组#
动态规划,想办法转化力扣的416题,分割相等其实就是找一个集合使它们中有数的组合可以加起来等于某个数,而这个数在416题是和的一半,我这里就是x/2 #include <algorithm> #include <vector> using namespace std; b...
C++
动态规划
2022-03-25
0
353
题解 | #公共子串计算#
暴力搜索法事件复杂度O(n^3)空间复杂度o(1) #include <algorithm> #include <vector> using namespace std; int main() { string str1,str2; while...
C++
字符串
2022-03-22
0
310
题解 | #公共子串计算#
用压缩数组节省空间,只保留一行,利用动态规划的无后效性。空间复杂度O(N) #include <algorithm> #include <vector> using namespace std; int main() { string str1,str2; ...
C++
动态规划
2022-03-22
2
459
题解 | #放苹果#
####这道题要注意边界条件,苹果和盘子那里的转移方程不太好理解,我尝试着解释一下,详情看代码 #include <algorithm> #include <vector> using namespace std; int main() { int m,n; ...
C++
动态规划
2022-03-22
7
401
题解 | #计算字符串的编辑距离#
这是一维的压缩情况,该篇仅在你搞懂二维的动态规划方可解锁,详见注释 #include <algorithm> #include <vector> using namespace std; int main() { string str1,str2; whi...
C++
动态规划
2022-03-21
0
295
题解 | #名字的漂亮度#
统计频率最高的,然后从26开始一直×到没 #include <algorithm> #include <map> #include <vector> using namespace std; int main() { int n; while(...
C++
字符串
2022-03-21
0
299
题解 | #迷宫问题#
#include <algorithm> #include <vector> using namespace std; void dfs(vector<vector<int>> &matrix,vector<pair<int,i...
C++
2022-03-21
0
301
题解 | #在字符串中找出连续最长的数字串#
#include <algorithm> #include <vector> using namespace std; int main() { string str; while(getline(cin,str)){ string tem...
C++
字符串
2022-03-21
0
357
题解 | #求最小公倍数#
#include <algorithm> using namespace std; int main() { int x1,x2; while(cin>>x1>>x2){ int out; int mi,mx; ...
C++
数学
2022-03-21
0
277
题解 | #求解立方根#
二分查找法 #include <algorithm> #include <cmath> #include <iomanip> using namespace std; int main() { double x; while(cin>&g...
C++
数学
二分查找
2022-03-21
0
331
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页