对拍

有关对拍#

prework#

你需要随机数生成器.exe,sol.exe,bruteforce.exe,以及对拍.exe

code#

//rand.cpp
#include<bits/stdc++.h>
using namespace std;

#define int long long 

const int mod=1e9;

signed main(){
	freopen("in.in","w",stdout);
	int x=rand()*rand()%mod*rand()%mod*rand()%mod+1;
	int y=rand()*rand()%mod*rand()%mod*rand()%mod+1;
	cout<<x<<" "<<y<<endl;
}

//sol.cpp
#include<bits/stdc++.h>
int main()
{	
	freopen("in.in","r",stdin);
	freopen("1.out","w",stdout);
    int a,b;
    scanf("%d%d",&a,&b);
    printf("%d",a+b);
    return 0;
}

//bruteforce.cpp
#include<bits/stdc++.h>
using namespace std;
int main()
{	
	freopen("in.in","r",stdin);
	freopen("2.out","w",stdout);
    int a,b;
    cin>>a>>b;
    cout<<a+b;
    return 0;
}

//duipai.cpp
#include<bits/stdc++.h>
using namespace std;

inline int read(){
	int x=0,f=1;
	char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(isdigit(ch)){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}

int main(){
	freopen("result.out","w",stdout);
	for(int T=1;T<=10000;++T){
		system("D:\\rand.exe");
		double st=clock();
		system("D:\\sol.exe");
		double ed=clock();
		system("D:\\vio.exe");
		if(system("fc D:\\1.out D:\\2.out")){
			printf("Wrong Answer on #%d test, use time: %.01fms\n",T,ed-st);
			return 0;
		}
		else{
			printf("Accpeted on #%d test, use time: %.01fms\n",T,ed-st);
		}
	}	
}

duipai#

这个时候你只需要运行duipai.exe就可以了!

P.S. 所有文件都得放在同一个目录下

作者:Into_qwq

出处:https://www.cnblogs.com/into-qwq/p/16460109.html

版权:本作品采用「qwq」许可协议进行许可。

posted @   Into_qwq  阅读(25)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享一个免费、快速、无限量使用的满血 DeepSeek R1 模型,支持深度思考和联网搜索!
· 使用C#创建一个MCP客户端
· ollama系列1:轻松3步本地部署deepseek,普通电脑可用
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 按钮权限的设计及实现
more_horiz
keyboard_arrow_up dark_mode palette
选择主题
menu
点击右上角即可分享
微信分享提示