Create 1712.cpp

This commit is contained in:
Kirigaya Kazuto 2016-04-15 20:57:28 +08:00
parent 7fd5687c1d
commit 8d60759737

25
QUSTOJ/1712.cpp Normal file
View File

@ -0,0 +1,25 @@
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
int M[55][55];
int dp[55][55];
int main()
{
int m,n;
scanf("%d %d",&m,&n);
for(int i=1;i<=m;i++)
{
for(int j=1;j<=n;j++)
{
scanf("%d",&M[i][j]);
dp[i][j]=max(dp[i-1][j],dp[i][j-1])+M[i][j];
}
}
printf("%d\n",dp[m][n]);
return 0;
}