mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
feat(judge): set executionTime as max testcase runtime on AC
This commit is contained in:
parent
e7ad3a66e6
commit
03c47f76d2
@ -335,6 +335,7 @@ async function run(
|
|||||||
testcases: TestcaseWithDetails,
|
testcases: TestcaseWithDetails,
|
||||||
): Promise<Submission> {
|
): Promise<Submission> {
|
||||||
let finalSubmission: Submission | null = null;
|
let finalSubmission: Submission | null = null;
|
||||||
|
let maxExecutionTime = 0;
|
||||||
|
|
||||||
for (const testcase of testcases) {
|
for (const testcase of testcases) {
|
||||||
const sortedData = testcase.data.sort((a, b) => a.index - b.index);
|
const sortedData = testcase.data.sort((a, b) => a.index - b.index);
|
||||||
@ -495,6 +496,8 @@ async function run(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
return finalSubmission;
|
return finalSubmission;
|
||||||
|
} else {
|
||||||
|
maxExecutionTime = Math.max(maxExecutionTime, result.executionTime ?? 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -503,6 +506,7 @@ async function run(
|
|||||||
data: {
|
data: {
|
||||||
status: Status.AC,
|
status: Status.AC,
|
||||||
message: "All testcases passed",
|
message: "All testcases passed",
|
||||||
|
executionTime: maxExecutionTime,
|
||||||
},
|
},
|
||||||
include: {
|
include: {
|
||||||
TestcaseResult: true,
|
TestcaseResult: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user