HUSTOJ增加其他语言出现RuntimeError解决办法
HUSTOJ增加其他语言,如Python、Java、Pascal等等,如果程序是正确的,却报运行错误,添加okcall就行。
具体错误可以看日志:
[ERROR] A Not allowed system call: runid:运行编号 callid:id号
TO FIX THIS , ask admin to add the CALLID into corresponding LANG_XXV[] located at okcalls32/64.h ,and recompile judge_client
修改评测机okcall文件(如core/judge_client/okcall64.h),给对应的语言增加callid:后面的id号即可,尽量不用加在开头或者结尾,有些数组首尾是0的,可能有什么特别的含义呢!
CV是C语言;PV是Pascal语言;JV是Java语言;YV是Python语言……如果搞不清楚哪个V对应哪个语言,请看judge_client.cc源代码:
void init_syscalls_limits(int lang) {
int i;
memset(call_counter, 0, sizeof(call_counter));
if (DEBUG)
write_log("init_call_counter:%d", lang);
if (record_call) { // C & C++
for (i = 0; i < call_array_size; i++) {
call_counter[i] = 0;
}
} else if (lang <= 1) { // C & C++
for (i = 0; i==0||LANG_CV[i]; i++) {
call_counter[LANG_CV[i]] = HOJ_MAX_LIMIT;
}
} else if (lang == 2) { // Pascal
for (i = 0; i==0||LANG_PV[i]; i++)
call_counter[LANG_PV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 3) { // Java
for (i = 0; i==0||LANG_JV[i]; i++)
call_counter[LANG_JV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 4) { // Ruby
for (i = 0; i==0||LANG_RV[i]; i++)
call_counter[LANG_RV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 5) { // Bash
for (i = 0; i==0||LANG_BV[i]; i++)
call_counter[LANG_BV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 6) { // Python
for (i = 0; i==0||LANG_YV[i]; i++)
call_counter[LANG_YV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 7) { // php
for (i = 0; i==0||LANG_PHV[i]; i++)
call_counter[LANG_PHV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 8) { // perl
for (i = 0; i==0||LANG_PLV[i]; i++)
call_counter[LANG_PLV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 9) { // mono c#
for (i = 0; i==0||LANG_CSV[i]; i++)
call_counter[LANG_CSV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 10) { //objective c
for (i = 0; i==0||LANG_OV[i]; i++)
call_counter[LANG_OV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 11) { //free basic
for (i = 0; i==0||LANG_BASICV[i]; i++)
call_counter[LANG_BASICV[i]] = HOJ_MAX_LIMIT;
} else if (lang == 12) { //scheme guile
for (i = 0; i==0||LANG_SV[i]; i++)
call_counter[LANG_SV[i]] = HOJ_MAX_LIMIT;
}
}
上一篇: Mac下的Grapher是什么?Mac Grapher使用教程
下一篇: 一个同事讲的