Code:
#include<cstdio> #include<algorithm> #include<ctime> #include<cstdlib> using namespace std; const int maxn = 2000; int arr[maxn]; int random(int n){ return (long long) rand() * rand() % n; } //生成一个 0 ~ n 的随机数 int main() { srand((unsigned) time(0)); //随机数种子 }