| ||||||||||
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 |
这么大的数组当然得是全局的In Reply To:为什么是Runtime Error??问一下哪里出错了?? Posted by:860830 at 2005-12-03 02:30:04 > #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