2775: 等差数列末项计算python题解 摘要:解题思路:等差数列通项公式注意事项:先算公差参考代码:a1, a2, n = map(int, input().split()) d = a2-a1 an = a1+(n-1)*d print(…… 题解列表 2024年03月06日 0 点赞 0 评论 418 浏览 评分:9.9
三角形最大路径和 摘要:解题思路:注意事项:参考代码:def maximumTotal(triangle): n = len(triangle) dp = [[0] * n for _ in range(n)] …… 题解列表 2024年03月06日 0 点赞 0 评论 233 浏览 评分:0.0
奖学金,结构体,冒泡排序,有注释 摘要:#include typedef struct date{ int number; int chin; int math; int eng; int tot; }Date;…… 题解列表 2024年03月06日 0 点赞 0 评论 269 浏览 评分:9.9
题目 1177: 三角形(动态规划) 摘要:解题思路:题目可能有问题,每一步只能由当前位置向左下或右下,而是每一步只能由当前位置向正下下或右下。注意事项:因此可以写出动态规划的函数:dp[i][j] = max(dp[i-1][j-1],dp[…… 题解列表 2024年03月06日 1 点赞 0 评论 307 浏览 评分:0.0
3061: 公共子序列-动态规划 摘要: #include #include #include using namespace std; int dp[205][205]; int m…… 题解列表 2024年03月05日 0 点赞 0 评论 217 浏览 评分:0.0
信息学奥赛一本通T1331-后缀表达式的值-Python 摘要:解题思路:定义一个Stack和对应的push和pop方法,然后将数字全部push进栈,然后根据操作符来eval计算,最后将结果pop出来。注意事项:参考代码:class Stack: def…… 题解列表 2024年03月05日 0 点赞 0 评论 335 浏览 评分:9.9
编写题解 2966: 最大质因子序列 摘要:解题思路:先找因数,在判断是不是质数。注意事项:参考代码:#include <stdio.h>#include <math.h>int yinshu(int c){ for (int i = 1; i…… 题解列表 2024年03月05日 0 点赞 0 评论 295 浏览 评分:9.9
记忆化搜索解法 摘要:``` import java.util.Arrays; import java.util.Scanner; public class Main { static int N;…… 题解列表 2024年03月05日 0 点赞 0 评论 267 浏览 评分:9.9
计负均正 使用C++语言编写 代码可能不是最简洁的 但是通俗易懂 容易理解 适合入门的 欢迎大家一起讨论 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <iomanip>using namespace std;int main() { const int n …… 题解列表 2024年03月05日 0 点赞 0 评论 276 浏览 评分:0.0