Logo
(追記) (追記ここまで)

24785번 - Turtle Master 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB66383052.632%

문제

Robot Turtles is one of Theta's favorite games. In this game, kindergarteners learn how to "code" by creating programs that move a turtle from a starting field to a diamond. Robot Turtles is reportedly the most successful game funded by the Kickstarter incubator.

In the actual board game, an adult plays the role of the "turtle master," which is the person that plays the role of a CPU to execute the program. As you can imagine, this is a pretty boring task that cries out for automation: in this problem, you are asked to write a program that automates the task of the turtle master.

Robot Turtles is played on an 8ドル \times 8$ board. There is one turtle (marked with the letter T), which always starts out at the bottom-left field, facing right. The board contains empty squares (marked as .), castles made out of rock (C), and castles made out of ice (I). The diamond is marked with a D. The turtle may move only onto empty squares and the square on which the diamond is located.

A turtle program contains 4ドル$ kinds of instructions, marked by a single letter.

  • F The turtle moves one field forward in the direction it is facing. If the turtle faces a castle or the border of the board, a program error occurs.
  • R The turtle turns 90ドル$ degrees to the right (the turtle will just turn and stay on the same field).
  • L The turtle turns 90ドル$ degrees to the left (the turtle will just turn and stay on the same field).
  • X The turtle fires a laser in the direction it is facing. If the square it is facing contains an ice castle, the ice castle will melt and the square will turn into an empty square. Otherwise, a program error occurs. The turtle will not move or change direction. It is a program error to fire the laser at empty squares, rock castles or outside the board.

입력

The input consists of 9ドル$ lines. The first 8ドル$ lines contains the board, each line representing the squares in a row of the board. The turtle will always be at the bottom-left. There will be exactly 1ドル$ diamond. The 9ドル^{\text{th}}$ line contains the program the turtle master is asked to execute.

출력

Output Diamond! if the entire program can be executed without program error and if the turtle is on the diamond square after the program has been executed. Output Bug! if a program error occurred, or if the turtle does not end up on the diamond square!

제한

예제 입력 1

........
........
........
...CC...
..C.DC..
.C..C...
C.IC....
T.C.....
FLFRXFLFRFLFRF

예제 출력 1

Diamond!

예제 입력 2

........
........
........
...CC...
..C.DC..
.C..C...
C.IC....
T.C.....
FLFRFLFRFLFRF

예제 출력 2

Bug!

예제 입력 3

........
........
........
...CC...
..C.DC..
.C..C...
C.IC....
T.C.....
FLFRXFLFRFLFFR

예제 출력 3

Bug!

힌트

출처

School > Virginia Tech High School Programming Contest > 2016 Virginia Tech High School Programming Contest C번

  • 문제를 만든 사람: Godmar Back
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /