跳到正文

个人记录

对拍

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

文章信息

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

版本

  1. v1当前

假设考试时我的程序(疑似正解)

C++
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int a,b;
int main(){
	scanf("%d%d",&a,&b);
	printf("%d\n",a+b);
	return 0;
}

暴力程序

C++
#include<bits/stdc++.h>
using namespace std;
int a,b,s;
int main(){
	scanf("%d%d",&a,&b);
	while(a--) s++;
	while(b--) s++;
	printf("%d\n",s);
	return 0;
}

生成随机数程序

C++
#include<bits/stdc++.h>
using namespace std;
int a,b;
int main(){
	a=rand()%100005;
	b=rand()%10000;
	printf("%d %d",a,b);
	return 0;
}

对拍程序

C++
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int t,s;
int main(){
	while(true)
	{
		system("data.exe > in.txt");
		s=clock();
		system("my.exe < in.txt > out.txt");
		t=clock();
		system("std.exe < in.txt > std.txt");
		if(system("fc out.txt std.txt")) break;
		printf("AC time: %d\n",t-s);
	}
	printf("WA time: %d\n",t-s);
	return 0;
}

附上截图:

原文