cswork / OA打开练习工作台

Capital OneOA #14

Cyclic Shift to Strictly Descending Array

估计简单可在线判题

考点(AI 标注)原地数组

Given an integer array nums and the right-rotation amount t for this run, move the last t elements to the front of the array once and determine whether the result is strictly decreasing. t is a given input value and does not need to be chosen.

输入格式

The first line contains n (this site adopts the source's suggested range 1≤n≤200000), the second line contains n integers nums[i] (this site adopts the source's suggested range |nums[i]|≤10^9), and the third line contains t (this site adopts the source's suggested range 0≤t<n).

输出格式

Output true or false.

样例 1

输入:

3
3 2 1
0

输出:

true

样例 2

输入:

3
1 3 2
1

输出:

false

样例 3

输入:

3
2 1 3
2

输出:

false