COJ:Traversing Grid 遍历格子的问题 题解
2017-02-05
13
COJ:Traversing Grid 遍历格子的问题 题解2015-02-25很有趣的题目:在一个方格上从最左上角面向右出发,每次行走一个,碰到边右走,或者碰到已经访问过的格子右转,问最后遍历所有格子的时候你是面向那个方向?For example: Consider the case with N = 3, M = 3. The path followed will be (0,0) -> (0,1) -> (0,2) -> (1,2)...