P1044 (C++代码) 摘要:解题思路:动态规划注意事项:参考代码:#include<iostream> #include<algorithm> using namespace std; int a[100][100]; …… 题解列表 2017年11月12日 0 点赞 0 评论 2299 浏览 评分:0.0
P1044 (C++代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h> int main(){ int n; scanf("%d",&n); int m[n][n]; …… 题解列表 2018年02月23日 9 点赞 0 评论 1927 浏览 评分:0.0
数字三角形模型 #数字三角形模型原题##动态规划1.二维状态表示,f[i][j]表示走到(i,j)(包括)时的最大路径权值。2.状态转移可由f[i-1][j-1]和f[i][j-1]得到。######代码```#include#include#includeusingnamespacestd;constintN=30 题解列表 2023年02月08日 0 点赞 0 评论 682 浏览 评分:0.0
数字三角形(DP) 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>usingnamespacestd;//定义常量N,用于限制三角…… 题解列表 2025年10月26日 0 点赞 0 评论 362 浏览 评分:0.0
P1044 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int a[26][26];int s[26];int main(){ int i,j,n; scanf("%d",&n); for(i…… 题解列表 2018年02月13日 0 点赞 0 评论 1789 浏览 评分:6.0
(动态规划) 数字三角形 (加油淦!!!) 解题思路:很容易想到的是递归,遍历所有的路径,然后找出最大值,但是,可惜的是超时从倒数第二行倒着看,会发现一个规律举例:15689107432先看倒数第二行8=max(7,4)+89=max(4,3)+910=max(3,2)+10接着向上一行6=max(9, 题解列表 2021年10月12日 0 点赞 0 评论 718 浏览 评分:8.7
P1044 (C++代码) 摘要:解题思路:数塔问题,简单的动态规划。参考代码:#include <bits/stdc++.h> using namespace std; const int N=26; int main()…… 题解列表 2019年02月18日 1 点赞 0 评论 1383 浏览 评分:9.9
深度优先搜索 题解 1311: P1044 数字三角求最值 摘要:解题思路: 直接把所有路径全跑一遍,把每条路径的最终值与max进行比较,谁大谁是新max。 好好干深度优先、广度优先遍历,好几个题目都是!图的这两个遍历,递归、非递归都给…… 题解列表 2021年10月12日 0 点赞 0 评论 1094 浏览 评分:9.9
数字三角形 摘要:解题思路:DFS注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int n,a[30][30],ans = -1;void dfs(int …… 题解列表 2022年08月13日 0 点赞 0 评论 686 浏览 评分:9.9
题解: 数字三角形【Python】 摘要:解题思路:动态规划参考代码:N = int(input()) dp = [] for i in range(N): row = list(map(int, input().split()…… 题解列表 2022年12月03日 0 点赞 0 评论 703 浏览 评分:9.9