跳到正文

个人记录

对拍

GEH_gugugugu42约 1 分钟
原文
文章信息与版本

文章信息

收录
2026年2月10日
更新
2026年2月10日
篇幅
约 1 分钟

版本

  1. v2当前
  2. v1

食用说明

当你更改代码时,

一定要先运行

一定要先运行

一定要先运行

(重要的事情说三遍)

随机数生成器:

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	mt19937 rnd(chrono::system_clock::now().time_since_epoch().count());
	uniform_int_distribution<int> dis(1,1000000);//生成1~1e6的随机数
	cout<<dis(rnd);
	return 0;
}

对拍器:

C++
#include<bits/stdc++.h>
using namespace std;
int main(){
	int id=0;
	while(1){
		system("输入 > rand.txt");
		//rand.txt:即输入
		system("正确代码 < rand.txt > ac.txt");
		//std.txt:正确的输出
		system("检查代码 < rand.txt > check.txt");
		//test.txt:我的输出
		if(!system("fc ac.txt check.txt")){
			cout<<++id<<":AC了\n";
		}
		else{
			cout<<++id<<":你码WA了\n";
			break;
		}
	}
	return 0;
}
原文