跳到正文

个人记录

【学习笔记】对拍的艺术

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

文章信息

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

版本

  1. v1当前

Datamaker:

C++
#include<bits/stdc++.h>
using namespace std;
int main()
{
    mt19937 gen(time(0));
    uniform_int_distribution<> int1(3,8);
    uniform_double_distribution<> double1(1.0,8.0);
    int n=int1(gen);
    uniform_int_distribution<> int2(1,n);
    while(n--){
        cout<<int1(gen)<<' '<<int1(gen)<<'\n';
    }
    return 0;
}

Checker:

C++
#include<bits/stdc++.h>
using namespace std;
int main()
{
    while(1)
	{
        system("datamaker.exe > 样例.in");
        system("测试程序.exe < 样例.in > 测试输出.out");
        system("对拍程序.exe < 样例.in > 标准输出.out");
        if(system("fc 测试输出.out 标准输出.out"))break;
    }
    return 0;
}

参考资料:https://blog.csdn.net/2401_83430722/article/details/144930204

原文