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 |
写个BFS另类思路数组ar[N][N] 中的ar[i][j] 表示以j结尾,并且经过i的最小长度 那么ar[i][j] 可以有下列方向走 i---->j---->i+j 即有ar[i][i+j] = ar[i][j]+1;ar[j][i+j] = ar[i][j]+1; i---->j---->2*j 即有ar[i][2*j] = ar[i][j]+1;ar[j][2*j] = ar[i][j]+1; Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator