diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index a8d97057..6e5c7ba7 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.22.0", + "version": "2.22.1", "main": "package.json", "author": "undefined ", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/judge/default.ts b/packages/hydrojudge/src/judge/default.ts index 2a520aef..2c6de2eb 100644 --- a/packages/hydrojudge/src/judge/default.ts +++ b/packages/hydrojudge/src/judge/default.ts @@ -50,8 +50,8 @@ function judgeCase(c: NormalizedCase, sid: string) { stdin, copyIn, copyOutCached, - time: ctxSubtask.subtask.time * ctx.execute.time, - memory: ctxSubtask.subtask.memory, + time: c.time * ctx.execute.time, + memory: c.memory, cacheStdoutAndStderr: true, }, ); @@ -63,9 +63,9 @@ function judgeCase(c: NormalizedCase, sid: string) { let message: any = ''; let score = 0; if (status === STATUS.STATUS_ACCEPTED) { - if (time_usage_ms > ctxSubtask.subtask.time * ctx.execute.time) { + if (time_usage_ms > c.time * ctx.execute.time) { status = STATUS.STATUS_TIME_LIMIT_EXCEEDED; - } else if (memory_usage_kb > ctxSubtask.subtask.memory * 1024) { + } else if (memory_usage_kb > c.memory * 1024) { status = STATUS.STATUS_MEMORY_LIMIT_EXCEEDED; } else { [status, score, message] = await check({ diff --git a/packages/hydrojudge/src/judge/interactive.ts b/packages/hydrojudge/src/judge/interactive.ts index a05a8141..a2201a17 100644 --- a/packages/hydrojudge/src/judge/interactive.ts +++ b/packages/hydrojudge/src/judge/interactive.ts @@ -25,14 +25,14 @@ function judgeCase(c: NormalizedCase) { { execute: ctx.executeUser.execute, copyIn: ctx.executeUser.copyIn, - time: ctxSubtask.subtask.time * ctx.executeUser.time, - memory: ctxSubtask.subtask.memory, + time: c.time * ctx.executeUser.time, + memory: c.memory, }, { execute: `${ctx.executeInteractor.execute} /w/in /w/tout /w/out`, copyIn: ctx.executeInteractor.copyIn, - time: ctxSubtask.subtask.time * 2 * ctx.executeInteractor.time, - memory: ctxSubtask.subtask.memory * 2, + time: c.time * 2 * ctx.executeInteractor.time, + memory: c.memory * 2, copyOut: ['/w/tout?'], env: { ...ctx.env, HYDRO_TESTCASE: c.id.toString() }, }, @@ -41,9 +41,9 @@ function judgeCase(c: NormalizedCase) { let status: number; let score = 0; let message: any = ''; - if (time_usage_ms > ctxSubtask.subtask.time * ctx.executeUser.time) { + if (time_usage_ms > c.time * ctx.executeUser.time) { status = STATUS.STATUS_TIME_LIMIT_EXCEEDED; - } else if (memory_usage_kb > ctxSubtask.subtask.memory * 1024) { + } else if (memory_usage_kb > c.memory * 1024) { status = STATUS.STATUS_MEMORY_LIMIT_EXCEEDED; } else if ((code && code !== 13/* Broken Pipe */) || (code === 13 && !resInteractor.code)) { status = STATUS.STATUS_RUNTIME_ERROR;