有趣的排列
No testdata at current.
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
度度熊有一个N个数的数组,他想将数组从小到大排好序,但是萌萌的度度熊只会下面这个操作:任取数组中的一个数然后将它放置在数组的最后一个位置。问最少操作多少次可以使得数组从小到大有序?
输入输出说明
输入说明
首先输入一个正整数N,接下来的一行输入N个整数。(N <= 100000)。
输出说明
输出一个整数表示最少的操作次数。
题目样例
样例输入
4
19 7 8 25
样例输出
2
数据范围
对于100%数据满足, N <= 100000
P3阶段测试
- Status
- Done
- Rule
- IOI
- Problem
- 6
- Start at
- 2026-3-14 13:15
- End at
- 2026-3-14 15:15
- Duration
- 2 hour(s)
- Host
- Partic.
- 9