문제 확인하기
2. 정답 코드 (python3, memory: 31120KB, time: 40ms)
music_notes = input().strip().split("|")
ade_minor_centers = ['A', 'D', 'E']
cfg_major_centers = ['C', 'F', 'G']
ade_minor_count = 0
cfg_major_count = 0
for measure in music_notes:
if measure[0] in ade_minor_centers:
ade_minor_count += 1
if measure[0] in cfg_major_centers:
cfg_major_count += 1
if ade_minor_count == cfg_major_count:
if music_notes[-1][-1] in cfg_major_centers:
cfg_major_count += 1
if music_notes[-1][-1] in ade_minor_centers:
ade_minor_count += 1
if ade_minor_count < cfg_major_count:
print("C-major")
else:
print("A-minor")