题解: 我们直接排序,然后就可以知道最后结果是如何得。我们要保证操作得数最小,所以要保证更多得数在原位上面数更多的保持不变。所以扫一遍找出需要移动的位置。 #include <bits/stdc++.h> //#define int long long using namespace std; typedef long long ll; const int N=1e5+10; int