| ||||||||||
| 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 | |||||||||
不解 RE是编译错误码?我可以100%肯定我的程序没RE怎么回事?#include<iostream>
using namespace std;
int inputsz[100][100];
int R,C;
int resulesz[100][100];
int Maxnumber(int x,int y)
{
if (resulesz[x][y]>0)
{
return resulesz[x][y];
}
int Max=0;
if (x-1>=1&&inputsz[x][y]>inputsz[x-1][y])
{
if (Maxnumber(x-1,y)>Max)
{
Max=Maxnumber(x-1,y);
}
}
if (x+1<=R&&inputsz[x][y]>inputsz[x+1][y])
{
if (Maxnumber(x+1,y)>Max)
{
Max=Maxnumber(x+1,y);
}
}
if (y-1>=1&&inputsz[x][y]>inputsz[x][y-1])
{
if (Maxnumber(x,y-1)>Max)
{
Max=Maxnumber(x,y-1);
}
}
if (y+1<=C&&inputsz[x][y]>inputsz[x][y+1])
{
if (Maxnumber(x,y+1)>Max)
{
Max=Maxnumber(x,y+1);
}
}
resulesz[x][y]=Max+1;
return Max+1;
}
int main()
{
cin>>R>>C ;
for(int i=0;i<100;i++)
{
for (int j=0;j<100;j++)
{
inputsz[i][j]=0;
resulesz[i][j]=0;
}
}
for (int i=1;i<=R;i++)
{
for (int j=1;j<=C;j++)
{
cin>>inputsz[i][j];
}
}
int maxbz=0;
for (int i=1;i<=R;i++)
{
for (int j=1;j<=C;j++)
{
if (Maxnumber(i,j)>maxbz)
{
maxbz=Maxnumber(i,j);
}
}
}
cout<<maxbz;
return 0;
}
这个会RE impossible啊!....
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator