judge: fix readCases with limits

This commit is contained in:
undefined committed 2021-04-18 21:35:36 +08:00
1 parent bee8537a91
commit 04a68e35bd
4 files changed
+17 -17

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.5.3",
"version": "2.5.4",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+9 -9
View File
@@ -20,17 +20,17 @@ interface Re1 extends Re0 {
const RE0: Re0[] = [
{
reg: /^([a-z+_\-A-Z]*)([0-9]+).in$/,
reg: /^([^\d]*)([0-9]+).in$/,
output: (a) => `${a[1] + a[2]}.out`,
id: (a) => parseInt(a[2], 10),
},
{
reg: /^([a-z+_\-A-Z]*)([0-9]+).in$/,
reg: /^([^\d]*)([0-9]+).in$/,
output: (a) => `${a[1] + a[2]}.ans`,
id: (a) => parseInt(a[2], 10),
},
{
reg: /^([a-z+_\-A-Z0-9]*)\.in([0-9]+)$/,
reg: /^([^\d]*)\.in([0-9]+)$/,
output: (a) => `${a[1]}.ou${a[2]}`,
id: (a) => parseInt(a[2], 10),
},
@@ -40,17 +40,17 @@ const RE0: Re0[] = [
id: (a) => parseInt(a[2], 10),
},
{
reg: /^input\/([a-z+_\-A-Z]*)([0-9]+).in$/,
reg: /^input\/([^\d]*)([0-9]+).in$/,
output: (a) => `output/${a[1] + a[2]}.out`,
id: (a) => parseInt(a[2], 10),
},
{
reg: /^input\/([a-z+_\-A-Z]*)([0-9]+).in$/,
reg: /^input\/([^\d]*)([0-9]+).in$/,
output: (a) => `output/${a[1] + a[2]}.ans`,
id: (a) => parseInt(a[2], 10),
},
{
reg: /^input\/([a-z+_\-A-Z0-9]*)\.in([0-9]+)$/,
reg: /^input\/([^\d]*)\.in([0-9]+)$/,
output: (a) => `output/${a[1]}.ou${a[2]}`,
id: (a) => parseInt(a[2], 10),
},
@@ -228,9 +228,9 @@ export default async function readCases(folder: string, cfg: Record<string, any>
throw changeErrorType(e, FormatError);
}
if (!(result.outputs || result.subtasks.length)) {
const c = await readAutoCases(folder, args, cfg);
config.subtasks = c.subtasks;
config.count = c.count;
const c = await readAutoCases(folder, args, config);
result.subtasks = c.subtasks;
result.count = c.count;
}
isValidConfig(result);
return result;