mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: fix syzoj checker
This commit is contained in:
1 parent
f1d115f383
commit
9395ba1a7a
3 files changed
+9
-5
No files matched your search
@@ -155,7 +155,7 @@ const checkers: Record<string, Checker> = {
|
||||
* input:输入
|
||||
* user_out:选手输出
|
||||
* answer:标准输出
|
||||
* code:选手代码
|
||||
* code:选手代码 (not impl)
|
||||
* stdout:输出最终得分
|
||||
* stderr:输出错误报告
|
||||
*/
|
||||
@@ -166,7 +166,7 @@ const checkers: Record<string, Checker> = {
|
||||
input: { src: config.input },
|
||||
user_out: { src: config.user_stdout },
|
||||
answer: { src: config.output },
|
||||
code: { content: config.code },
|
||||
code: { content: '' },
|
||||
...config.copyIn,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -21,7 +21,8 @@ function judgeCase(c, sid) {
|
||||
return async (ctx, ctxSubtask) => {
|
||||
if ((ctxSubtask.subtask.type === 'min' && !ctxSubtask.score)
|
||||
|| (ctxSubtask.subtask.type === 'max' && ctxSubtask.score === ctxSubtask.subtask.score)
|
||||
|| (ctxSubtask.subtask.if && ctx.failed[sid])) {
|
||||
|| (ctxSubtask.subtask.if && ctx.failed[sid])
|
||||
|| ctx.errored) {
|
||||
ctx.next({
|
||||
case: {
|
||||
status: STATUS.STATUS_CANCELED,
|
||||
@@ -113,7 +114,10 @@ function judgeSubtask(subtask, sid) {
|
||||
for (const cid in subtask.cases) {
|
||||
cases.push(ctx.queue.add(() => judgeCase(subtask.cases[cid], sid)(ctx, ctxSubtask)));
|
||||
}
|
||||
await Promise.all(cases);
|
||||
await Promise.all(cases).catch((e) => {
|
||||
ctx.errored = true;
|
||||
throw e;
|
||||
});
|
||||
ctx.total_status = Math.max(ctx.total_status, ctxSubtask.status);
|
||||
if (ctx.total_status !== STATUS.STATUS_ACCEPTED) ctx.failed[sid] = true;
|
||||
return ctxSubtask.score;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.20.3",
|
||||
"version": "2.20.4",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "dist/loader.js",
|
||||
"typings": "dist/loader.d.ts",
|
||||
|
||||
Reference in new issue
Block a user