首先我们遇见注释,也就是文章说明, 怪长的删了吧哈哈哈
然后看到
const int EXITCODE_AC = 42;
const int EXITCODE_WA = 43;
改成这丫子,好像是因为, 42代表字符’0’,阿斯卡码什么的。
const int EXITCODE_AC = 0;
const int EXITCODE_WA = 1;
跟上面一样,将ac改成0,wa改成1
看到这个东东:
std::ifstream judge_in, judge_ans;
std::istream author_out(std::cin.rdbuf());
改成这样丫子:
std::ifstream judge_in, judge_ans;
std::ifstream author_out;
然后接着看:
将这两个函数中的
void wrong_answer(const std::string &msg, ...) {
va_list pvar;
va_start(pvar, msg);
vreport_feedback(FILENAME_JUDGE_MESSAGE, msg, pvar);
exit(EXITCODE_WA);
}
void judge_error(const std::string &msg, ...) {
va_list pvar;
va_start(pvar, msg);
vreport_feedback(FILENAME_JUDGE_ERROR, msg, pvar);
assert(0);
}
注释掉。
va_list pvar;
va_start(pvar, msg);
vreport_feedback(FILENAME_JUDGE_ERROR, msg, pvar);
接着看:
void accept_with_score(double scorevalue) {
report_feedback(FILENAME_SCORE, "%.9le", scorevalue);
exit(EXITCODE_AC);
}
注释掉第一行:
void accept_with_score(double scorevalue) {
///report_feedback(FILENAME_SCORE, "%.9le", scorevalue);
exit(EXITCODE_AC);
}
然后看到init_io函数:
把前面这些:
if(argc < 4) {
fprintf(stderr, USAGE, argv[0]);
judge_error("Usage: %s judgein judgeans feedbackdir [opts] < userout", argv[0]);
}
// Set up feedbackdir first, as that allows us to produce feedback
// files for errors in the other parameters.
if (!is_directory(argv[3])) {
judge_error("%s: %s is not a directory\n", argv[0], argv[3]);
}
feedbackdir = argv[3];
删掉之后,改成这丫子、
void init_io(int argc, char **argv) {
judge_in.open(argv[1], std::ios_base::in);
if (judge_in.fail()) {
judge_error("%s: failed to open %s\n", argv[0], argv[1]);
}
judge_ans.open(argv[2], std::ios_base::in);
if (judge_ans.fail()) {
judge_error("%s: failed to open %s\n", argv[0], argv[2]);
}
author_out.open(argv[3], std::ios_base::in);
if (author_out.fail()) {
judge_error("%s: failed to open %s\n", argv[0], argv[3]);
}
}