白色低级对拍器

· · 个人记录

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

judger.cpp:

#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:

// 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:

自己写

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