21175_GettingChorded

2022-5-16 18:18| 发布者: Hocassian| 查看: 42| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504978537499-Problem List-采集的数据-后羿采集器.html

Pro.ID

21175

Title

Getting Chorded

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21175

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 1500/500 MS (Java/Others)     Memory Limit: 131072/65536 K (Java/Others)
  • 描述

    The "names" of the notes on a standard 88-key piano keyboard start with A (the lowest note on the keyboard) and then proceed sequentially with A# (A-sharp), B, C, C#, D, D#, E, F, F#, G, and finally G#. After the first 12 notes are named, the pattern repeats, proceeding through the last key, which is named C. Some notes have other common names. A# may also be called B (B-flat), C# may be called D, D# may be called E, F# may be called G, and G# may be called A. (There are still other names, like C##, but we won't worry about those here!)

    Most music includes chords, or groups of notes played at the same time. Many of these chords are given standard names. For example, the notes C, E, and G sounded together are called a C Major chord. While the particular C, E and G in the chord are frequently close together on the keyboard, for our purposes here, any C, E, and G played at the same time will constitute a C Major chord. It is the spacing between the notes on the keyboard that distinguishes a Major chord from others. As you can see, there are exactly three notes skipped between the C and the E (namely C#, D and D#), and then only two skipped between the E and the G (namely F and F#). If we start with a different note, say F#, we can easily tell that the notes in an F Major chord are F, A, and C (skipping G, G#, and A between F# and A#, and skipping B and C between A# and C#).

    Another frequently encountered chord is the Minor chord. C Minor, for example, is played by sounding C, D#, and G. As you can see, C# and D are skipped between C and D#, and E, F and F# are skipped between D# and G. You should now be able to tell that the notes in an F# Minor chord are F#, A, and C#.

    In this problem you will be presented with a sequence of lines, each containing the names of three notes. You are to identify if these three notes, taken together, form a Major or Minor chord. If they do, you will display the name of the chord. If they don't you'll also report that fact. Remember that the notes need not appear in the usual sequence. Case will be ignored in the input, and the symbol  will be indicated by the letter b. A blank or blanks will appear between the notes on each line, and may also precede the first note on the line or follow the third note on the line. Each line except the last will contain exactly three properly formed notes, so you need not check for errors. The last line will be entirely blank, and marks the end of the input data. The output is to be in the same style as shown in the examples below; do not use  to name chords--use only # when necessary.

    输入

     

    输出

    Description
    The "names" of the notes on a standard 88-key piano keyboard start with A (the lowest note on the keyboard) and then proceed sequentially with A# (A-sharp), B, C, C#, D, D#, E, F, F#, G, and finally G#. After the first 12 notes are named, the pattern repeats, proceeding through the last key, which is named C. Some notes have other common names. A# may also be called B (B-flat), C# may be called D, D# may be called E, F# may be called G, and G# may be called A. (There are still other names, like C##, but we won't worry about those here!)

    Most music includes chords, or groups of notes played at the same time. Many of these chords are given standard names. For example, the notes C, E, and G sounded together are called a C Major chord. While the particular C, E and G in the chord are frequently close together on the keyboard, for our purposes here, any C, E, and G played at the same time will constitute a C Major chord. It is the spacing between the notes on the keyboard that distinguishes a Major chord from others. As you can see, there are exactly three notes skipped between the C and the E (namely C#, D and D#), and then only two skipped between the E and the G (namely F and F#). If we start with a different note, say F#, we can easily tell that the notes in an F Major chord are F, A, and C (skipping G, G#, and A between F# and A#, and skipping B and C between A# and C#).

    Another frequently encountered chord is the Minor chord. C Minor, for example, is played by sounding C, D#, and G. As you can see, C# and D are skipped between C and D#, and E, F and F# are skipped between D# and G. You should now be able to tell that the notes in an F# Minor chord are F#, A, and C#.

    In this problem you will be presented with a sequence of lines, each containing the names of three notes. You are to identify if these three notes, taken together, form a Major or Minor chord. If they do, you will display the name of the chord. If they don't you'll also report that fact. Remember that the notes need not appear in the usual sequence. Case will be ignored in the input, and the symbol  will be indicated by the letter b. A blank or blanks will appear between the notes on each line, and may also precede the first note on the line or follow the third note on the line. Each line except the last will contain exactly three properly formed notes, so you need not check for errors. The last line will be entirely blank, and marks the end of the input data. The output is to be in the same style as shown in the examples below; do not use  to name chords--use only # when necessary.

    Input
     
    Output
     
    Sample Input
    C E G
    C E   F#
    G	C	E
    C Eb G
    c# a f#
       f g#      C
    Sample Output
    C E G is a C Major chord.
    C E F# is unrecognized.
    G C E is a C Major chord.
    C Eb G is a C Minor chord.
    c# a f# is a F# Minor chord.
    f g# C is a F Minor chord.
    Source

    样例输入

    C E G
    C E   F#
    G	C	E
    C Eb G
    c# a f#
       f g#      C

    样例输出

    C E G is a C Major chord.
    C E F# is unrecognized.
    G C E is a C Major chord.
    C Eb G is a C Minor chord.
    c# a f# is a F# Minor chord.
    f g# C is a F Minor chord.

    提示

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部