跳到正文

个人记录

白色低级对拍器

Social_Zhao约 3 分钟
原文
文章信息与版本

文章信息

发布
2021年3月24日
收录
2025年12月12日
更新
2026年11月6日
篇幅
约 3 分钟
获赞
8

版本

  1. v1当前

怎么这么多人找我要对拍器啊自己写不行吗

judger.cpp:

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

int main() {
    //system("g++ datamaker.cpp -o datamaker.exe");
    cout << "datamaker compiled" << endl;
    //system("g++ std.cpp -o std.exe");
    cout << "std compiled" << endl;
    //system("g++ yours.cpp -o yours.exe");
    cout << "yours compiled" << endl;
    int T = 0;
    while(++T) {
        cout << "[info] testdata<" << T << ">" << endl;
        double a = clock() / 1000.0;

        system("datamaker.exe > data.in");           ///////////////////////////

        double b = clock() / 1000.0;
        cout << "[info] data made in " << b - a << "s" << endl;

        system("std.exe < data.in > exp.out");       ///////////////////////////

        double c = clock() / 1000.0;
        cout << "[info] std finished in " << c - b << "s" << endl;

        system("yours.exe < data.in > yours.out");   ///////////////////////////

        double d = clock() / 1000.0;
        cout << "[info] yours finished in " << d - c << "s" << endl;

        if(system("fc exp.out yours.out")) break;    ///////////////////////////

    }
}

datamaker.cpp:

C++
// CF997E
#include<bits/stdc++.h>
using namespace std;
int a[1919810];
int main() {
	srand(time(0));
	int n = 120000, m = 1;
	printf("%d\n", n);
	for(int i = 1; i <= n; i++) a[i] = i;
//	random_shuffle(a + 1, a + 1 + n);
	for(int i = 1; i <= n; i++) printf("%d ", a[i]); printf("\n");
	printf("%d\n", m);
	for(int i = 1; i <= m; i++) {
		int l = 1, r = n;
		printf("%d %d\n", min(l, r), max(l, r));
	}
	return 0;
}

std.cpp:

自己找

yours.cpp:

自己写


如果你能配置环境变量的话可以把前三个注释取了,否则每次运行前要手动编译。