2022-10-04 12:57:49 +00:00
|
|
|
#include "uoj_judger_v2.h"
|
2016-07-18 16:39:37 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv) {
|
|
|
|
main_judger_init(argc, argv);
|
2022-10-04 12:57:49 +00:00
|
|
|
|
|
|
|
runp::config rpc(conf_str("judger"), {
|
|
|
|
main_path, work_path, result_path, data_path
|
|
|
|
});
|
|
|
|
rpc.result_file_name = result_path / "run_judger_result.txt";
|
|
|
|
rpc.input_file_name = "/dev/null";
|
|
|
|
rpc.output_file_name = "/dev/null";
|
|
|
|
rpc.error_file_name = "stderr";
|
|
|
|
rpc.limits = conf_run_limit("judger", 0, RL_JUDGER_DEFAULT);
|
|
|
|
rpc.unsafe = true;
|
|
|
|
runp::result res = runp::run(rpc);
|
2023-02-05 02:23:46 +00:00
|
|
|
|
2022-10-04 12:57:49 +00:00
|
|
|
if (res.type != runp::RS_AC) {
|
2023-02-05 02:23:46 +00:00
|
|
|
stringstream msg;
|
|
|
|
|
|
|
|
msg << "Judgment Failed" << endl;
|
|
|
|
msg << "\n------\n" << endl;
|
|
|
|
msg << "Judger result: " << runp::rstype_str(res.type) << endl;
|
|
|
|
msg << "Extra message: " << res.extra << endl;
|
|
|
|
|
|
|
|
end_judge_judgment_failed(msg.str());
|
2016-07-18 16:39:37 +00:00
|
|
|
}
|
2023-02-05 02:23:46 +00:00
|
|
|
|
2016-07-18 16:39:37 +00:00
|
|
|
return 0;
|
|
|
|
}
|