mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1712.cpp
This commit is contained in:
parent
7fd5687c1d
commit
8d60759737
25
QUSTOJ/1712.cpp
Normal file
25
QUSTOJ/1712.cpp
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user