Minimum method
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 64 megabytes
The array is sorted with selection sort in ascending order. How many times does the first element in initial array change its position?
Input
The first line contains the number of elements in array n (1 ≤ n ≤ 1000). The second line contains the elements of array. It is known that all elements in array are different and not greater than 10^9
by absolute value.
Output
Print the number of movements of the first element.
Examples
Input #1
Answer #1
Input #2
Answer #2
Input #3
Answer #3
Submissions 8K
Acceptance rate 35%