Double Doors Regional P2 - Tudor Learns DDR

View as PDF

Submit solution

Points: 3
Time limit: 1.0s
Memory limit: 64M

Problem type

Tudor is learning how to play Dance Dance Revolution!

Tudor is good at stepping to the beat, but is struggling to deal with more complex note patterns. He decides to focus on three-step sequences of notes.

There are four different directions that one can step in Dance Dance Revolution - up, down, left, and right. Note that up and down are in opposite directions, and left and right are in opposite directions. This means there are 64 different three-step sequences of notes.

Tudor is especially interested in crossover sequences or candle sequences. A crossover sequence is a three-step sequence where the first and last steps are opposite, all three steps are in distinct directions, and the first step is either left or right. A candle sequence is a three-step sequence where the first and last steps are opposite, all three steps are in distinct directions, and the first step is either up or down.

Given a particular three-note sequence, determine if it is a crossover sequence, a candle sequence, or neither.

Input Specification

The input consists of exactly one line, containing three uppercase letters, the steps in sequence in order. Each of these letters will be one of U, D, L, and R, corresponding to up, down, left, and right, respectively.

Output Specification

If the sequence is a crossover sequence, output Crossover.

Otherwise, if the sequence is a candle sequence, output Candle.

Otherwise, output Neither.

Sample Data ZIP

Click here for ZIP.

Sample Input 1

UUU

Sample Output 1

Neither

Sample Input 2

ULD

Sample Output 2

Candle

Sample Input 3

LDR

Sample Output 3

Crossover

Comments


  • -2
    QiQi  commented on Nov. 24, 2021, 1:52 a.m.

    Is it possible that it is both?


    • 2
      uselessleaf  commented on Nov. 24, 2021, 12:58 p.m.

      The first step in a crossover sequence is either left or right, while the first step in a candle sequence is either up or down.