From 2cc9c6a06a53ad8b0cc590c735941e627d2976c4 Mon Sep 17 00:00:00 2001 From: undefined Date: Mon, 7 Dec 2020 23:47:53 +0800 Subject: [PATCH] judge: better config --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/cases.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index e026b5346..f7b92109d 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.1.32", + "version": "2.1.33", "main": "package.json", "author": "masnn", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/cases.ts b/packages/hydrojudge/src/cases.ts index 7641f4fa2..bf7e5964c 100644 --- a/packages/hydrojudge/src/cases.ts +++ b/packages/hydrojudge/src/cases.ts @@ -226,8 +226,8 @@ export async function readYamlCases(folder: string, cfg: Dictionary = {}, a if (cfg.cases) { config.subtasks = [{ score: parseInt(cfg.score, 10) || Math.floor(100 / config.count), - time_limit_ms: parseTimeMS(cfg.time), - memory_limit_mb: parseMemoryMB(cfg.memory), + time_limit_ms: parseTimeMS(cfg.time || '1s'), + memory_limit_mb: parseMemoryMB(cfg.memory || '512m'), cases: [], type: 'sum', }]; @@ -254,8 +254,8 @@ export async function readYamlCases(folder: string, cfg: Dictionary = {}, a score: parseInt(subtask.score, 10), if: subtask.if || [], cases, - time_limit_ms: parseTimeMS(subtask.time || cfg.time), - memory_limit_mb: parseMemoryMB(subtask.memory || cfg.memory), + time_limit_ms: parseTimeMS(subtask.time || cfg.time || '1s'), + memory_limit_mb: parseMemoryMB(subtask.memory || cfg.memory || '512m'), }); } } else {