core: acm scoreboard: mark first accept

This commit is contained in:
undefined committed 2021-10-11 20:15:54 +08:00
1 parent e64a443bbb
commit 36cce6d1bd
2 files changed
+15 -1

No files matched your search

+14
View File
@@ -107,6 +107,17 @@ const acm: ContestRule = {
});
}
}
const first = {};
for (const pid of tdoc.pids) first[pid] = new ObjectID().generationTime;
for (const [, tsdoc] of rankedTsdocs) {
const tsddict = {};
for (const item of tsdoc.journal || []) tsddict[item.pid] = item;
for (const pid of tdoc.pids) {
if (tsddict[pid]?.status === STATUS.STATUS_ACCEPTED && tsddict[pid].rid.generationTime < first[pid]) {
first[pid] = tsddict[pid].rid.generationTime;
}
}
}
const rows: ScoreboardRow[] = [columns];
for (const [rank, tsdoc] of rankedTsdocs) {
const tsddict = {};
@@ -141,6 +152,9 @@ const acm: ContestRule = {
score: accept ? 100 : 0,
value: '{0}\n{1}'.format(colAccepted, colTimeStr),
raw: rid,
style: accept && rid.generationTime === first[pid]
? 'background-color: rgb(217, 240, 199);'
: undefined,
});
}
}