This commit is contained in:
LiYang 2016-10-04 12:56:22 +08:00
parent d23bacd8d5
commit 2d09134192
3 changed files with 3 additions and 3 deletions

View File

@ -129,7 +129,7 @@ PyMODINIT_FUNC init_judger(void) {
PyModule_AddIntConstant(module, "VERSION", VERSION);
PyModule_AddIntConstant(module, "UNLIMITED", UNLIMITED);
PyModule_AddIntConstant(module, "RESULT_SUCCESS", SUCCESS);
PyModule_AddIntConstant(module, "RESULT_CPU_TIME_LIMIT_EXCEEDED", CPU_TIME_LIMITED);
PyModule_AddIntConstant(module, "RESULT_CPU_TIME_LIMIT_EXCEEDED", CPU_TIME_LIMITED_EXCEEDED);
PyModule_AddIntConstant(module, "RESULT_REAL_TIME_LIMIT_EXCEEDED", REAL_TIME_LIMIT_EXCEEDED);
PyModule_AddIntConstant(module, "RESULT_MEMORY_LIMIT_EXCEEDED", MEMORY_LIMIT_EXCEEDED);
PyModule_AddIntConstant(module, "RESULT_RUNTIME_ERROR", RUNTIME_ERROR);

View File

@ -146,7 +146,7 @@ void run(struct config *_config, struct result *_result) {
_result->result = REAL_TIME_LIMIT_EXCEEDED;
}
if (_config->max_cpu_time != UNLIMITED && _result->cpu_time > _config->max_cpu_time) {
_result->result = CPU_TIME_LIMITED;
_result->result = CPU_TIME_LIMITED_EXCEEDED;
}
log_close(log_fp);

View File

@ -55,7 +55,7 @@ struct config {
enum {
CPU_TIME_LIMITED = 1,
CPU_TIME_LIMITED_EXCEEDED = 1,
REAL_TIME_LIMIT_EXCEEDED = 2,
MEMORY_LIMIT_EXCEEDED = 3,
RUNTIME_ERROR = 4,