Browse Source

超时提醒但允许实行,最多允许10倍的计算时间

master
richie 5 years ago
parent
commit
a1ee7cc38a
  1. 6
      src/runner/judge.ts

6
src/runner/judge.ts

@ -171,7 +171,7 @@ export async function judgeStandard(task: StandardRunTask)
const [resultPromise] = await runProgram(language, const [resultPromise] = await runProgram(language,
binaryDirectory, binaryDirectory,
workingDir, workingDir,
task.time, task.time * 10,
task.memory * 1024 * 1024, task.memory * 1024 * 1024,
stdinRedirectionName, stdinRedirectionName,
stdoutRedirectionName, stdoutRedirectionName,
@ -184,7 +184,9 @@ export async function judgeStandard(task: StandardRunTask)
memory = runResult.result.memory / 1024; memory = runResult.result.memory / 1024;
let status: TestcaseResultType = null, message = null; let status: TestcaseResultType = null, message = null;
if (runResult.outputLimitExceeded) { if (time > task.time) {
status = TestcaseResultType.TimeLimitExceeded;
} else if (runResult.outputLimitExceeded) {
status = TestcaseResultType.OutputLimitExceeded; status = TestcaseResultType.OutputLimitExceeded;
} else if (runResult.result.status === SandboxStatus.TimeLimitExceeded) { } else if (runResult.result.status === SandboxStatus.TimeLimitExceeded) {
status = TestcaseResultType.TimeLimitExceeded; status = TestcaseResultType.TimeLimitExceeded;

Loading…
Cancel
Save