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 |
无聊的模拟题,用3维数组还记录转移方向定义发如下4种方向的值 B -> 2 bbbbb bbbbb B--->3 aaaaA ->0 Aaaaa ->1 用此来根据头得到下一步的方向 static int dir[4][3] = {{0, 1, 1}, {0, -1, 0},{1, 0, 2},{-1, 0, 3}}; 用此来移动 第一维是自己的当前方向 接下来的[3][3]是自己可以选择的移动方向及移动之后的方向 static int next[4][3][3] = { {{0, 1, 0}, {1, 0, 3}, {-1, 0, 2}}, {{0, -1, 1}, {-1, 0, 2}, {1, 0, 3}}, {{-1, 0, 2}, {0, 1, 0}, {0, -1, 1}}, {{1, 0, 3}, {0, -1, 1}, {0, 1, 0}} }; Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator