COCI 2009/2010, Contest #1
Task NOTE
C major scale consists of 8 tones: c d e f g a b 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
First and only line of input will contain 8 integers, from 1 to 8 inclusive. Each integer will appear exactly once in the input.
Output
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.
Examples
Input1 2 3 4 5 6 7 8 Outputascending |
Input8 7 6 5 4 3 2 1 Outputdescending |
Input8 1 7 2 6 3 5 4 Outputmixed |
All Submissions
Best Solutions
Point Value: 3
Time Limit: 1.00s
Memory Limit: 32M
Added: Jul 02, 2013
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)