mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix naccept on error (#565)
This commit is contained in:
1 parent
facbd7fc55
commit
67f0d1d596
1 file changed
+3
-3
@@ -66,14 +66,14 @@ const acm = buildContestRule({
|
|||||||
const lockAt = isLocked(tdoc) ? tdoc.lockAt : null;
|
const lockAt = isLocked(tdoc) ? tdoc.lockAt : null;
|
||||||
for (const j of journal) {
|
for (const j of journal) {
|
||||||
if (!this.submitAfterAccept && display[j.pid]?.status === STATUS.STATUS_ACCEPTED) continue;
|
if (!this.submitAfterAccept && display[j.pid]?.status === STATUS.STATUS_ACCEPTED) continue;
|
||||||
|
if (![STATUS.STATUS_ACCEPTED, STATUS.STATUS_COMPILE_ERROR, STATUS.STATUS_FORMAT_ERROR].includes(j.status)) {
|
||||||
|
naccept[j.pid]++;
|
||||||
|
}
|
||||||
const real = Math.floor((j.rid.getTimestamp().getTime() - tdoc.beginAt.getTime()) / 1000);
|
const real = Math.floor((j.rid.getTimestamp().getTime() - tdoc.beginAt.getTime()) / 1000);
|
||||||
const penalty = 20 * 60 * naccept[j.pid];
|
const penalty = 20 * 60 * naccept[j.pid];
|
||||||
detail[j.pid] = {
|
detail[j.pid] = {
|
||||||
...j, naccept: naccept[j.pid], time: real + penalty, real, penalty,
|
...j, naccept: naccept[j.pid], time: real + penalty, real, penalty,
|
||||||
};
|
};
|
||||||
if (![STATUS.STATUS_ACCEPTED, STATUS.STATUS_COMPILE_ERROR, STATUS.STATUS_FORMAT_ERROR].includes(j.status)) {
|
|
||||||
naccept[j.pid]++;
|
|
||||||
}
|
|
||||||
if (lockAt && j.rid.getTimestamp() > lockAt) {
|
if (lockAt && j.rid.getTimestamp() > lockAt) {
|
||||||
npending[j.pid]++;
|
npending[j.pid]++;
|
||||||
// FIXME this is tricky
|
// FIXME this is tricky
|
||||||
|
|||||||
Reference in new issue
Block a user