From a1ee7cc38a1e4e042c141985c8df5137c66accd7 Mon Sep 17 00:00:00 2001 From: richie Date: Mon, 1 Jul 2019 12:48:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E6=97=B6=E6=8F=90=E9=86=92=E4=BD=86?= =?UTF-8?q?=E5=85=81=E8=AE=B8=E5=AE=9E=E8=A1=8C=EF=BC=8C=E6=9C=80=E5=A4=9A?= =?UTF-8?q?=E5=85=81=E8=AE=B810=E5=80=8D=E7=9A=84=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/runner/judge.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/runner/judge.ts b/src/runner/judge.ts index caeb042..388a9b0 100644 --- a/src/runner/judge.ts +++ b/src/runner/judge.ts @@ -171,7 +171,7 @@ export async function judgeStandard(task: StandardRunTask) const [resultPromise] = await runProgram(language, binaryDirectory, workingDir, - task.time, + task.time * 10, task.memory * 1024 * 1024, stdinRedirectionName, stdoutRedirectionName, @@ -184,7 +184,9 @@ export async function judgeStandard(task: StandardRunTask) memory = runResult.result.memory / 1024; let status: TestcaseResultType = null, message = null; - if (runResult.outputLimitExceeded) { + if (time > task.time) { + status = TestcaseResultType.TimeLimitExceeded; + } else if (runResult.outputLimitExceeded) { status = TestcaseResultType.OutputLimitExceeded; } else if (runResult.result.status === SandboxStatus.TimeLimitExceeded) { status = TestcaseResultType.TimeLimitExceeded;