judge: fix case settings not enable (#388)

* judge: fix case settings not enable

* judge: change to only case settings
pull/389/head
panda 2 years ago committed by GitHub
parent 997b403db3
commit ad97b6b959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.22.0",
"version": "2.22.1",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",

@ -50,8 +50,8 @@ function judgeCase(c: NormalizedCase, sid: string) {
stdin,
copyIn,
copyOutCached,
time: ctxSubtask.subtask.time * ctx.execute.time,
memory: ctxSubtask.subtask.memory,
time: c.time * ctx.execute.time,
memory: c.memory,
cacheStdoutAndStderr: true,
},
);
@ -63,9 +63,9 @@ function judgeCase(c: NormalizedCase, sid: string) {
let message: any = '';
let score = 0;
if (status === STATUS.STATUS_ACCEPTED) {
if (time_usage_ms > ctxSubtask.subtask.time * ctx.execute.time) {
if (time_usage_ms > c.time * ctx.execute.time) {
status = STATUS.STATUS_TIME_LIMIT_EXCEEDED;
} else if (memory_usage_kb > ctxSubtask.subtask.memory * 1024) {
} else if (memory_usage_kb > c.memory * 1024) {
status = STATUS.STATUS_MEMORY_LIMIT_EXCEEDED;
} else {
[status, score, message] = await check({

@ -25,14 +25,14 @@ function judgeCase(c: NormalizedCase) {
{
execute: ctx.executeUser.execute,
copyIn: ctx.executeUser.copyIn,
time: ctxSubtask.subtask.time * ctx.executeUser.time,
memory: ctxSubtask.subtask.memory,
time: c.time * ctx.executeUser.time,
memory: c.memory,
},
{
execute: `${ctx.executeInteractor.execute} /w/in /w/tout /w/out`,
copyIn: ctx.executeInteractor.copyIn,
time: ctxSubtask.subtask.time * 2 * ctx.executeInteractor.time,
memory: ctxSubtask.subtask.memory * 2,
time: c.time * 2 * ctx.executeInteractor.time,
memory: c.memory * 2,
copyOut: ['/w/tout?'],
env: { ...ctx.env, HYDRO_TESTCASE: c.id.toString() },
},
@ -41,9 +41,9 @@ function judgeCase(c: NormalizedCase) {
let status: number;
let score = 0;
let message: any = '';
if (time_usage_ms > ctxSubtask.subtask.time * ctx.executeUser.time) {
if (time_usage_ms > c.time * ctx.executeUser.time) {
status = STATUS.STATUS_TIME_LIMIT_EXCEEDED;
} else if (memory_usage_kb > ctxSubtask.subtask.memory * 1024) {
} else if (memory_usage_kb > c.memory * 1024) {
status = STATUS.STATUS_MEMORY_LIMIT_EXCEEDED;
} else if ((code && code !== 13/* Broken Pipe */) || (code === 13 && !resInteractor.code)) {
status = STATUS.STATUS_RUNTIME_ERROR;

Loading…
Cancel
Save