Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 07111e4

Browse files
authoredNov 14, 2021
Create Readme.md
1 parent 74af1c9 commit 07111e4

File tree

1 file changed

+8
-0
lines changed
  • Simulation/2069.Walking-Robot-Simulation-II

1 file changed

+8
-0
lines changed
 
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
### 2069.Walking-Robot-Simulation-II
2+
3+
本题就是一道模拟题。大致需要考虑这么几点。
4+
5+
1. 首先在判断在给定方向上,判断还能最多走几步碰到边界。如果走不到边界,那么就走指定的步数。
6+
2. 其次如果碰到边界还没有走完,那么就需要逆时针转向,然后根据1的方法再走剩余的步数。
7+
3. 如果已经在边缘绕着走的话,尝试用对```steps % total```来化简套圈的周期过程,其中total就是边缘一圈所需要的步数。通常,一个周期之后会回到原来的地方,方向不变。
8+
4. 特别注意的一个特例,如果起点本身是在“角落”,而需要走的步数又恰好是total,那么走完一圈之后回到起点时,并不需要变向。也就是说,方向还要倒退90度。

0 commit comments

Comments
 (0)
Please sign in to comment.