QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#515135#2265. Short CodingPlentyOfPenalty#AC ✓2ms3852kbC++205.3kb2024-08-11 15:28:372024-08-11 15:28:38

Judging History

你现在查看的是最新测评结果

  • [2024-08-11 15:28:38]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3852kb
  • [2024-08-11 15:28:37]
  • 提交

answer

#include <bits/stdc++.h>
#define sz(x) ((int)(x).size())
#define all(x) begin(x), end(x)
#define rep(i, l, r) for (int i = (l), i##end = (r); i <= i##end; ++i)
#define per(i, l, r) for (int i = (l), i##end = (r); i >= i##end; --i)
#ifdef memset0
#define log(...) fprintf(stderr, __VA_ARGS__)
#else
#define log(...) (void(0))
#define endl '\n'
#endif
using namespace std;
using ll = long long;
using lf = long double;
using lll = __int128;
using ull = unsigned long long;

const int N = 11, M = N * N * 4 + 9;
const int nxt[4][2] = {
    {1, 0},
    {0, -1},
    {-1, 0},
    {0, 1},
};
int n, m, tot, s, e[4], a[N][N], id[N][N][4], lt[M], rt[M], fr[M], ep[M];
string ord(int u) {
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int k = 0; k < 4; k++)
        if (id[i][j][k] == u) {
          return to_string(i) + ", " + to_string(j) + ", " + to_string(k);
        }
  return "???";
}

const int lim_commands = 20;
const int lim_controls = 5;
enum COMMAND { LT, RT, FR, GOTO, IF };
int len, cnt;
struct command {
  COMMAND o;
  int j;
} c[lim_commands];
ostream &operator<<(ostream &out, const command &rhs) {
  switch (rhs.o) {
  case LT:
    out << "LEFT";
    break;
  case RT:
    out << "RIGHT";
    break;
  case FR:
    out << "FORWARD";
    break;
  case GOTO:
    out << "GOTO";
    break;
  case IF:
    out << "IF-OPEN";
    break;
  }
  if (rhs.o == GOTO || rhs.o == IF) {
    out << ' ' << (rhs.j + 1);
  }
  return out;
}

int tim, vis[lim_commands][M];
bool check() {
  // log("=== check ===\n");
  // for (int i = 0; i < len; i++) cerr << c[i] << endl;
  int pc = 0, u = s;
  ++tim;
  vis[pc][u] = tim;
  while (true) {
    // log("> %d %d(%s) : ", pc, u, ord(u).c_str());
    // cerr << c[pc] << endl;
    if (c[pc].o == LT) {
      pc = (pc + 1) % len;
      u = lt[u];
    } else if (c[pc].o == RT) {
      pc = (pc + 1) % len;
      u = rt[u];
    } else if (c[pc].o == FR) {
      pc = (pc + 1) % len;
      u = fr[u];
    } else if (c[pc].o == IF) {
      if (ep[u]) {
        pc = c[pc].j;
      } else {
        pc = (pc + 1) % len;
      }
    } else if (c[pc].o == GOTO) {
      pc = c[pc].j;
    }
    if (u == e[0] || u == e[1] || u == e[2] || u == e[3]) return true;
    if (vis[pc][u] == tim) return false;
    vis[pc][u] = tim;
  }
  return false;
}

void dfs(int u) {
  if (u == len) {
    if (check()) {
      cout << len << endl;
      for (int i = 0; i < len; i++) {
        cout << c[i] << endl;
      }
      exit(0);
    }
    return;
  }
  c[u].o = LT, dfs(u + 1);
  c[u].o = RT, dfs(u + 1);
  c[u].o = FR, dfs(u + 1);
  if (cnt <= lim_controls) {
    c[u].o = IF, ++cnt;
    for (c[u].j = 0; c[u].j < len; c[u].j++) {
      dfs(u + 1);
    }
    --cnt;
    c[u].o = GOTO, ++cnt;
    for (c[u].j = 0; c[u].j < len; c[u].j++) {
      dfs(u + 1);
    }
    --cnt;
  }
}

int main() {
#ifdef memset0
  freopen("C.in", "r", stdin);
#endif
  cin.tie(0)->sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    string buf;
    cin >> buf;
    for (int j = 0; j < m; j++) {
      if (buf[j] == '#') {
        a[i][j] = 1;
      } else {
        for (int k = 0; k < 4; k++) id[i][j][k] = ++tot;
        if (buf[j] == 'S') {
          s = id[i][j][0];
        } else if (buf[j] == 'G') {
          for (int k = 0; k < 4; k++) e[k] = id[i][j][k];
        }
      }
    }
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      for (int k = 0; k < 4; k++)
        if (id[i][j][k]) {
          rt[id[i][j][k]] = id[i][j][(k + 1) % 4];
          // log("rt[%d] = %d\n", id[i][j][k], rt[id[i][j][k]]);
          lt[id[i][j][k]] = id[i][j][(k + 3) % 4];
          int vi = i + nxt[k][0];
          int vj = j + nxt[k][1];
          if (vi >= 0 && vj >= 0 && vi < n && vj < m && a[vi][vj] == 0) {
            ep[id[i][j][k]] = true;
            fr[id[i][j][k]] = id[vi][vj][k];
          } else {
            ep[id[i][j][k]] = false;
            fr[id[i][j][k]] = id[i][j][k];
          }
        }

  // len = 4;
  // c[0].o = LT;
  // c[1].o = FR;
  // c[2].o = RT;
  // c[3].o = FR;
  // cerr << check() << endl;
  // return 0;

  for (len = 1; len < lim_commands; len++) {
    log(">>> len = %d\n", len);
    dfs(0);
  }
}

/*
> 0 5(0, 3, 0) : LEFT
> 1 8(0, 3, 3) : FORWARD
> 2 12(0, 4, 3) : RIGHT
> 3 9(0, 4, 0) : FORWARD
> 0 37(1, 4, 0) : LEFT
> 1 40(1, 4, 3) : FORWARD
> 2 44(1, 5, 3) : RIGHT
> 3 41(1, 5, 0) : FORWARD
> 0 73(2, 5, 0) : LEFT
> 1 76(2, 5, 3) : FORWARD
> 2 76(2, 5, 3) : RIGHT
> 3 73(2, 5, 0) : FORWARD
> 0 97(3, 5, 0) : LEFT
> 1 100(3, 5, 3) : FORWARD
> 2 104(3, 6, 3) : RIGHT
> 3 101(3, 6, 0) : FORWARD
> 0 133(4, 6, 0) : LEFT
> 1 136(4, 6, 3) : FORWARD
> 2 140(4, 7, 3) : RIGHT
> 3 137(4, 7, 0) : FORWARD
> 0 177(5, 7, 0) : LEFT
> 1 180(5, 7, 3) : FORWARD
> 2 184(5, 8, 3) : RIGHT
> 3 181(5, 8, 0) : FORWARD
> 0 181(5, 8, 0) : LEFT
> 1 184(5, 8, 3) : FORWARD
> 2 188(5, 9, 3) : RIGHT
> 3 185(5, 9, 0) : FORWARD
> 0 209(6, 9, 0) : LEFT
> 1 212(6, 9, 3) : FORWARD
> 2 212(6, 9, 3) : RIGHT
> 3 209(6, 9, 0) : FORWARD
> 0 237(7, 9, 0) : LEFT
> 1 240(7, 9, 3) : FORWARD
> 2 240(7, 9, 3) : RIGHT
> 3 237(7, 9, 0) : FORWARD
> 0 265(8, 9, 0) : LEFT
> 1 268(8, 9, 3) : FORWARD
> 2 268(8, 9, 3) : RIGHT
> 3 265(8, 9, 0) : FORWARD
1
*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3616kb

input:

4 2
S#
.#
.#
G.

output:

1
FORWARD

result:

ok correct answer!

Test #2:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

3 6
##S..#
#..##.
.G..#.

output:

2
FORWARD
RIGHT

result:

ok correct answer!

Test #3:

score: 0
Accepted
time: 0ms
memory: 3800kb

input:

3 7
....S##
.#.#...
##.#.G#

output:

2
FORWARD
LEFT

result:

ok correct answer!

Test #4:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

4 8
...S.#.#
##..#.#.
###...#.
#.#.#G.#

output:

3
FORWARD
FORWARD
LEFT

result:

ok correct answer!

Test #5:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

3 5
.S#..
.....
..#G.

output:

3
FORWARD
LEFT
FORWARD

result:

ok correct answer!

Test #6:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

10 10
.....S#...
...#......
....##....
.#.....#..
....#.....
..#.......
...#......
..........
.#...#....
G.#..#...#

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #7:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

7 9
.##S.#..#
.........
.........
...#...##
###..####
........#
.....##G#

output:

3
RIGHT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #8:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

3 9
..#.#.#S#
#...#...#
.G....#.#

output:

3
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #9:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

4 5
#S...
..#..
.#..#
.#.G#

output:

3
RIGHT
FORWARD
FORWARD

result:

ok correct answer!

Test #10:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

6 8
..S..#.#
...#...#
....#..#
#.#.##..
.......#
.#..#G.#

output:

4
FORWARD
LEFT
FORWARD
RIGHT

result:

ok correct answer!

Test #11:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

9 10
S.........
.#..#....#
........#.
..........
.....#.#..
.#...#....
#..#.##.#.
..#..#...#
..#.#....G

output:

4
LEFT
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #12:

score: 0
Accepted
time: 1ms
memory: 3772kb

input:

10 4
#.S.
.#.#
##.#
##..
.#..
#...
#.##
..#.
.#..
G.##

output:

4
FORWARD
RIGHT
FORWARD
LEFT

result:

ok correct answer!

Test #13:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

9 9
#..#...S#
.#...##.#
.....##..
..#..#...
..#..#..#
.#..#.#.#
.###.....
..#.#.##.
G#....#.#

output:

4
RIGHT
FORWARD
LEFT
FORWARD

result:

ok correct answer!

Test #14:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

7 3
.S#
#..
..#
...
..#
.#.
.G.

output:

4
FORWARD
FORWARD
FORWARD
LEFT

result:

ok correct answer!

Test #15:

score: 0
Accepted
time: 1ms
memory: 3508kb

input:

6 6
..#S..
#.#.#.
.....#
#.#...
..#...
..G##.

output:

4
FORWARD
FORWARD
LEFT
FORWARD

result:

ok correct answer!

Test #16:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

6 8
....#S..
......#.
..##..#.
###.#.##
..#...#.
##.G#..#

output:

4
FORWARD
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #17:

score: 0
Accepted
time: 1ms
memory: 3768kb

input:

10 8
#..S.###
.#....##
.#......
....#.#.
#...#..#
........
....#.##
...#.###
.#.#...#
.#...G.#

output:

4
FORWARD
LEFT
FORWARD
IF-OPEN 3

result:

ok correct answer!

Test #18:

score: 0
Accepted
time: 1ms
memory: 3572kb

input:

7 6
...##S
#.....
....#.
...#.#
....#.
#.....
.....G

output:

4
FORWARD
RIGHT
FORWARD
IF-OPEN 3

result:

ok correct answer!

Test #19:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

4 8
.##..S..
#.###..#
.#...#..
...#G...

output:

4
RIGHT
FORWARD
FORWARD
FORWARD

result:

ok correct answer!

Test #20:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

3 10
##.......S
####.####.
...#..G##.

output:

4
RIGHT
FORWARD
LEFT
IF-OPEN 2

result:

ok correct answer!

Test #21:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

2 7
.#S.###
.#.G..#

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #22:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

2 7
.S#.#.#
G#.##.#

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #23:

score: 0
Accepted
time: 0ms
memory: 3496kb

input:

2 4
...S
##G#

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #24:

score: 0
Accepted
time: 0ms
memory: 3844kb

input:

2 7
S......
.G.....

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #25:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

2 3
#S#
..G

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #26:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

2 4
#.S#
#G##

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #27:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

3 6
.#S###
#....#
#G.#..

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #28:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

2 4
S.#.
#G##

output:

2
RIGHT
FORWARD

result:

ok correct answer!

Test #29:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

2 5
##..S
...G.

output:

2
LEFT
FORWARD

result:

ok correct answer!

Test #30:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

2 9
#S###....
G..##..##

output:

2
RIGHT
FORWARD

result:

ok correct answer!

Test #31:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

6 10
....S...##
.#...#....
..........
.#.#...#..
...#.##...
.G#...#...

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #32:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

3 3
S..
##.
##G

output:

3
RIGHT
FORWARD
FORWARD

result:

ok correct answer!

Test #33:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

5 5
..S..
.##..
.####
..#..
G.#.#

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #34:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

4 6
S#....
....#.
#.....
#...G.

output:

3
LEFT
FORWARD
FORWARD

result:

ok correct answer!

Test #35:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

3 6
.#..S#
..#..#
.##G.#

output:

3
RIGHT
FORWARD
FORWARD

result:

ok correct answer!

Test #36:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

4 3
..S
.#.
..#
G..

output:

3
LEFT
FORWARD
FORWARD

result:

ok correct answer!

Test #37:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

5 3
S..
##.
...
...
.G.

output:

3
RIGHT
FORWARD
FORWARD

result:

ok correct answer!

Test #38:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

8 2
.S
..
..
..
..
..
.#
G.

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #39:

score: 0
Accepted
time: 0ms
memory: 3508kb

input:

3 7
...#..S
#.#....
....G..

output:

3
LEFT
FORWARD
FORWARD

result:

ok correct answer!

Test #40:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

3 9
#......S.
...#.#...
.G.#.#...

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #41:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

2 9
.##..S...
##..##G.#

output:

4
LEFT
LEFT
FORWARD
LEFT

result:

ok correct answer!

Test #42:

score: 0
Accepted
time: 0ms
memory: 3504kb

input:

4 6
S..#.#
..#...
......
..#G#.

output:

4
LEFT
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #43:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

4 9
#..##S..#
##..#...#
#.......#
####.#G##

output:

4
LEFT
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #44:

score: 0
Accepted
time: 1ms
memory: 3548kb

input:

3 8
....S...
.....#..
..#G#...

output:

4
FORWARD
RIGHT
FORWARD
LEFT

result:

ok correct answer!

Test #45:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

4 9
.#.S#####
..#.###..
.#....#.#
.####.G.#

output:

4
LEFT
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #46:

score: 0
Accepted
time: 0ms
memory: 3804kb

input:

4 3
..S
...
...
#G#

output:

4
LEFT
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #47:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

2 7
#...S..
..#G##.

output:

4
LEFT
LEFT
FORWARD
RIGHT

result:

ok correct answer!

Test #48:

score: 0
Accepted
time: 0ms
memory: 3636kb

input:

5 6
...S..
...#..
...#..
...#.#
#G..#.

output:

4
RIGHT
FORWARD
IF-OPEN 1
RIGHT

result:

ok correct answer!

Test #49:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

4 8
.#...#.S
..###...
........
....G..#

output:

4
LEFT
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #50:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

3 4
#S..
##..
.#G#

output:

4
LEFT
FORWARD
RIGHT
IF-OPEN 2

result:

ok correct answer!

Test #51:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

4 6
#.S.#.
#..#..
..#...
..G##.

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #52:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

4 5
#..S.
#.#..
..#..
G#..#

output:

4
RIGHT
FORWARD
LEFT
FORWARD

result:

ok correct answer!

Test #53:

score: 0
Accepted
time: 1ms
memory: 3556kb

input:

5 5
#.#S#
#...#
##.##
##..#
.##.G

output:

5
LEFT
LEFT
FORWARD
LEFT
IF-OPEN 3

result:

ok correct answer!

Test #54:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

5 6
##S..#
...#..
...#.#
...#..
..#G.#

output:

3
RIGHT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #55:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

6 4
...S
..#.
....
....
....
G...

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #56:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

5 6
....S.
......
......
....#.
....G.

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #57:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

4 5
S###.
.####
.####
..G##

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #58:

score: 0
Accepted
time: 0ms
memory: 3568kb

input:

6 5
...S.
...#.
.#...
..##.
.##..
.G#..

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #59:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

5 4
..S.
#...
.#..
..#.
G...

output:

3
RIGHT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #60:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

5 5
..#S#
.#..#
....#
..#.#
###G.

output:

1
FORWARD

result:

ok correct answer!

Test #61:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

10 10
#...S..#..
..#...#...
..#.#.#...
...#....##
##.....#.#
.....#.##.
.....#...#
...###....
..#.#.....
.#.#....#G

output:

4
LEFT
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #62:

score: 0
Accepted
time: 0ms
memory: 3768kb

input:

10 10
.#..S#...#
.....#....
...#...#.#
.##..#....
#....###.#
........##
...#..#...
##.#....##
...#....#.
#.#G...#.#

output:

3
RIGHT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #63:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

10 10
.......S..
..........
..........
..........
........#.
..........
..........
..........
..........
........G.

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #64:

score: 0
Accepted
time: 2ms
memory: 3776kb

input:

10 10
....#S.#.#
.#....#...
.....#..#.
....#..#..
.#.....#.#
.......###
#....#.#..
..........
.#.#.##...
#....G.#..

output:

5
LEFT
IF-OPEN 5
RIGHT
GOTO 2
FORWARD

result:

ok correct answer!

Test #65:

score: 0
Accepted
time: 1ms
memory: 3636kb

input:

10 10
#...#..#.S
.##..#....
..###.#...
##.##.##..
#.#..##..#
.##.##...#
..#.##..#.
...#...##.
.#.#....##
#.##..G##.

output:

5
LEFT
LEFT
RIGHT
FORWARD
IF-OPEN 3

result:

ok correct answer!

Test #66:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

10 10
.........S
..........
..#.......
..........
.....#....
.#........
..........
..........
.......#..
.G.......#

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #67:

score: 0
Accepted
time: 1ms
memory: 3640kb

input:

10 10
.....#...S
...#....#.
......#.##
..#......#
#.#.##.#..
..#.##.#..
.......#..
#...#.....
#.#....#..
.#...#..#G

output:

5
LEFT
LEFT
LEFT
FORWARD
IF-OPEN 3

result:

ok correct answer!

Test #68:

score: 0
Accepted
time: 0ms
memory: 3808kb

input:

10 10
......S...
..........
..........
..........
..........
...#....#.
..........
#.....#...
..........
.....#G...

output:

3
RIGHT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #69:

score: 0
Accepted
time: 1ms
memory: 3572kb

input:

10 10
......##S.
........#.
....###...
....#.#..#
.##....#.#
.....#....
.....#....
..##......
....#.#.#.
.#....G...

output:

5
LEFT
LEFT
LEFT
FORWARD
IF-OPEN 3

result:

ok correct answer!

Test #70:

score: 0
Accepted
time: 2ms
memory: 3636kb

input:

10 10
#.S#..#...
.......#.#
#..##..#.#
#...#...#.
#.###..##.
.....#.#.#
#.#..#...#
..##.#.#.#
####..#...
##..G#.#.#

output:

5
LEFT
IF-OPEN 5
RIGHT
GOTO 2
FORWARD

result:

ok correct answer!

Test #71:

score: 0
Accepted
time: 1ms
memory: 3644kb

input:

10 10
S#...#....
.#.#.#.##.
.#.#.#.#..
.#.#.#.#.#
.#.#.#.#..
.#.#.#.##.
.#.#.#.#..
.#.#.#.#.#
.#.#.#.#..
...#...##G

output:

5
LEFT
LEFT
FORWARD
LEFT
IF-OPEN 3

result:

ok correct answer!

Test #72:

score: 0
Accepted
time: 0ms
memory: 3852kb

input:

10 10
S#..#...#.
.#.....#..
.#.....#..
.........#
##.#.#.#..
.#.#.#.#..
.#.#.#.#.#
.#.#.#.#..
.#.#.#.#..
...#...#.G

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #73:

score: 0
Accepted
time: 0ms
memory: 3512kb

input:

10 10
S.#.#.#.#.
#..#.#.#.#
.#..#.#.#.
#.#..#.#.#
.#.#..#.#.
#.#.#..#.#
.#.#.#..#.
#.#.#.#..#
.#.#.#.#..
#.#.#.#.#G

output:

4
LEFT
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #74:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

10 10
S.........
.########.
.#......#.
.#......#.
.#......#.
.#......#.
.#......#.
.#......#.
.########.
.........G

output:

3
LEFT
FORWARD
IF-OPEN 2

result:

ok correct answer!

Test #75:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

10 10
S.#.......
#.###.####
#......#.#
##.###....
.#.#...#.#
...#####.#
.#.#.#...#
.#.#...###
##.#####.#
.........G

output:

4
LEFT
FORWARD
RIGHT
FORWARD

result:

ok correct answer!

Test #76:

score: 0
Accepted
time: 0ms
memory: 3780kb

input:

10 10
S.#.......
#.###.####
#......#.#
##.###....
.#.#...#.#
...#####.#
.#.#.#...#
.#.#...###
##.#####.#
G.........

output:

5
LEFT
LEFT
FORWARD
RIGHT
IF-OPEN 3

result:

ok correct answer!