From 03c47f76d2372e3686482cbe0749c9c850ad653f Mon Sep 17 00:00:00 2001 From: cfngc4594 Date: Sun, 13 Apr 2025 13:39:36 +0800 Subject: [PATCH] feat(judge): set executionTime as max testcase runtime on AC --- src/actions/judge.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/actions/judge.ts b/src/actions/judge.ts index 6127bc5..32a7d07 100644 --- a/src/actions/judge.ts +++ b/src/actions/judge.ts @@ -335,6 +335,7 @@ async function run( testcases: TestcaseWithDetails, ): Promise { let finalSubmission: Submission | null = null; + let maxExecutionTime = 0; for (const testcase of testcases) { const sortedData = testcase.data.sort((a, b) => a.index - b.index); @@ -495,6 +496,8 @@ async function run( } }); return finalSubmission; + } else { + maxExecutionTime = Math.max(maxExecutionTime, result.executionTime ?? 0); } } } @@ -503,6 +506,7 @@ async function run( data: { status: Status.AC, message: "All testcases passed", + executionTime: maxExecutionTime, }, include: { TestcaseResult: true,