Skip to content

Commit

Permalink
Merge pull request #8 from flaryer/only_nsjail
Browse files Browse the repository at this point in the history
time-->sys+usr
  • Loading branch information
A0nameless0man authored Nov 5, 2021
2 parents 13524fe + b0e129f commit 6f65220
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/Utilities/Judge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,10 @@ export abstract class JudgeAgent {
return executableAgent.compile();
});
if (compileResult !== undefined) {
const compileSumTime =
compileResult.time.sys + compileResult.time.usr;
const exteaInfo = {
compileTime: this.transformTime(compileResult.time.usr),
compileTime: this.transformTime(compileSumTime),
compileMessage: await readStream(
fs.createReadStream(
await executableAgent.fileAgent.getPath(CompileLogName),
Expand All @@ -184,7 +186,7 @@ export abstract class JudgeAgent {
if (compileResult.signal === 25) {
compileJudgeType = transformer.ole;
} else if (
compileResult.time.usr > executable.limit.compiler.cpuTime ||
compileSumTime > executable.limit.compiler.cpuTime ||
(compileResult.time.real > executable.limit.compiler.cpuTime &&
compileResult.returnCode === -1 &&
compileResult.signal === 9)
Expand Down Expand Up @@ -298,11 +300,13 @@ export abstract class JudgeAgent {
sysJudge += sysErr;
}
const sysSummary = sysJudge.slice(0, 4).toLocaleLowerCase();
const userRunSumTime = userResult.time.usr + userResult.time.sys;
const sysRunSumTime = sysResult.time.usr + sysResult.time.sys;
const kind = ((): JudgeResultKind => {
if (userResult.signal === 25) {
return JudgeResultKind.OutpuLimitExceeded;
} else if (
userResult.time.usr > userExec.limit.runtime.cpuTime ||
userRunSumTime > userExec.limit.runtime.cpuTime ||
(userResult.time.real > userExec.limit.runtime.cpuTime &&
userResult.returnCode === -1 &&
userResult.signal === 9)
Expand All @@ -319,7 +323,7 @@ export abstract class JudgeAgent {
} else if (sysResult.signal === 25) {
return JudgeResultKind.SystemOutpuLimitExceeded;
} else if (
sysResult.time.usr > sysExec.limit.runtime.cpuTime ||
sysRunSumTime > sysExec.limit.runtime.cpuTime ||
(sysResult.time.real > sysExec.limit.runtime.cpuTime &&
sysResult.returnCode === -1 &&
sysResult.signal === 9)
Expand All @@ -346,7 +350,7 @@ export abstract class JudgeAgent {
return JudgeResultKind.WrongAnswer;
}
})();
const rawTime = userResult.time.usr;
const rawTime = userRunSumTime;
// sleep(inf);
// codeforces: Idleness limit exceeded, time: 0ms
// luogu: TLE, time: 1ms
Expand Down

0 comments on commit 6f65220

Please sign in to comment.