跳到正文

个人记录

考场技巧

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

文章信息

收录
2025年12月12日
更新
2026年8月11日
篇幅
约 3 分钟

版本

  1. v1当前

快速测试大样例:

C++
#include <bits/stdc++.h>
#include <windows.h>
using namespace std;
string s;
int n;
int main() {
  cin >> s >> n;
  cout << "Checker : " << s << '\n';
  for (int i = 1; i <= n; i++) {
    string cnt = s;
    cnt += ".exe < ", cnt += s, cnt += to_string(i), cnt += ".in > ", cnt += s, cnt += to_string(i), cnt += ".out";
    system(cnt.c_str());
    cout << "Juding in:#" << to_string(i) << '\n';
    cnt = "fc ";
    cnt += s, cnt += to_string(i), cnt += ".ans ";
    cnt += s, cnt += to_string(i), cnt += ".out";
    if (system(cnt.c_str()))
      cout << "WA on test#" << to_string(i) << '\n';
    else
      cout << "Ac on test#" << to_string(i) << '\n';
  }
  string flag;
  int x = 0;
  while (1) {
    if (x % 100 == 0) {
      cout << "Check : Whether to proceed with the shoot?\n";
      cin >> flag;
      if (flag == "No") return 0;
    }
    system("data.exe > in.txt");
    system("baoli.exe < in.txt > baoli.txt");
    string cnt = s;
    cnt += ".exe < in.txt > std.txt";
    system(cnt.c_str());
    x++;
    cout << "Checking in : #" << to_string(x) << '\n';
    if (system("fc baoli.txt std.txt")) {
      cout << "WA on test# " << x << '\n';
      return 0;
    } else {
      cout << "AC on test# " << x << '\n';
    }
  }
  return 0;
}

原文