1 人解决,5 人已尝试。
2 份提交通过,共有 6 份提交。
9.9 EMB 奖励。
单点时限: 3.0 sec
内存限制: 256 MB
Herbert is a game in which you control a robot on an infinite two-dimensional grid. There
are three commands available to you:
s: Go one square forward in the current direction.
l: Turn ninety degrees counterclockwise.
r: Turn ninety degrees clockwise.
After playing this game for a while, you wonder how many squares you can reach within a
certain number of moves. Write a program to calculate the answer to this question.
On the first line an integer t (1 _ t _ 100): the number of test cases. Then for each test
case:
For each test case:
4 0 1 2 3
1 2 5 11
1 人解决,5 人已尝试。
2 份提交通过,共有 6 份提交。
9.9 EMB 奖励。