acm写题板子§

solve.cpp§
#ifndef CAIKI_LOCAL
#include <bits/stdc++.h>
#endif

#ifdef CAIKI_LOCAL
#include <algorithm>
#include <cmath>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
#include <vector>

auto _ = []() {
    freopen("../io/in.txt", "r", stdin);
    freopen("../io/out.txt", "w", stdout);
    return true;
}();
#endif

#define int long long

void solve() {}

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int t = 1;
    std::cin >> t;

    while (t--) {
        solve();
    }

    return 0;
}
test.cpp§
#include <bits/stdc++.h>

int main() {
    int t = 10;

    system("g++ random.cpp -o ..\\bin\\random");
    system("g++ solve.cpp -o ..\\bin\\solve");
    system("g++ std.cpp -o ..\\bin\\std");

    std::cout << "Running tests...\n";

    for (int i = 0; i < t; i++) {
        system("..\\bin\\random.exe > ..\\io\\in.txt");
        system("..\\bin\\solve.exe < ..\\io\\in.txt > ..\\io\\out.txt");
        system("..\\bin\\std.exe < ..\\io\\in.txt > ..\\io\\std_out.txt");
        if (system(
                "chcp 65001 > nul & fc ..\\io\\out.txt ..\\io\\std_out.txt  > "
                "..\\io\\diff.log")) {
            std::cout << "Test case " << i + 1 << " failed\n";
            break;
        }
        std::cout << "Test case " << i + 1 << " passed\n";
    }

    return 0;
}