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

23207번 - Preludes 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB132857463.248%

문제

Frederic Chopin was a Polish music composer who lived from 1810-1839. One of his most famous works was his set of preludes. These 24 pieces span the 24 musical keys (there are musically distinct 12 scale notes, and each may use major or minor tonality). The 12 distinct scale notes are:

1 2 3 4 5 6 7 8 9 10 11 12
A A♯ = B♭ B C C♯ = D♭ D D♯ = E♭ E F F♯ = G♭ G G♯ = A♭

Five of the notes have two alternate names, as is indicated above with the equals sign (e.g. C♯ = D♭ means that note has two names, C♯ and D♭). Thus, there are 17 possible names for the scale notes, but only 12 musically distinct notes. When using one of these as the keynote for a musical key, we can further distinguish between the major and minor tonalities. This gives 34 possible keys, of which 24 are musically distinct.

In naming his preludes, Chopin used all the keys except for the following 10 (which were named instead by their alternate names):

A♭ minor A♯ major A♯ minor C♯ major D♭ minor D♯ major D♯ minor G♭ major G♭ minor G♯ major

Write a program that, given the name of a key, will give an alternate name (if it has an alternate) or report that the key name is unique.

입력

Each test case is described by one line of input having the format “note tonality”, where note is one of the 17 names for the scale notes given above, and tonality is either major or minor. All note names will be upper-case, and the two accidentals (♯ and ♭) will be written as # and b, respectively.

출력

For each case, display the case number followed by the alternate key name, if it exists, or print UNIQUE if the key name is unique. Follow the format of the sample output.

제한

예제 입력 1

Ab minor
D# major
G minor

예제 출력 1

Case 1: G# minor
Case 2: Eb major
Case 3: UNIQUE

힌트

출처

ICPC > World Finals > World Finals Dress Rehearsal > ACM-ICPC World Finals Dress Rehearsal 2012 A번

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

출처

대학교 대회

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

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