084. Fine Tuned

Codeforces
IDCF10269084
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
On a regular acoustic guitar, the open (regular) strings are tuned with these notes, starting from lowest to highest: You can change these values into different notes using the tuning pegs on the top of the guitar, twisting it forwards or backwards to change the pitch of the strings. One full rotation of the peg would be equivalent changing the pitch by one semitone, or a half step in pitch. For instance, using the piano keys up above, F would move up to F#, or if moved down a semitone, would be moved down to an E. When given certain note values, your job is to tune the song based on how many semitones you are given. This is known as _transposing_. The first line will contain an integer _n_ which will denote the semitone value you are to transpose the piece to. The second line will contain a space-separated line of strings ranging from the notes A-G#. Output a new line of the transposed piece, with each note being space-separated. ## Input The first line will contain an integer _n_ which will denote the semitone value you are to transpose the piece to. The second line will contain a space-separated line of strings ranging from the notes A-G#. ## Output Output a new line of the transposed piece, with each note being space-separated. [samples]
**Definitions** Let $ n \in \mathbb{Z} $ be the number of semitones to transpose. Let $ S = (s_1, s_2, \dots, s_m) $ be a sequence of musical notes, where each $ s_i \in \{ \text{A}, \text{A}\#, \text{B}, \text{C}, \text{C}\#, \text{D}, \text{D}\#, \text{E}, \text{F}, \text{F}\#, \text{G}, \text{G}\# \} $. **Constraints** 1. $ n $ is an integer (positive for upward, negative for downward transposition). 2. Each note $ s_i $ is from the 12-note chromatic scale: $$ \{ \text{A}, \text{A}\#, \text{B}, \text{C}, \text{C}\#, \text{D}, \text{D}\#, \text{E}, \text{F}, \text{F}\#, \text{G}, \text{G}\# \} $$ with cyclic ordering (modulo 12). **Objective** For each note $ s_i \in S $, compute the transposed note $ s_i' $ by shifting $ n $ semitones up (or down if $ n < 0 $) in the chromatic scale, modulo 12: $$ s_i' = \text{chromatic\_scale}[(\text{index}(s_i) + n) \mod 12] $$ Output the sequence $ S' = (s_1', s_2', \dots, s_m') $ as space-separated notes.
API Response (JSON)
{
  "problem": {
    "name": "084. Fine Tuned",
    "description": {
      "content": "On a regular acoustic guitar, the open (regular) strings are tuned with these notes, starting from lowest to highest:  You can change these values into different notes using the tuning pegs on the to",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269084"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "On a regular acoustic guitar, the open (regular) strings are tuned with these notes, starting from lowest to highest: \n\nYou can change these values into different notes using the tuning pegs on the to...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of semitones to transpose.  \nLet $ S = (s_1, s_2, \\dots, s_m) $ be a sequence of musical notes, where each $ s_i \\in \\{ \\text{A}, \\text{A}\\#, \\...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments