diff --git a/src/daemon/judge/submit-answer.ts b/src/daemon/judge/submit-answer.ts index 3b4311b..4f65f34 100644 --- a/src/daemon/judge/submit-answer.ts +++ b/src/daemon/judge/submit-answer.ts @@ -61,8 +61,8 @@ export class AnswerSubmissionJudger extends JudgerBase { } catch (err) { return { type: TestcaseResultType.FileError, - time: NaN, - memory: NaN, + time: null, + memory: null, scoringRate: 0, systemMessage: `Unable to open your answer: ${err.toString()}` } diff --git a/src/judgeResult.ts b/src/judgeResult.ts index 72e6c17..ffe5d2b 100644 --- a/src/judgeResult.ts +++ b/src/judgeResult.ts @@ -56,8 +56,11 @@ export function convertResult(id: number, source: OverallResult): JudgeResultSub } } else if (source.judge != null && source.judge.subtasks != null) { const forEveryTestcase = function (map: (v: TestcaseDetails) => TParam, reduce: (v: TParam[]) => TParam): TParam { - return reduce(source.judge.subtasks.map(s => reduce(s.cases.filter(c => c.result != null).map(c => map(c.result))))); + const list = source.judge.subtasks.map(s => reduce(s.cases.filter(c => c.result != null).map(c => map(c.result))))); + if (list.every(x => x == null)) return null; + else return reduce(list); } + time = forEveryTestcase(c => c.time, _.sum); memory = forEveryTestcase(c => c.memory, _.max);