mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
utils: fix normalizeSubtasks score (#356)
This commit is contained in:
1 parent
a585c13a72
commit
842322d15c
5 files changed
+7
-7
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.20.0",
|
||||
"version": "2.20.1",
|
||||
"main": "package.json",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.13.5",
|
||||
"version": "3.13.6",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/ui-default",
|
||||
"version": "4.37.2",
|
||||
"version": "4.37.3",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"license": "AGPL-3.0",
|
||||
"main": "hydro.js",
|
||||
|
||||
@@ -284,25 +284,25 @@ export function normalizeSubtasks(
|
||||
return subtasks.map((s) => {
|
||||
id++;
|
||||
s.cases.sort((a, b) => (a.id - b.id));
|
||||
const score = subtaskScore.next().value as number;
|
||||
const score = s.score || subtaskScore.next().value as number;
|
||||
const caseScore = getScore(
|
||||
Math.max(score - Math.sum(s.cases.map((i) => i.score || 0)), 0),
|
||||
s.cases.filter((i) => !i.score).length,
|
||||
);
|
||||
return {
|
||||
id,
|
||||
score,
|
||||
type: 'min',
|
||||
if: [],
|
||||
...s,
|
||||
score,
|
||||
time: parseTimeMS(s.time || time, !ignoreParseError),
|
||||
memory: parseMemoryMB(s.memory || memory, !ignoreParseError),
|
||||
cases: s.cases.map((c) => {
|
||||
count++;
|
||||
return {
|
||||
id: count,
|
||||
score: s.type === 'sum' ? caseScore.next().value as number : score,
|
||||
...c,
|
||||
score: c.score || (s.type === 'sum' ? caseScore.next().value as number : score),
|
||||
time: parseTimeMS(c.time || s.time || time, !ignoreParseError),
|
||||
memory: parseMemoryMB(c.memory || s.memory || memory, !ignoreParseError),
|
||||
input: c.input ? checkFile(c.input, 'Cannot find input file {0}.') : '/dev/null',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/utils",
|
||||
"version": "1.2.4",
|
||||
"version": "1.2.5",
|
||||
"description": "hydrooj utils",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
Reference in new issue
Block a user