考前须知

· · 个人记录

注意事项

常用命令 & 技巧

比较文件

假设你要比较 A 和 B。

  1. 右键 A,选择“Select for Compare”。

  2. 右键 B,选择“Compare with Selected”。

  3. 结果会显示在右边。A 在左,B 在右。

对拍

假设 gen.cpp 往 input.txt 里生成数据,std.cpp 为保证正确性的解(输出到 answer.txt),sol.cpp 为需要对拍的解(输出到 output.txt)。

#include <cstdlib>

using namespace std;
using i64 = long long;

int main()
{
    system("g++ gen.cpp -o gen -std=c++14 -Ofast");
    system("g++ std.cpp -o std -std=c++14 -Ofast");
    system("g++ sol.cpp -o sol -std=c++14 -O2");

    while (true) {
        system("./gen");
        system("./std");
        system("./sol");

        if (system("diff output.txt answer.txt -Z"))
            break;
    }

    return 0;
}