core: contest.ioi: fix pending count (#843)

This commit is contained in:
Milmon authored and GitHub committed 2024-07-21 10:20:04 +08:00
1 parent 17ebdea6b2
commit 94a1d70a28
1 file changed
+4 -3
+4 -3
View File
@@ -283,14 +283,15 @@ const oi = buildContestRule({
// eslint-disable-next-line @typescript-eslint/no-use-before-define
const lockAt = isLocked(tdoc) ? tdoc.lockAt : null;
for (const j of journal.filter((i) => tdoc.pids.includes(i.pid))) {
if (!detail[j.pid] || detail[j.pid].score < j.score || this.submitAfterAccept) {
detail[j.pid] = j;
display[j.pid] ||= {};
if (lockAt && j.rid.getTimestamp() > lockAt) {
npending[j.pid]++;
display[j.pid] ||= {};
display[j.pid].npending = npending[j.pid];
continue;
}
if (!detail[j.pid] || detail[j.pid].score < j.score || this.submitAfterAccept) {
detail[j.pid] = j;
display[j.pid] ||= {};
display[j.pid] = j;
}
}