Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

写个BFS另类思路

Posted by CSUST_14 at 2013-04-19 09:28:06 on Problem 2248
数组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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator