#include<bits/stdc++.h>
#define Ll long long
using namespace std;
int main()
{
scanf("%d",&n);
srand(time(0));
for(int i=1;i<=n;i++)a[i]=i;
while(++sum<=1000)
random_shuffle(a+1,a+n+1);
}
这样可以让a数组重新随机排列一遍
#include<bits/stdc++.h>
#define Ll long long
using namespace std;
int main()
{
scanf("%d",&n);
srand(time(0));
for(int i=1;i<=n;i++)a[i]=i;
while(++sum<=1000)
random_shuffle(a+1,a+n+1);
}
这样可以让a数组重新随机排列一遍