utils: update testcase parser

This commit is contained in:
undefined committed 2024-01-18 13:57:49 +08:00
1 parent 911676b050
commit f25fb402cd
8 files changed
+23 -31

No files matched your search

+5 -1
View File
@@ -240,10 +240,12 @@ interface MatchRule {
const SubtaskMatcher: MatchRule[] = [
{
regex: /^(([A-Za-z0-9._-]*?)(?:(\d*)[-_])?(\d+))\.(in|txt)$/,
regex: /^(([A-Za-z0-9._-]*?)(?:(\d*)[-_])?(\d+))\.(in|txt|in\.txt)$/,
output: [
(a) => `${a[1]}.out`,
(a) => `${a[1]}.out.txt`,
(a) => `${a[1]}.ans`,
(a) => `${a[1]}.ans.txt`,
(a) => `${a[1]}.out`.replace(/input/g, 'output'),
(a) => (a[1].includes('input') ? `${a[1]}.txt`.replace(/input/g, 'output') : null),
],
@@ -256,6 +258,8 @@ const SubtaskMatcher: MatchRule[] = [
output: [
(a) => `${a[1]}.ou${a[2]}`,
(a) => `${a[1]}.ou${a[2]}`.replace(/input/g, 'output'),
(a) => `${a[1]}.out${a[2]}`,
(a) => `${a[1]}.out${a[2]}`.replace(/input/g, 'output'),
],
id: (a) => +a[2],
subtask: () => 1,