| ||||||||||
| 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 | |||||||||
为什么是Runtime Error??问一下哪里出错了??#include<iostream.h>
void main()
{
char str[5000];
int Store[5000][5000] = {0};
int i,j,N;
cin>>N;
cin>>str;
for( i = 2; i <= N; i++ )
{
for( j = 0; j + i <= N+1; j++ )
{
if( str[j] == str[j+i-1])
Store[i][j] = Store[i-2][j+1];
else
{
if( Store[i-1][j] > Store[i-1][j+1] )
Store[i][j] = Store[i-1][j+1]+1;
else
Store[i][j] = Store[i-1][j]+1;
}
}
}
cout<<Store[N][0]<<endl;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator