[구현] NOTE

2011. 1. 10. 13:09Algospot/구현

출처 : algospot.com
Time Limit: 1000 msMemory Limit: 65536 kb

 C major scale consists of 8 tones: c d e f g a h C. For this task we number the notes using numbers 1 through 8. The scale can be played ascending, from 1 to 8, descending, from 8 to 1, or mixed. Write a program that, given the sequence of notes, determines wether the scale was played ascending, descending or mixed.
Input Specification
 First and only line of input will contain 8 integers, from 1 to 8 inclusive. Each integer will appear exactley once in the input.


Output Specification
In the first and only line of input print "descending" if the scale was played descending, "ascending" if the scale was played ascending and "mixed" if the scale was played mixed.

Sample Input

2
4
1 2 3 4
8 6 7 5
3
-1 0 1
-1 -1 -1

Sample Output

16
3


_M#]



'Algospot > 구현' 카테고리의 다른 글

[구현] Lecture Note  (0) 2011.01.18
[구현] Hello World!  (0) 2011.01.10