| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
哪位高手帮我看看啊#include<iostream>
using namespace std;
int max1(int x,int y)
{
int max;
if(x>1)
max=max1(x-1,y-1);
else
max=max3(1,N-M+1);
for(i=x;i<y;i++)
if(max<max1(x,i))
max=max1(x,i);
return (max+m[x][y]);
}
int max2(int r,int s)
{
int max;
max=max1(r,s);
for(int j=s-1;j>>r;j--)
if(max<max1(r,j))
max=max1(r,j);
return max;
}
int max3(int e,int f)
{
int max;
max=m[e][M-N+1];
for(i=1;i<M-N+1;i++)
if(m[e][i]>max)
max=m[e][i];
return max;
}
int main()
{int result;
int M,N;
int m[4][6];
cin>>M>>N>>endl;
for(int i=1;i<M;i++)
{
for(int j=1;j<N;j++)
cin>>m[i][j];
cin >>endl;
}
result=max2(M,N);
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator