Telracs
Telracs
全部文章
分类
归档
标签
去牛客网
登录
/
注册
Telracs的博客
全部文章
(共3篇)
题解 | 最大子段和
选子数组的操作可用动态规划解决,动态规划的作用就是利用已处理的数据来推到之后的数据,对于子数组往里面加连续的数字我们可以想到定义dp[i]为遍历到i时的最大字段和,这样i+1可以判断是否要与之连接,简单的,如果dp[i-1]是正数那么我们就把他加进来,如果是负数就从当前作为左端点开始重新录入子数组,...
2026-03-04
1
44
题解 | 斐波那契字符串
//考点:斐波那契数列/动态规划dp #include <iostream> using namespace std; #define ll long long const int MOD = 1e9 + 7; const int MAX = 100005; ll N[100005]; ...
2026-03-04
1
43
题解 | 小红的整数配对
#include <cmath> #include <iostream> #include <vector> #include <algorithm> using namespace std; #define ll long long int ma...
2026-03-03
1
33