random_device seed;
mt19937_64 e(clock());
template<class type>
type rand(type down, type up) {
uniform_int_distribution<type> rand(down, up);
return rand(e);
}
srand(seed());
int t = rand(5, 10);
for (int i = 1; i <= t; i++) {
int a = rand(1, n);
int b = rand(a, n);
random_shuffle(s + a, s + 1 + n);
random_shuffle(s + b, s + 1 + n);
}
有这样一段代码,但是我莫名发现s在这么一顿乱转之后转成原来的样子概率极高(>80%)。系统环境是 linux