跳到正文

个人记录

对拍

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

文章信息

发布
2026年8月22日
收录
2026年9月6日
更新
2026年11月6日
篇幅
约 1 分钟

版本

  1. v1当前

在同一个文件夹写如下代码

  1. 数据生成器
C++
//以a+b为例
#include <bits/stdc++.h>
using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
  srand(time(0));
	int a=rand()%20000+1;
	int b=rand()%20000+1;
	cout<<a<<" "<<b<<"\n";
}
  1. 暴力(对拍时用的正解,一定要写对)
  2. 待对拍代码 以上三个代码写完后都要运行一下
  3. 对拍.bai
bat
:loop
	gen > 1.txt
	std < 1.txt > 2.txt
	bl < 1.txt > 3.txt
	fc 2.txt 3.txt
	if errorlevel 1 pause 
goto loop
原文