随机数据模板

随机树

#include<bits/stdc++.h>
#define int long long
using namespace std;
int random(int x){
	return 1ll * rand() * rand() % x + 1;
}
int n = 1e5;
main(){
	freopen("sc.txt", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);
	srand(time(0));
	cout << n << endl;
	for(int i = 2; i <= n; i++)
		cout << random(i - 1) << " " << i << "\n";
}
posted @ 2024-02-05 16:09  louisliang  阅读(2)  评论(0编辑  收藏  举报