计负均正 使用C++语言编写 代码可能不是最简洁的 但是通俗易懂 容易理解 适合入门的 欢迎大家一起讨论 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <iomanip>using namespace std;int main() { const int n …… 题解列表 2024年03月05日 0 点赞 0 评论 224 浏览 评分:0.0
3061: 公共子序列-动态规划 摘要: #include #include #include using namespace std; int dp[205][205]; int m…… 题解列表 2024年03月05日 0 点赞 0 评论 170 浏览 评分:0.0
题目 1177: 三角形(动态规划) 摘要:解题思路:题目可能有问题,每一步只能由当前位置向左下或右下,而是每一步只能由当前位置向正下下或右下。注意事项:因此可以写出动态规划的函数:dp[i][j] = max(dp[i-1][j-1],dp[…… 题解列表 2024年03月06日 0 点赞 0 评论 268 浏览 评分:0.0
三角形最大路径和 摘要:解题思路:注意事项:参考代码:def maximumTotal(triangle): n = len(triangle) dp = [[0] * n for _ in range(n)] …… 题解列表 2024年03月06日 0 点赞 0 评论 190 浏览 评分:0.0
最长不下降子序列的长度 摘要:解题思路:注意事项:参考代码:def lengthOfLIS(nums): if len(nums) <= 1: return len(nums) dp =…… 题解列表 2024年03月06日 0 点赞 0 评论 212 浏览 评分:0.0
编写题解 2788: 晶晶赴约会python 摘要:解题思路:注意事项:参考代码:n = int(input()) if n <= 5: if n % 2 == 0: print("YES") else:   题解列表 2024年03月06日 0 点赞 0 评论 322 浏览 评分:0.0
最长公共子序列lcs 摘要:解题思路:注意事项:参考代码:def longestCommonSubsequence(text1, text2): # 创建一个二维数组 dp,用于存储最长公共子序列的长度 …… 题解列表 2024年03月06日 0 点赞 0 评论 185 浏览 评分:0.0
编写题解 2789: 骑车与走路python 摘要:参考代码:n = int(input()) if n/3+50 == n/1.2: print("All") if n/3+50 > n/1.2: print("Walk") …… 题解列表 2024年03月06日 0 点赞 0 评论 392 浏览 评分:0.0
温度转换题目 摘要:解题思路:注意事项:注意数据类型,f,c是双精度温度,输出为长浮点数型。参考代码:#include<stdio.h>int main(){ double f,c; scanf("%lf",…… 题解列表 2024年03月06日 0 点赞 0 评论 289 浏览 评分:0.0