跳到正文

个人记录

造数据代码

ZSYhaouuan约 2 分钟
原文
文章信息与版本

文章信息

发布
2025年7月20日
收录
2025年12月12日
更新
2026年11月14日
篇幅
约 2 分钟

版本

  1. v2当前
  2. v1
C++
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
string file(int n, string io);

//可修改数据名
string name = "data", in = ".in", out = ".out";
void work(int z);
random_device rd;
mt19937 gen(rd());
ofstream rout, wout;

string getPath(int n, string io) {
	string id = to_string(n);
	string filename = name + id + io;
	return filename;
}
ll brand() {
	uniform_int_distribution<ll> dist(0, numeric_limits<ll>::max());
	return dist(gen);
}
double drand() {
	normal_distribution<double> dist(0.0, 3.0);
	return dist(gen);
}
int main() {
	for (int z = 1; z <= 10; z++) { //可修改次数
		remove(getPath(z, in).c_str()), rout.open(getPath(z, in), ios_base::app);
		remove(getPath(z, out).c_str()), wout.open(getPath(z, out), ios_base::app);
		work(z);
		cout << "data " << z << " succeed!" << endl;
		rout.close(), wout.close();
	}
}
//可修改代码
void work(int z) {

	return;
}
原文