欢迎访问https://blog.csdn.net/lxt_Lucia~~
宇宙第一小仙女\(^o^)/~萌量爆表求带飞=≡Σ((( つ^o^)つ~ dalao们点个关注呗~
--------------------------------我只是一条可爱哒分界线-------------------------------
一、问题:
Description
DreamGrid creates a programmable robot to explore an infinite two-dimension plane. The robot has a basic instruction sequence a1,a2,...,an and a "repeating parameter" k, which together form the full instruction sequence s1,s2,...sn,sn+1,...snk, and control the robot.
There are 4 types of valid instructions in total, which are 'U' (up), 'D' (down), 'L' (left) and 'R' (right). Assuming that the robot is currently at , the instructions control the robot in the way below:
- U: Moves the robot to ( x, y+1 ) .
- D: Moves the robot to ( x, y-1 ).
- L: Moves the robot to ( x-1, y ).
- R: Move