core: remote judge api

This commit is contained in:
undefined committed 2021-06-21 13:39:39 +08:00
1 parent 939584ec5e
commit 680e3ccd32
11 files changed
+54 -13

No files matched your search

+5
View File
@@ -26,15 +26,20 @@ export function buildContent(source: ProblemSource | ContentNode[], type: 'markd
node.type !== 'Plain' ? `## ${node.sectionTitle}` : '',
...node.type === 'Sample'
? [
'',
`\`\`\`input${++cnt}`,
node.payload[0],
'```',
'',
`\`\`\`output${cnt}`,
node.payload[1],
'```',
'',
]
: [],
'',
node.text,
'',
].join('\n')).join('\n');
}
return type === 'html'
@@ -16,6 +16,8 @@ export async function parseConfig(config: string | ProblemConfigFile = {}) {
timeMax: 0,
type: cfg.type || 'default',
};
if (cfg.subType) result.subType = cfg.subType;
if (cfg.target) result.target = cfg.target;
if (cfg.subtasks.length) {
for (const subtask of cfg.subtasks) {
result.memoryMax = Math.max(result.memoryMax, subtask.memory);