赶路要紧1
赶路要紧1
全部文章
分类
题解(1)
归档
标签
去牛客网
登录
/
注册
赶路要紧1的博客
超级飞侠--乐迪
全部文章
(共30篇)
题解 | Coincidence
#include<iostream> #include<cstdio> #include<string> using namespace std; const int MAXN =101; int dp[MAXN][MAXN]; char ans1[MAXN]; ...
2025-08-16
0
40
题解 | 合唱队形
//从左向右看,1至i为递增序列,从右向左看,从k至i为递增序列,两者之和减一为总序列长度, //分别计算位置i处的递增序列与递减序列,相加减一得到最大值 #include<iostream> #include<cstdio> using namespace std; con...
2025-08-15
0
30
题解 | 最大上升子序列和
#include<iostream> #include<cstdio> using namespace std; const int MAXN=1000; int dp[MAXN]; int arr[MAXN]; int Function(int n){ int an...
2025-08-15
0
23
题解 | 拦截导弹
#include<iostream> #include<cstdio> using namespace std; const int MAXN=25; int dp[MAXN]; int arr[MAXN]; int Function(int n){ int answ...
2025-08-15
0
26
题解 | 最大连续子序列
//添加一个大小为2的数组记录起点和终点 //终点易确定,只要序列值增加,更新终点 //记录每次起点,序列值增加更新最大起点(序列值增加未必有新起点) #include<iostream> #include<cstdio> #include<queue> #inc...
2025-08-15
0
24
题解 | 最大子矩阵
#include<iostream> #include<cstdio> #include<climits> using namespace std; const int MAXN =100; int martix[MAXN][MAXN]; int total[MA...
2025-08-15
0
28
题解 | 吃糖果
#include<iostream> #include<cstdio> using namespace std; const int MAXN=21; long long dp[MAXN]; int main(){ dp[0]=1; dp[1]=1; ...
2025-08-15
0
25
题解 | N阶楼梯上楼问题
//第n阶台阶由第n-1阶走一步和第n-2阶走一个2步 #include<iostream> #include<cstdio> using namespace std; const int MAXN =91; long long int dp[MAXN]; int main(...
2025-08-15
0
25
题解 | 最短路径问题
//常规dijkstra算法,先考虑最短路径排列,再建数组更新费用,更新费用时注意要在最短路径的前提下更新; //关于数组规模的问题,目的地可能为n,目的地又可能作为容器指标,所以容器数量至少为n+1; #include <cstdint> #include<iostream>...
2025-08-14
0
26
题解 | #畅通工程#
#include #include #include using namespace std; struct Edge{ int from; int to; int price; }; const int MAXN =100; Edge edge[MAXN*MAXN]; int father[MAX...
C++
最小生成树
2025-08-13
1
27
首页
上一页
1
2
3
下一页
末页