Toe Jumps
Time limit1sMemory limit1024 MB
Given a 2x2 grid of ice marks and a travel direction, the task is to identify which toe jump (Toe Loop, Flip, or Lutz) left the marks, or output ? if none match.
- Level
Easy3 of 10
- Topics
- Implementation, Matrix
- Solved
- No attempts yet
Problem
Figure skating has six jumps: Axel, Lutz, Flip, Loop, Salchow, and Toe Loop. Jumps are divided into toe jumps and edge jumps. A jump in which the skater's toe pick touches the ice is a toe jump. The toe jumps are the Toe Loop, the Flip, and the Lutz. Below are the marks that toe jumps leave on the ice for a right-footed skater moving south (S), shown as grids.
Direction: ↓ (south, S)
Given a grid of marks and a direction, print which toe jump it is. The direction is one of E, W, S, or N, meaning east, west, south, or north.
Input
The first line contains one uppercase letter, E, W, S, or N, which is the direction of travel.
The next two lines contain a grid. The grid consists only of ., I, O, and P.
Output
On the first line, print the toe jump. Print T for the Toe Loop, F for the Flip, and Lz for the Lutz. If the marks match none of the toe jumps, print ?.