This question is not very well formed.. the number of sharps/flats that the judge matches is more than the number listed.. my code uses:
if (!strcmp(note, "a")) {
return 0;
} else if (!strcmp(note, "a#") || !strcmp(note, "bb")) {
return 1;
} else if (!strcmp(note, "b") || !strcmp(note, "cb")) {
return 2;
} else if (!strcmp(note, "c") || !strcmp(note, "b#")) {
return 3;
} else if (!strcmp(note, "c#") || !strcmp(note, "db")) {
return 4;
} else if (!strcmp(note, "d")) {
return 5;
} else if (!strcmp(note, "d#") || !strcmp(note, "eb")) {
return 6;
} else if (!strcmp(note, "e") || !strcmp(note, "fb")) {
return 7;
} else if (!strcmp(note, "f") || !strcmp(note, "e#")) {
return 8;
} else if (!strcmp(note, "f#") || !strcmp(note, "gb")) {
return 9;
} else if (!strcmp(note, "g")) {
return 10;
} else if (!strcmp(note, "g#") || !strcmp(note, "ab")) {
return 11;
I believe fb, ab and some others are not listed by the question.
346 - Getting Chorded
Moderator: Board moderators
346 GETTING CHORDED
There is input with "bb" which is B flat.
![:wink:](./images/smilies/icon_wink.gif)
![:wink:](./images/smilies/icon_wink.gif)
-
- Experienced poster
- Posts: 139
- Joined: Wed May 18, 2011 3:04 pm
Re: 346 - Getting Chorded
The problem statement of PDF version is bad, not clear enough.
metaphysis: http://uhunt.onlinejudge.org/id/95895
My solutions for UVa problems: https://github.com/metaphysis/Code.
My solutions for UVa problems: https://github.com/metaphysis/Code.