595 - A Major Problem

All about problems in Volume 5. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
htl
Experienced poster
Posts: 185
Joined: Fri Jun 28, 2002 12:05 pm
Location: Taipei, Taiwan

595 - fix PE

Post by htl »

I tried many times and always got PE. Could someone give me some examples of output(where should I output the newline)?

raisdead
New poster
Posts: 6
Joined: Thu Dec 30, 2010 7:25 pm

595 - A Major Problem

Post by raisdead »

I know that this problem intimidates a lot of people because its a music thing, but I have a little music background and wanted to tackel this problem. I am getting a WA and have tried almost every possible test case. (Wrote a program to generate all inputs)

All input: http://pastebin.com/pk2zhS1m
All proper output: http://pastebin.com/49Q1ptfZ

Code: Select all


/**
 * 1997 Greater New York ACM Region
 * Collegiate Programming Contest
 * November 9, 1997
 * Problem B: A Major Problem
 *
 */
import java.util.Scanner;
import java.io.*;

public class Main {
	private static String[] chromaticSharps = {"G#","A","A#","B","B#","C#","D","D#","E","E#","F#","G"};
	private static String[] chromaticFlats  = {"Ab","A","Bb","Cb","C","Db","D","Eb","Fb","F","Gb","G"};

	public static void main(String[] args) {
		//Code cut...
	}
}
Last edited by raisdead on Wed Jun 29, 2011 5:16 am, edited 1 time in total.

raisdead
New poster
Posts: 6
Joined: Thu Dec 30, 2010 7:25 pm

Re: 595 - A Major Problem

Post by raisdead »

My solution was exactly correct. The only thing I needed to do was remove the blank line after the last case. LAME!! I will remove my code so no one can steal the win.

Note: I was receiving a Wrong Answer not a Presentation Error. More Lame.

r2ro
New poster
Posts: 38
Joined: Thu Sep 25, 2008 9:26 am

Re: 595 - A Major Problem

Post by r2ro »

Any critical inputs? I'm not sure if I missed something out which is why I'm getting WA (or I misread the problem w/ regards to the sharps and flats).

Input:

Code: Select all

C C C D E F G A B *
C Db C D E F G A B *
C D C D E F G A B *
C Eb C D E F G A B *
C E C D E F G A B *
C F C D E F G A B *
C Gb C D E F G A B *
C G C D E F G A B *
C Ab C D E F G A B *
C A C D E F G A B *
C Bb C D E F G A B *
C B C D E F G A B *
Db C Db Eb F Gb Ab Bb C *
Db Db Db Eb F Gb Ab Bb C *
Db D Db Eb F Gb Ab Bb C *
Db Eb Db Eb F Gb Ab Bb C *
Db E Db Eb F Gb Ab Bb C *
Db F Db Eb F Gb Ab Bb C *
Db Gb Db Eb F Gb Ab Bb C *
Db G Db Eb F Gb Ab Bb C *
Db Ab Db Eb F Gb Ab Bb C *
Db A Db Eb F Gb Ab Bb C *
Db Bb Db Eb F Gb Ab Bb C *
Db B Db Eb F Gb Ab Bb C *
D C D E F# G A B C# *
D Db D E F# G A B C# *
D D D E F# G A B C# *
D Eb D E F# G A B C# *
D E D E F# G A B C# *
D F D E F# G A B C# *
D Gb D E F# G A B C# *
D G D E F# G A B C# *
D Ab D E F# G A B C# *
D A D E F# G A B C# *
D Bb D E F# G A B C# *
D B D E F# G A B C# *
Eb C Eb F G Ab Bb C D *
Eb Db Eb F G Ab Bb C D *
Eb D Eb F G Ab Bb C D *
Eb Eb Eb F G Ab Bb C D *
Eb E Eb F G Ab Bb C D *
Eb F Eb F G Ab Bb C D *
Eb Gb Eb F G Ab Bb C D *
Eb G Eb F G Ab Bb C D *
Eb Ab Eb F G Ab Bb C D *
Eb A Eb F G Ab Bb C D *
Eb Bb Eb F G Ab Bb C D *
Eb B Eb F G Ab Bb C D *
E C E F# G# A B C# D# *
E Db E F# G# A B C# D# *
E D E F# G# A B C# D# *
E Eb E F# G# A B C# D# *
E E E F# G# A B C# D# *
E F E F# G# A B C# D# *
E Gb E F# G# A B C# D# *
E G E F# G# A B C# D# *
E Ab E F# G# A B C# D# *
E A E F# G# A B C# D# *
E Bb E F# G# A B C# D# *
E B E F# G# A B C# D# *
F C F G A Bb C D E *
F Db F G A Bb C D E *
F D F G A Bb C D E *
F Eb F G A Bb C D E *
F E F G A Bb C D E *
F F F G A Bb C D E *
F Gb F G A Bb C D E *
F G F G A Bb C D E *
F Ab F G A Bb C D E *
F A F G A Bb C D E *
F Bb F G A Bb C D E *
F B F G A Bb C D E *
Gb C Gb Ab Bb Cb Db Eb F *
Gb Db Gb Ab Bb Cb Db Eb F *
Gb D Gb Ab Bb Cb Db Eb F *
Gb Eb Gb Ab Bb Cb Db Eb F *
Gb E Gb Ab Bb Cb Db Eb F *
Gb F Gb Ab Bb Cb Db Eb F *
Gb Gb Gb Ab Bb Cb Db Eb F *
Gb G Gb Ab Bb Cb Db Eb F *
Gb Ab Gb Ab Bb Cb Db Eb F *
Gb A Gb Ab Bb Cb Db Eb F *
Gb Bb Gb Ab Bb Cb Db Eb F *
Gb B Gb Ab Bb Cb Db Eb F *
G C G A B C D E F# *
G Db G A B C D E F# *
G D G A B C D E F# *
G Eb G A B C D E F# *
G E G A B C D E F# *
G F G A B C D E F# *
G Gb G A B C D E F# *
G G G A B C D E F# *
G Ab G A B C D E F# *
G A G A B C D E F# *
G Bb G A B C D E F# *
G B G A B C D E F# *
Ab C Ab Bb C Db Eb F G *
Ab Db Ab Bb C Db Eb F G *
Ab D Ab Bb C Db Eb F G *
Ab Eb Ab Bb C Db Eb F G *
Ab E Ab Bb C Db Eb F G *
Ab F Ab Bb C Db Eb F G *
Ab Gb Ab Bb C Db Eb F G *
Ab G Ab Bb C Db Eb F G *
Ab Ab Ab Bb C Db Eb F G *
Ab A Ab Bb C Db Eb F G *
Ab Bb Ab Bb C Db Eb F G *
Ab B Ab Bb C Db Eb F G *
A C A B C# D E F# G# *
A Db A B C# D E F# G# *
A D A B C# D E F# G# *
A Eb A B C# D E F# G# *
A E A B C# D E F# G# *
A F A B C# D E F# G# *
A Gb A B C# D E F# G# *
A G A B C# D E F# G# *
A Ab A B C# D E F# G# *
A A A B C# D E F# G# *
A Bb A B C# D E F# G# *
A B A B C# D E F# G# *
Bb C Bb C D Eb F G A *
Bb Db Bb C D Eb F G A *
Bb D Bb C D Eb F G A *
Bb Eb Bb C D Eb F G A *
Bb E Bb C D Eb F G A *
Bb F Bb C D Eb F G A *
Bb Gb Bb C D Eb F G A *
Bb G Bb C D Eb F G A *
Bb Ab Bb C D Eb F G A *
Bb A Bb C D Eb F G A *
Bb Bb Bb C D Eb F G A *
Bb B Bb C D Eb F G A *
B C B C# D# E F# G# A# *
B Db B C# D# E F# G# A# *
B D B C# D# E F# G# A# *
B Eb B C# D# E F# G# A# *
B E B C# D# E F# G# A# *
B F B C# D# E F# G# A# *
B Gb B C# D# E F# G# A# *
B G B C# D# E F# G# A# *
B Ab B C# D# E F# G# A# *
B A B C# D# E F# G# A# *
B Bb B C# D# E F# G# A# *
B B B C# D# E F# G# A# *
C A# C *
C B *
D Bb C A H D *
*
Output:

Code: Select all

Transposing from C to C:
  C transposes to C
  D transposes to D
  E transposes to E
  F transposes to F
  G transposes to G
  A transposes to A
  B transposes to B

Transposing from C to Db:
  C transposes to Db
  D transposes to Eb
  E transposes to F
  F transposes to Gb
  G transposes to Ab
  A transposes to Bb
  B transposes to C

Transposing from C to D:
  C transposes to D
  D transposes to E
  E transposes to F#
  F transposes to G
  G transposes to A
  A transposes to B
  B transposes to C#

Transposing from C to Eb:
  C transposes to Eb
  D transposes to F
  E transposes to G
  F transposes to Ab
  G transposes to Bb
  A transposes to C
  B transposes to D

Transposing from C to E:
  C transposes to E
  D transposes to F#
  E transposes to G#
  F transposes to A
  G transposes to B
  A transposes to C#
  B transposes to D#

Transposing from C to F:
  C transposes to F
  D transposes to G
  E transposes to A
  F transposes to Bb
  G transposes to C
  A transposes to D
  B transposes to E

Transposing from C to Gb:
  C transposes to Gb
  D transposes to Ab
  E transposes to Bb
  F transposes to Cb
  G transposes to Db
  A transposes to Eb
  B transposes to F

Transposing from C to G:
  C transposes to G
  D transposes to A
  E transposes to B
  F transposes to C
  G transposes to D
  A transposes to E
  B transposes to F#

Transposing from C to Ab:
  C transposes to Ab
  D transposes to Bb
  E transposes to C
  F transposes to Db
  G transposes to Eb
  A transposes to F
  B transposes to G

Transposing from C to A:
  C transposes to A
  D transposes to B
  E transposes to C#
  F transposes to D
  G transposes to E
  A transposes to F#
  B transposes to G#

Transposing from C to Bb:
  C transposes to Bb
  D transposes to C
  E transposes to D
  F transposes to Eb
  G transposes to F
  A transposes to G
  B transposes to A

Transposing from C to B:
  C transposes to B
  D transposes to C#
  E transposes to D#
  F transposes to E
  G transposes to F#
  A transposes to G#
  B transposes to A#

Transposing from Db to C:
  Db transposes to C
  Eb transposes to D
  F transposes to E
  Gb transposes to F
  Ab transposes to G
  Bb transposes to A
  C transposes to B

Transposing from Db to Db:
  Db transposes to Db
  Eb transposes to Eb
  F transposes to F
  Gb transposes to Gb
  Ab transposes to Ab
  Bb transposes to Bb
  C transposes to C

Transposing from Db to D:
  Db transposes to D
  Eb transposes to E
  F transposes to F#
  Gb transposes to G
  Ab transposes to A
  Bb transposes to B
  C transposes to C#

Transposing from Db to Eb:
  Db transposes to Eb
  Eb transposes to F
  F transposes to G
  Gb transposes to Ab
  Ab transposes to Bb
  Bb transposes to C
  C transposes to D

Transposing from Db to E:
  Db transposes to E
  Eb transposes to F#
  F transposes to G#
  Gb transposes to A
  Ab transposes to B
  Bb transposes to C#
  C transposes to D#

Transposing from Db to F:
  Db transposes to F
  Eb transposes to G
  F transposes to A
  Gb transposes to Bb
  Ab transposes to C
  Bb transposes to D
  C transposes to E

Transposing from Db to Gb:
  Db transposes to Gb
  Eb transposes to Ab
  F transposes to Bb
  Gb transposes to Cb
  Ab transposes to Db
  Bb transposes to Eb
  C transposes to F

Transposing from Db to G:
  Db transposes to G
  Eb transposes to A
  F transposes to B
  Gb transposes to C
  Ab transposes to D
  Bb transposes to E
  C transposes to F#

Transposing from Db to Ab:
  Db transposes to Ab
  Eb transposes to Bb
  F transposes to C
  Gb transposes to Db
  Ab transposes to Eb
  Bb transposes to F
  C transposes to G

Transposing from Db to A:
  Db transposes to A
  Eb transposes to B
  F transposes to C#
  Gb transposes to D
  Ab transposes to E
  Bb transposes to F#
  C transposes to G#

Transposing from Db to Bb:
  Db transposes to Bb
  Eb transposes to C
  F transposes to D
  Gb transposes to Eb
  Ab transposes to F
  Bb transposes to G
  C transposes to A

Transposing from Db to B:
  Db transposes to B
  Eb transposes to C#
  F transposes to D#
  Gb transposes to E
  Ab transposes to F#
  Bb transposes to G#
  C transposes to A#

Transposing from D to C:
  D transposes to C
  E transposes to D
  F# transposes to E
  G transposes to F
  A transposes to G
  B transposes to A
  C# transposes to B

Transposing from D to Db:
  D transposes to Db
  E transposes to Eb
  F# transposes to F
  G transposes to Gb
  A transposes to Ab
  B transposes to Bb
  C# transposes to C

Transposing from D to D:
  D transposes to D
  E transposes to E
  F# transposes to F#
  G transposes to G
  A transposes to A
  B transposes to B
  C# transposes to C#

Transposing from D to Eb:
  D transposes to Eb
  E transposes to F
  F# transposes to G
  G transposes to Ab
  A transposes to Bb
  B transposes to C
  C# transposes to D

Transposing from D to E:
  D transposes to E
  E transposes to F#
  F# transposes to G#
  G transposes to A
  A transposes to B
  B transposes to C#
  C# transposes to D#

Transposing from D to F:
  D transposes to F
  E transposes to G
  F# transposes to A
  G transposes to Bb
  A transposes to C
  B transposes to D
  C# transposes to E

Transposing from D to Gb:
  D transposes to Gb
  E transposes to Ab
  F# transposes to Bb
  G transposes to Cb
  A transposes to Db
  B transposes to Eb
  C# transposes to F

Transposing from D to G:
  D transposes to G
  E transposes to A
  F# transposes to B
  G transposes to C
  A transposes to D
  B transposes to E
  C# transposes to F#

Transposing from D to Ab:
  D transposes to Ab
  E transposes to Bb
  F# transposes to C
  G transposes to Db
  A transposes to Eb
  B transposes to F
  C# transposes to G

Transposing from D to A:
  D transposes to A
  E transposes to B
  F# transposes to C#
  G transposes to D
  A transposes to E
  B transposes to F#
  C# transposes to G#

Transposing from D to Bb:
  D transposes to Bb
  E transposes to C
  F# transposes to D
  G transposes to Eb
  A transposes to F
  B transposes to G
  C# transposes to A

Transposing from D to B:
  D transposes to B
  E transposes to C#
  F# transposes to D#
  G transposes to E
  A transposes to F#
  B transposes to G#
  C# transposes to A#

Transposing from Eb to C:
  Eb transposes to C
  F transposes to D
  G transposes to E
  Ab transposes to F
  Bb transposes to G
  C transposes to A
  D transposes to B

Transposing from Eb to Db:
  Eb transposes to Db
  F transposes to Eb
  G transposes to F
  Ab transposes to Gb
  Bb transposes to Ab
  C transposes to Bb
  D transposes to C

Transposing from Eb to D:
  Eb transposes to D
  F transposes to E
  G transposes to F#
  Ab transposes to G
  Bb transposes to A
  C transposes to B
  D transposes to C#

Transposing from Eb to Eb:
  Eb transposes to Eb
  F transposes to F
  G transposes to G
  Ab transposes to Ab
  Bb transposes to Bb
  C transposes to C
  D transposes to D

Transposing from Eb to E:
  Eb transposes to E
  F transposes to F#
  G transposes to G#
  Ab transposes to A
  Bb transposes to B
  C transposes to C#
  D transposes to D#

Transposing from Eb to F:
  Eb transposes to F
  F transposes to G
  G transposes to A
  Ab transposes to Bb
  Bb transposes to C
  C transposes to D
  D transposes to E

Transposing from Eb to Gb:
  Eb transposes to Gb
  F transposes to Ab
  G transposes to Bb
  Ab transposes to Cb
  Bb transposes to Db
  C transposes to Eb
  D transposes to F

Transposing from Eb to G:
  Eb transposes to G
  F transposes to A
  G transposes to B
  Ab transposes to C
  Bb transposes to D
  C transposes to E
  D transposes to F#

Transposing from Eb to Ab:
  Eb transposes to Ab
  F transposes to Bb
  G transposes to C
  Ab transposes to Db
  Bb transposes to Eb
  C transposes to F
  D transposes to G

Transposing from Eb to A:
  Eb transposes to A
  F transposes to B
  G transposes to C#
  Ab transposes to D
  Bb transposes to E
  C transposes to F#
  D transposes to G#

Transposing from Eb to Bb:
  Eb transposes to Bb
  F transposes to C
  G transposes to D
  Ab transposes to Eb
  Bb transposes to F
  C transposes to G
  D transposes to A

Transposing from Eb to B:
  Eb transposes to B
  F transposes to C#
  G transposes to D#
  Ab transposes to E
  Bb transposes to F#
  C transposes to G#
  D transposes to A#

Transposing from E to C:
  E transposes to C
  F# transposes to D
  G# transposes to E
  A transposes to F
  B transposes to G
  C# transposes to A
  D# transposes to B

Transposing from E to Db:
  E transposes to Db
  F# transposes to Eb
  G# transposes to F
  A transposes to Gb
  B transposes to Ab
  C# transposes to Bb
  D# transposes to C

Transposing from E to D:
  E transposes to D
  F# transposes to E
  G# transposes to F#
  A transposes to G
  B transposes to A
  C# transposes to B
  D# transposes to C#

Transposing from E to Eb:
  E transposes to Eb
  F# transposes to F
  G# transposes to G
  A transposes to Ab
  B transposes to Bb
  C# transposes to C
  D# transposes to D

Transposing from E to E:
  E transposes to E
  F# transposes to F#
  G# transposes to G#
  A transposes to A
  B transposes to B
  C# transposes to C#
  D# transposes to D#

Transposing from E to F:
  E transposes to F
  F# transposes to G
  G# transposes to A
  A transposes to Bb
  B transposes to C
  C# transposes to D
  D# transposes to E

Transposing from E to Gb:
  E transposes to Gb
  F# transposes to Ab
  G# transposes to Bb
  A transposes to Cb
  B transposes to Db
  C# transposes to Eb
  D# transposes to F

Transposing from E to G:
  E transposes to G
  F# transposes to A
  G# transposes to B
  A transposes to C
  B transposes to D
  C# transposes to E
  D# transposes to F#

Transposing from E to Ab:
  E transposes to Ab
  F# transposes to Bb
  G# transposes to C
  A transposes to Db
  B transposes to Eb
  C# transposes to F
  D# transposes to G

Transposing from E to A:
  E transposes to A
  F# transposes to B
  G# transposes to C#
  A transposes to D
  B transposes to E
  C# transposes to F#
  D# transposes to G#

Transposing from E to Bb:
  E transposes to Bb
  F# transposes to C
  G# transposes to D
  A transposes to Eb
  B transposes to F
  C# transposes to G
  D# transposes to A

Transposing from E to B:
  E transposes to B
  F# transposes to C#
  G# transposes to D#
  A transposes to E
  B transposes to F#
  C# transposes to G#
  D# transposes to A#

Transposing from F to C:
  F transposes to C
  G transposes to D
  A transposes to E
  Bb transposes to F
  C transposes to G
  D transposes to A
  E transposes to B

Transposing from F to Db:
  F transposes to Db
  G transposes to Eb
  A transposes to F
  Bb transposes to Gb
  C transposes to Ab
  D transposes to Bb
  E transposes to C

Transposing from F to D:
  F transposes to D
  G transposes to E
  A transposes to F#
  Bb transposes to G
  C transposes to A
  D transposes to B
  E transposes to C#

Transposing from F to Eb:
  F transposes to Eb
  G transposes to F
  A transposes to G
  Bb transposes to Ab
  C transposes to Bb
  D transposes to C
  E transposes to D

Transposing from F to E:
  F transposes to E
  G transposes to F#
  A transposes to G#
  Bb transposes to A
  C transposes to B
  D transposes to C#
  E transposes to D#

Transposing from F to F:
  F transposes to F
  G transposes to G
  A transposes to A
  Bb transposes to Bb
  C transposes to C
  D transposes to D
  E transposes to E

Transposing from F to Gb:
  F transposes to Gb
  G transposes to Ab
  A transposes to Bb
  Bb transposes to Cb
  C transposes to Db
  D transposes to Eb
  E transposes to F

Transposing from F to G:
  F transposes to G
  G transposes to A
  A transposes to B
  Bb transposes to C
  C transposes to D
  D transposes to E
  E transposes to F#

Transposing from F to Ab:
  F transposes to Ab
  G transposes to Bb
  A transposes to C
  Bb transposes to Db
  C transposes to Eb
  D transposes to F
  E transposes to G

Transposing from F to A:
  F transposes to A
  G transposes to B
  A transposes to C#
  Bb transposes to D
  C transposes to E
  D transposes to F#
  E transposes to G#

Transposing from F to Bb:
  F transposes to Bb
  G transposes to C
  A transposes to D
  Bb transposes to Eb
  C transposes to F
  D transposes to G
  E transposes to A

Transposing from F to B:
  F transposes to B
  G transposes to C#
  A transposes to D#
  Bb transposes to E
  C transposes to F#
  D transposes to G#
  E transposes to A#

Transposing from Gb to C:
  Gb transposes to C
  Ab transposes to D
  Bb transposes to E
  Cb transposes to F
  Db transposes to G
  Eb transposes to A
  F transposes to B

Transposing from Gb to Db:
  Gb transposes to Db
  Ab transposes to Eb
  Bb transposes to F
  Cb transposes to Gb
  Db transposes to Ab
  Eb transposes to Bb
  F transposes to C

Transposing from Gb to D:
  Gb transposes to D
  Ab transposes to E
  Bb transposes to F#
  Cb transposes to G
  Db transposes to A
  Eb transposes to B
  F transposes to C#

Transposing from Gb to Eb:
  Gb transposes to Eb
  Ab transposes to F
  Bb transposes to G
  Cb transposes to Ab
  Db transposes to Bb
  Eb transposes to C
  F transposes to D

Transposing from Gb to E:
  Gb transposes to E
  Ab transposes to F#
  Bb transposes to G#
  Cb transposes to A
  Db transposes to B
  Eb transposes to C#
  F transposes to D#

Transposing from Gb to F:
  Gb transposes to F
  Ab transposes to G
  Bb transposes to A
  Cb transposes to Bb
  Db transposes to C
  Eb transposes to D
  F transposes to E

Transposing from Gb to Gb:
  Gb transposes to Gb
  Ab transposes to Ab
  Bb transposes to Bb
  Cb transposes to Cb
  Db transposes to Db
  Eb transposes to Eb
  F transposes to F

Transposing from Gb to G:
  Gb transposes to G
  Ab transposes to A
  Bb transposes to B
  Cb transposes to C
  Db transposes to D
  Eb transposes to E
  F transposes to F#

Transposing from Gb to Ab:
  Gb transposes to Ab
  Ab transposes to Bb
  Bb transposes to C
  Cb transposes to Db
  Db transposes to Eb
  Eb transposes to F
  F transposes to G

Transposing from Gb to A:
  Gb transposes to A
  Ab transposes to B
  Bb transposes to C#
  Cb transposes to D
  Db transposes to E
  Eb transposes to F#
  F transposes to G#

Transposing from Gb to Bb:
  Gb transposes to Bb
  Ab transposes to C
  Bb transposes to D
  Cb transposes to Eb
  Db transposes to F
  Eb transposes to G
  F transposes to A

Transposing from Gb to B:
  Gb transposes to B
  Ab transposes to C#
  Bb transposes to D#
  Cb transposes to E
  Db transposes to F#
  Eb transposes to G#
  F transposes to A#

Transposing from G to C:
  G transposes to C
  A transposes to D
  B transposes to E
  C transposes to F
  D transposes to G
  E transposes to A
  F# transposes to B

Transposing from G to Db:
  G transposes to Db
  A transposes to Eb
  B transposes to F
  C transposes to Gb
  D transposes to Ab
  E transposes to Bb
  F# transposes to C

Transposing from G to D:
  G transposes to D
  A transposes to E
  B transposes to F#
  C transposes to G
  D transposes to A
  E transposes to B
  F# transposes to C#

Transposing from G to Eb:
  G transposes to Eb
  A transposes to F
  B transposes to G
  C transposes to Ab
  D transposes to Bb
  E transposes to C
  F# transposes to D

Transposing from G to E:
  G transposes to E
  A transposes to F#
  B transposes to G#
  C transposes to A
  D transposes to B
  E transposes to C#
  F# transposes to D#

Transposing from G to F:
  G transposes to F
  A transposes to G
  B transposes to A
  C transposes to Bb
  D transposes to C
  E transposes to D
  F# transposes to E

Transposing from G to Gb:
  G transposes to Gb
  A transposes to Ab
  B transposes to Bb
  C transposes to Cb
  D transposes to Db
  E transposes to Eb
  F# transposes to F

Transposing from G to G:
  G transposes to G
  A transposes to A
  B transposes to B
  C transposes to C
  D transposes to D
  E transposes to E
  F# transposes to F#

Transposing from G to Ab:
  G transposes to Ab
  A transposes to Bb
  B transposes to C
  C transposes to Db
  D transposes to Eb
  E transposes to F
  F# transposes to G

Transposing from G to A:
  G transposes to A
  A transposes to B
  B transposes to C#
  C transposes to D
  D transposes to E
  E transposes to F#
  F# transposes to G#

Transposing from G to Bb:
  G transposes to Bb
  A transposes to C
  B transposes to D
  C transposes to Eb
  D transposes to F
  E transposes to G
  F# transposes to A

Transposing from G to B:
  G transposes to B
  A transposes to C#
  B transposes to D#
  C transposes to E
  D transposes to F#
  E transposes to G#
  F# transposes to A#

Transposing from Ab to C:
  Ab transposes to C
  Bb transposes to D
  C transposes to E
  Db transposes to F
  Eb transposes to G
  F transposes to A
  G transposes to B

Transposing from Ab to Db:
  Ab transposes to Db
  Bb transposes to Eb
  C transposes to F
  Db transposes to Gb
  Eb transposes to Ab
  F transposes to Bb
  G transposes to C

Transposing from Ab to D:
  Ab transposes to D
  Bb transposes to E
  C transposes to F#
  Db transposes to G
  Eb transposes to A
  F transposes to B
  G transposes to C#

Transposing from Ab to Eb:
  Ab transposes to Eb
  Bb transposes to F
  C transposes to G
  Db transposes to Ab
  Eb transposes to Bb
  F transposes to C
  G transposes to D

Transposing from Ab to E:
  Ab transposes to E
  Bb transposes to F#
  C transposes to G#
  Db transposes to A
  Eb transposes to B
  F transposes to C#
  G transposes to D#

Transposing from Ab to F:
  Ab transposes to F
  Bb transposes to G
  C transposes to A
  Db transposes to Bb
  Eb transposes to C
  F transposes to D
  G transposes to E

Transposing from Ab to Gb:
  Ab transposes to Gb
  Bb transposes to Ab
  C transposes to Bb
  Db transposes to Cb
  Eb transposes to Db
  F transposes to Eb
  G transposes to F

Transposing from Ab to G:
  Ab transposes to G
  Bb transposes to A
  C transposes to B
  Db transposes to C
  Eb transposes to D
  F transposes to E
  G transposes to F#

Transposing from Ab to Ab:
  Ab transposes to Ab
  Bb transposes to Bb
  C transposes to C
  Db transposes to Db
  Eb transposes to Eb
  F transposes to F
  G transposes to G

Transposing from Ab to A:
  Ab transposes to A
  Bb transposes to B
  C transposes to C#
  Db transposes to D
  Eb transposes to E
  F transposes to F#
  G transposes to G#

Transposing from Ab to Bb:
  Ab transposes to Bb
  Bb transposes to C
  C transposes to D
  Db transposes to Eb
  Eb transposes to F
  F transposes to G
  G transposes to A

Transposing from Ab to B:
  Ab transposes to B
  Bb transposes to C#
  C transposes to D#
  Db transposes to E
  Eb transposes to F#
  F transposes to G#
  G transposes to A#

Transposing from A to C:
  A transposes to C
  B transposes to D
  C# transposes to E
  D transposes to F
  E transposes to G
  F# transposes to A
  G# transposes to B

Transposing from A to Db:
  A transposes to Db
  B transposes to Eb
  C# transposes to F
  D transposes to Gb
  E transposes to Ab
  F# transposes to Bb
  G# transposes to C

Transposing from A to D:
  A transposes to D
  B transposes to E
  C# transposes to F#
  D transposes to G
  E transposes to A
  F# transposes to B
  G# transposes to C#

Transposing from A to Eb:
  A transposes to Eb
  B transposes to F
  C# transposes to G
  D transposes to Ab
  E transposes to Bb
  F# transposes to C
  G# transposes to D

Transposing from A to E:
  A transposes to E
  B transposes to F#
  C# transposes to G#
  D transposes to A
  E transposes to B
  F# transposes to C#
  G# transposes to D#

Transposing from A to F:
  A transposes to F
  B transposes to G
  C# transposes to A
  D transposes to Bb
  E transposes to C
  F# transposes to D
  G# transposes to E

Transposing from A to Gb:
  A transposes to Gb
  B transposes to Ab
  C# transposes to Bb
  D transposes to Cb
  E transposes to Db
  F# transposes to Eb
  G# transposes to F

Transposing from A to G:
  A transposes to G
  B transposes to A
  C# transposes to B
  D transposes to C
  E transposes to D
  F# transposes to E
  G# transposes to F#

Transposing from A to Ab:
  A transposes to Ab
  B transposes to Bb
  C# transposes to C
  D transposes to Db
  E transposes to Eb
  F# transposes to F
  G# transposes to G

Transposing from A to A:
  A transposes to A
  B transposes to B
  C# transposes to C#
  D transposes to D
  E transposes to E
  F# transposes to F#
  G# transposes to G#

Transposing from A to Bb:
  A transposes to Bb
  B transposes to C
  C# transposes to D
  D transposes to Eb
  E transposes to F
  F# transposes to G
  G# transposes to A

Transposing from A to B:
  A transposes to B
  B transposes to C#
  C# transposes to D#
  D transposes to E
  E transposes to F#
  F# transposes to G#
  G# transposes to A#

Transposing from Bb to C:
  Bb transposes to C
  C transposes to D
  D transposes to E
  Eb transposes to F
  F transposes to G
  G transposes to A
  A transposes to B

Transposing from Bb to Db:
  Bb transposes to Db
  C transposes to Eb
  D transposes to F
  Eb transposes to Gb
  F transposes to Ab
  G transposes to Bb
  A transposes to C

Transposing from Bb to D:
  Bb transposes to D
  C transposes to E
  D transposes to F#
  Eb transposes to G
  F transposes to A
  G transposes to B
  A transposes to C#

Transposing from Bb to Eb:
  Bb transposes to Eb
  C transposes to F
  D transposes to G
  Eb transposes to Ab
  F transposes to Bb
  G transposes to C
  A transposes to D

Transposing from Bb to E:
  Bb transposes to E
  C transposes to F#
  D transposes to G#
  Eb transposes to A
  F transposes to B
  G transposes to C#
  A transposes to D#

Transposing from Bb to F:
  Bb transposes to F
  C transposes to G
  D transposes to A
  Eb transposes to Bb
  F transposes to C
  G transposes to D
  A transposes to E

Transposing from Bb to Gb:
  Bb transposes to Gb
  C transposes to Ab
  D transposes to Bb
  Eb transposes to Cb
  F transposes to Db
  G transposes to Eb
  A transposes to F

Transposing from Bb to G:
  Bb transposes to G
  C transposes to A
  D transposes to B
  Eb transposes to C
  F transposes to D
  G transposes to E
  A transposes to F#

Transposing from Bb to Ab:
  Bb transposes to Ab
  C transposes to Bb
  D transposes to C
  Eb transposes to Db
  F transposes to Eb
  G transposes to F
  A transposes to G

Transposing from Bb to A:
  Bb transposes to A
  C transposes to B
  D transposes to C#
  Eb transposes to D
  F transposes to E
  G transposes to F#
  A transposes to G#

Transposing from Bb to Bb:
  Bb transposes to Bb
  C transposes to C
  D transposes to D
  Eb transposes to Eb
  F transposes to F
  G transposes to G
  A transposes to A

Transposing from Bb to B:
  Bb transposes to B
  C transposes to C#
  D transposes to D#
  Eb transposes to E
  F transposes to F#
  G transposes to G#
  A transposes to A#

Transposing from B to C:
  B transposes to C
  C# transposes to D
  D# transposes to E
  E transposes to F
  F# transposes to G
  G# transposes to A
  A# transposes to B

Transposing from B to Db:
  B transposes to Db
  C# transposes to Eb
  D# transposes to F
  E transposes to Gb
  F# transposes to Ab
  G# transposes to Bb
  A# transposes to C

Transposing from B to D:
  B transposes to D
  C# transposes to E
  D# transposes to F#
  E transposes to G
  F# transposes to A
  G# transposes to B
  A# transposes to C#

Transposing from B to Eb:
  B transposes to Eb
  C# transposes to F
  D# transposes to G
  E transposes to Ab
  F# transposes to Bb
  G# transposes to C
  A# transposes to D

Transposing from B to E:
  B transposes to E
  C# transposes to F#
  D# transposes to G#
  E transposes to A
  F# transposes to B
  G# transposes to C#
  A# transposes to D#

Transposing from B to F:
  B transposes to F
  C# transposes to G
  D# transposes to A
  E transposes to Bb
  F# transposes to C
  G# transposes to D
  A# transposes to E

Transposing from B to Gb:
  B transposes to Gb
  C# transposes to Ab
  D# transposes to Bb
  E transposes to Cb
  F# transposes to Db
  G# transposes to Eb
  A# transposes to F

Transposing from B to G:
  B transposes to G
  C# transposes to A
  D# transposes to B
  E transposes to C
  F# transposes to D
  G# transposes to E
  A# transposes to F#

Transposing from B to Ab:
  B transposes to Ab
  C# transposes to Bb
  D# transposes to C
  E transposes to Db
  F# transposes to Eb
  G# transposes to F
  A# transposes to G

Transposing from B to A:
  B transposes to A
  C# transposes to B
  D# transposes to C#
  E transposes to D
  F# transposes to E
  G# transposes to F#
  A# transposes to G#

Transposing from B to Bb:
  B transposes to Bb
  C# transposes to C
  D# transposes to D
  E transposes to Eb
  F# transposes to F
  G# transposes to G
  A# transposes to A

Transposing from B to B:
  B transposes to B
  C# transposes to C#
  D# transposes to D#
  E transposes to E
  F# transposes to F#
  G# transposes to G#
  A# transposes to A#

Key of A# is not a valid major key

Transposing from C to B:

Transposing from D to Bb:
  C is not a valid note in the D major scale
  A transposes to F
  H is not a valid note in the D major scale
  D transposes to Bb
My WA code

Code: Select all

Accepted
Last edited by r2ro on Fri Oct 17, 2014 1:13 am, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 595 - A Major Problem

Post by brianfry713 »

Your output in the post above is correct.
Input:

Code: Select all

C C# A B C D E F G *
*
Correct output:

Code: Select all

Transposing from C to C#:
  A transposes to A#
  B transposes to B#
  C transposes to C#
  D transposes to D#
  E transposes to E#
  F transposes to F#
  G transposes to G#
Check input and AC output for thousands of problems on uDebug!

r2ro
New poster
Posts: 38
Joined: Thu Sep 25, 2008 9:26 am

Re: 595 - A Major Problem

Post by r2ro »

Wow, thanks for that test case brianfry713. I made a quick assumption just because B# was considered as invalid (despite the fact that it is a valid, albeit unconventional scale) in the sample input.

But then, I misinterpreted this:
The scale will contain each letter from A to G once and only once, with the exception of first letter of the scale which repeated as the last letter of the scale.
So I forgot about some of the scales considered "unconventonal". Thanks! :lol:

Post Reply

Return to “Volume 5 (500-599)”