首页 > 其他分享 >HDU 4245

HDU 4245

时间:2022-10-11 16:03:08浏览次数:70  
标签:HDU Ab notes 4245 Db major Eb minor


​HDU - 4245​


​A Famous Music Composer​



​Submit​​​ ​​Status​




Description




Mr. B is a famous music composer. One of his most famous work 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: 




Five of the notes have two alternate names, as is indicated above with equals sign. Thus, there are 17 possible names of 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 major and minor tonalities. This gives 34 possible keys, of which 24 are musically distinct. 



In naming his preludes, Mr. B used all the keys except the following 10, which were named instead by their alternate names: 





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


 




Input



Each test case is described by one line 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" (quotes for clarify).


 





Output



For each case output the required answer, following the format of the sample.


 





Sample Input



Ab minorD# majorG minor




Sample Output





Case 1: G# minorCase 2: Eb majorCase 3: UNIQUE




Time Limit: 1000MS

 

Memory Limit: 32768KB

 

64bit IO Format: %I64d & %I64u


这个题意好坑,中间说的小明都是没用的。

#include<bits/stdc++.h>
using namespace std;
char a[30][10]={
{"A# minor"},{"C# minor"},{"D# minor"},{"F# minor"},{"G# minor"},
{"Bb minor"},{"Db minor"},{"Eb minor"},{"Gb minor"},{"Ab minor"},
{"A# major"},{"C# major"},{"D# major"},{"F# major"},{"G# major"},
{"Bb major"},{"Db major"},{"Eb major"},{"Gb major"},{"Ab major"}
};
char b[30][10]={
{"Bb minor"},{"Db minor"},{"Eb minor"},{"Gb minor"},{"Ab minor"},
{"A# minor"},{"C# minor"},{"D# minor"},{"F# minor"},{"G# minor"},
{"Bb major"},{"Db major"},{"Eb major"},{"Gb major"},{"Ab major"},
{"A# major"},{"C# major"},{"D# major"},{"F# major"},{"G# major"}
};
int main()
{
char c[20];
int cas=1;
while(gets(c)){
int k=0;
printf("Case %d: ",cas++);
for(int i=0;i<20;i++)
if(strcmp(a[i],c)==0){
printf("%s\n",b[i]);k=1;break;
}
if(k==0) printf("UNIQUE\n");
}
return 0;
}



标签:HDU,Ab,notes,4245,Db,major,Eb,minor
From: https://blog.51cto.com/u_12911014/5746512

相关文章

  • HDU 1698 Just a Hook(线段树)
    题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1698思路:updata()区间替换,query()区间求和先上3篇博客1:http://blog.sina.com.cn/s/blog_a2dce6b30101l8bi.html 2:ht......
  • HDU 5373 The shortest problem(判断一个数能否被11整除)
    题目地址;​​点击打开链接​​思路:参考队友的代码写的,资料地址:​​点击打开链接​​ 怎样判断一个数能不能被11整除?判断一个数能不能被11整除与判断一个数能不能被......
  • HDU7239 Matryoshka Doll (DP)
    题目大意:题目描述.有......
  • HDU4417 Super Mario (主席树)
    主席树另一模板。查询的是[L,R]中<=h的个数。1#include<bits/stdc++.h>2usingnamespacestd;3#definelctr[i].ch[0]4#definerctr[i].ch[1]5#define......
  • HDU3652 B-number
    B-number题意:求1-n(<=1e9)中是13的倍数且包含“13”的个数。多组数据。数位DP#include<bits/stdc++.h>usingnamespacestd;intn;intdat[15],cnt;intf[13][11......
  • HDU-5380 Travel with candy(贪心+单调队列)
    TravelwithcandyTimeLimit:2000/1000MS(Java/Others)    MemoryLimit:262144/262144K(Java/Others)TotalSubmission(s):396    AcceptedSubmission(s)......
  • 「HDU4035」 Maze
    \(\texttt{「HDU4035」Maze}\)\(\texttt{Describe}\)迷宫有\(n\)个房间,由\(n-1\)条隧道连通起来形成了一棵树,从结点\(1\)出发,在每个结点\(i\)都有\(3\)种可能......
  • A Magic Lamp HDU - 3183
    AMagicLampHDU-3183给定一个数字求删除N个数字后的最小数字。Input有多个测试用例。每个测试用例将包含一个给定的x整数和一个整数n(如果该整数包含m位,n将......
  • Automatic Judge HDU - 6023
    AutomaticJudgeHDU-60232019年某日,正睿OI训练营迎来了一场六一节acm专场。在五个小时的比赛时间里,你可以提交代码到比赛页面,然后评测机会给你返回一个结果。评测机......
  • HDU3085 Nightmare Ⅱ
    DescriptionlinkSolution这是个双向广搜板子题。首先鬼的分裂实际上就是每一次走两步,由于没有障碍所以直接曼哈顿距离即可。男孩每一次可以走3步,所以直接bfs连走......