mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 支持限制题目的提交语言
This commit is contained in:
1 parent
f33d440b68
commit
75429bb43b
10 files changed
+44
-25
No files matched your search
@@ -3,11 +3,12 @@ import { load } from 'js-yaml';
|
||||
import type { ProblemConfig } from '../interface';
|
||||
|
||||
interface ParseResult {
|
||||
count: number,
|
||||
memoryMax: number,
|
||||
memoryMin: number,
|
||||
timeMax: number,
|
||||
timeMin: number,
|
||||
count: number;
|
||||
memoryMax: number;
|
||||
memoryMin: number;
|
||||
timeMax: number;
|
||||
timeMin: number;
|
||||
langs?: string[];
|
||||
}
|
||||
|
||||
export async function parseConfig(config: string | ProblemConfig = {}) {
|
||||
@@ -40,6 +41,7 @@ export async function parseConfig(config: string | ProblemConfig = {}) {
|
||||
if (result.timeMax < result.timeMin) {
|
||||
result.timeMax = result.timeMin = 1000;
|
||||
}
|
||||
if (cfg.langs) result.langs = cfg.langs;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user