mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: skip subtask if already unaccepted (#34)
This commit is contained in:
1 parent
1817341eee
commit
9f0668d938
6 files changed
+26
-7
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.1.27",
|
||||
"version": "2.1.28",
|
||||
"main": "package.json",
|
||||
"author": "masnn",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
@@ -14,8 +14,8 @@
|
||||
"lodash": "^4.17.20",
|
||||
"p-queue": "^6.6.1",
|
||||
"shell-quote": "^1.7.2",
|
||||
"supports-color": "^7.2.0",
|
||||
"systeminformation": "^4.30.1",
|
||||
"supports-color": "^8.0.0",
|
||||
"systeminformation": "^4.30.6",
|
||||
"yargs": "^16.1.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
|
||||
@@ -18,6 +18,21 @@ const Score = {
|
||||
|
||||
function judgeCase(c) {
|
||||
return async (ctx, ctxSubtask) => {
|
||||
if ((ctxSubtask.subtask.type === 'min' && !ctxSubtask.score)
|
||||
|| (ctxSubtask.subtask.type === 'max' && ctxSubtask.score === ctxSubtask.subtask.score)) {
|
||||
ctx.next({
|
||||
status: STATUS.STATUS_JUDGING,
|
||||
case: {
|
||||
status: STATUS.STATUS_CANCELED,
|
||||
score: 0,
|
||||
time_ms: 0,
|
||||
memory_kb: 0,
|
||||
message: '',
|
||||
},
|
||||
progress: Math.floor((c.id * 100) / ctx.config.count),
|
||||
}, c.id);
|
||||
return;
|
||||
}
|
||||
const { filename } = ctx.config;
|
||||
const copyIn = { ...ctx.execute.copyIn };
|
||||
if (filename) copyIn[`${filename}.in`] = { src: c.input };
|
||||
|
||||
Reference in new issue
Block a user