You are in the world of mathematics to solve the great "Monkey Banana Problem". It states that, a monkey enters into a diamond shaped two dimensional array and can jump in any of the adjacent cells down from its current position (see figure). Wh…
题目链接:http://acm.hust.edu.cn/vjudge/contest/121396#problem/F http://lightoj.com/volume_showproblem.php?problem=1004 密码:acm 分析:求从上往下路径的最大权值.   解题思路:数字三角形的变形,把菱形分为上下两部分求即可.dp[i][j]表示路径到第i行第j个点的最大权值和.     *: 上:dp[i][j]=max(dp[i-1][j], dp[i-1][j-1])+maps[…
题目大意: 给你一菱形的数字阵,问从最上面走到最下面所能获得的最大值是多少? #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #include<queue> #include<vector> #include<map> using namespace std; typedef lo…
题目链接:http://lightoj.com/login_main.php?url=volume_showproblem.php?problem=1004 题意:数塔的变形,上面一个下面一个,看清楚了直接做就行了. 上半部分转移方程dp(i,j)=max(dp(i-1,j),dp(i-1,j+1))+G(i,j) 下半部分转移方程dp(i,j)=max(dp(i-1,j-1),dp(i-1,j))+G(i,j) #include <algorithm> #include <iostre…
                                                                                                 1004 - Monkey Banana Problem    PDF (English) Statistics Forum Time Limit: 2 second(s) Memory Limit: 32 MB link You are in the world of mathematics to so…
Monkey Banana Problem LightOJ - 1004 错误记录: 1.数组开小2.每组数据数组没有清空 #include<cstdio> #include<cstring> #include<algorithm> using namespace std; int T,TT,n; ][],ans[][]; int main() { int i,j; scanf("%d",&T); ;TT<=T;TT++) { mems…
F - Monkey Banana Problem Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Description You are in the world of mathematics to solve the great "Monkey Banana Problem". It states that, a monkey enters into a diamond s…
题目链接:http://acm.hust.edu.cn/vjudge/contest/126708#problem/F 题意:求至上而下一条路径的所经过的值得和最大值,这题比赛时就出了 但当时看不懂题目一直没写,这就和数字三角形差不多,只是加上了他的下部分,分上下两种情况就行. AC代码: #include<cstdio> #include <cstring> #include <iostream> using namespace std; int i,j,n; ][]…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1004 #include <cstdio> #include <cstring> #include <iostream> #include <cmath> #include <algorithm> #include <queue> #include <vector> using namespace std; ;…
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1036 题解:设dp[i][j]表示处理到(i,j)点时的最大值然后转移显然是 dp[i][j] = max(dp[i - 1][j] + asum[i][j] , dp[i][j - 1] + bsum[i][j]); 要么取一整列要么取一整行. #include <iostream> #include <cstring> #include <cstdio…