judge: support time_limit_rate & memory_limit_rate per problem (#541)

Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
undefinedandpanda authored and GitHub committed 2023-03-22 19:09:54 +08:00
1 parent f01a8b6671
commit 560e7c627f
13 files changed
+38 -19

No files matched your search

@@ -40,6 +40,14 @@ const problemConfigSchema: JSONSchema7 = {
time: { type: 'string', pattern: '^([0-9]+(?:\\.[0-9]*)?)([mu]?)s?$' },
memory: { type: 'string', pattern: '^([0-9]+(?:\\.[0-9]*)?)([kKmMgG])[bB]?$' },
score: { type: 'integer', maximum: 100, minimum: 1 },
rateConfig: {
type: 'object',
patternProperties: {
'^.+$': {
type: 'number',
},
},
},
},
properties: {
redirect: { type: 'string', pattern: '[0-9a-zA-Z_-]+\\/[0-9]+' },
@@ -89,6 +97,8 @@ const problemConfigSchema: JSONSchema7 = {
},
additionalProperties: false,
},
time_limit_rate: { $ref: '#/definitions/rateConfig' },
memory_limit_rate: { $ref: '#/definitions/rateConfig' },
},
additionalProperties: false,
};
@@ -31,6 +31,7 @@ const configKey = [
'memory', 'filename', 'checker_type', 'checker', 'interactor',
'validator', 'user_extra_files', 'judge_extra_files', 'detail', 'outputs',
'redirect', 'cases', 'subtasks', 'langs', 'key',
'time_limit_rate', 'memory_limit_rate',
];
const subtasksKey = [