跳到正文

算法·理论

对拍

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

文章信息

收录
2025年12月12日
更新
2025年12月12日
篇幅
约 2 分钟

版本

  1. v1当前

需对拍代码加这一句

C++
freopen("1.in","r",stdin);
freopen("sb.out","w",stdout);

//文件名:未命名1

标准代码加这一句

C++
freopen("1.in","r",stdin);
freopen("std.out","w",stdout);

//文件名:std

数据生成器(同类型替换)T619237

C++
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
ull randbe(ll l,ll r){
	ull shu=rand()*rand()+rand()*rand();
	return shu%(r-l+1)+l;
}
int main(){
	freopen("1.in","w",stdout);
	srand(time(0));
	int n=randbe(3,5);//数据范围(同类型替换)
	cout<<n<<'\n';
	for(int i=1;i<=n;i++){
		cout<<randbe(1,14)<<" ";
	}
	cout<<endl;
	for(int i=1;i<=n;i++){
		int op,l,r,c;
		op=randbe(0,1);
		l=randbe(1,n/2);
		r=randbe(1,n);
		c=randbe(1,14);
		cout<<op<<" "<<l<<" "<<r<<" "<<c<<endl;
	}
	return 0;
}


//文件名:simple

对拍器

C++
#include <bits/stdc++.h>
using namespace std;
int main(){
	while(1){
		system("simple.exe");
		system("未命名1.exe");
		system("std.exe");
		if(system("fc std.out sb.out"))
			system("pause");
		else system("cls");
	}

	return 0;
}

//文件名:check

都跑一遍后再用对拍器

原文