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 |
构造完了next数组后,怎么输出的呢?我的是: for(i=next[0];i;i=next[i]) cout<<in[i]<<' '; cout<<in[0]<<endl; //我认为最后i一定会变为0,但是wa 如果改为: for(i=p=0;i<N;i++) { cout<<in[next[p]]<<" "; p=next[p]; } cout<<endl; 就没有问题,为什么? Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator