C2011AA - Warmup Problem A
One of the trickiest problems in computer programming is sorting. You will spend hours of effort trying to obtain a sort that runs both quickly and correctly. Sometimes the latter is challenging. Write a program that determines if an input sequence is indeed sorted in ascending order.
Input Specification
On the first line of the input is T, the number of test cases. For each test case, the first line is N, the number of list elements. N elements follow, each an integer.
Output Specification
On a separate line for each test case, in order, output "PASS" if the input is indeed sorted in ascending order; otherwise, output "FAIL".
Constraints
0 <= T <= 100
0 <= N <= 10000
Each integer is in the range of signed 32-bit integers.
Example Input
3 1 5 2 5 2 3 1 2 3
Example Output
PASS FAIL PASS
Explanation
Sequence #1 only has one element. It is trivially sorted. Sequence #2 is (5,2), which is sorted, but not in ascending order. No number for Jakucha. Sequence #3 is (1, 2, 3). If you don't think this is sorted, you should probably not be participating in this class.
Added by: | octalc0de |
Date: | 2011-09-29 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 |
Resource: | self |