UVA-11942 - Lumberjack Sequencing
20 May 2018
- UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt。
- 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
- 本題選為「20160524 大學程式能力檢定 CPE」題目。
題意概要
本題給定將給定數筆測資,每筆測資皆有 個數字,試問:每筆測測資是否為「單調數列 (遞增或遞減數列)」?
- 分析:本題為簡單的排序概念問題。將題目給定數列中的數字兩兩比較,判斷是否符合「由小至大」或「由大至小」的規則即可。唯獨要注意的是,測資中可能會有連續一樣的數字。
Input
The input starts with line containing a single integer , , which is the number of groups to process. Following this are lines, each containing ten distinct positive integers less than .
Output
There is a title line, then one line per set of beard lengths. See the sample output for capitalization and punctuation.
Sample Input
3
13 25 39 40 55 62 68 77 88 95
88 62 77 20 40 10 99 56 45 36
91 78 61 59 54 49 43 33 26 18
Sample Output
Lumberjacks:
Ordered
Unordered
Ordered