- BC20280008's blog
对拍板子
- @ 2026-5-2 13:39:09
#include <bits/stdc++.h>
using namespace std;
// 获取随机数种子
mt19937 rnd(chrono::system_clock::now().time_since_epoch().count());
// 生成 [l, r] 范围内的随机整数
int random(int l, int r) {
return uniform_int_distribution<int>(l, r)(rnd);
}
int main() {
int n = random(5, 10);
cout << n << endl;
int m=random(n, n+1);
cout<<n<<" "<<m<<endl;
for (int i = 1; i <= n; ++i) {
cout << random(1, 10000) << " \n"[i == n];
}
for (int i = 1; i <= m; ++i) {
cout << random(1, 10000) << " \n"[i == m];
}
cout << endl;
return 0;
}
我的程序 my.exe 暴力/标程 std.exe 数据生成器 gen.exe
.bat源码
@echo off
set cnt=0
:loop
gen.exe > in.txt
my.exe < in.txt > out1.txt
std.exe < in.txt > out2.txt
fc out1.txt out2.txt
if errorlevel 1 pause & exit
set /a cnt+=1
echo 已运行 %cnt% 次
if %cnt% equ 1000 goto end
goto loop
:end
echo 跑完1000次,全部正确
pause