mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: contest: 显示首A者
This commit is contained in:
1 parent
74cd467bfa
commit
f6f714756b
5 files changed
+21
-5
No files matched your search
@@ -179,6 +179,17 @@ const oi: ContestRule = {
|
||||
}
|
||||
}
|
||||
const psdict = {};
|
||||
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]?.accept && tsddict[pid].rid.generationTime < first[pid]) {
|
||||
first[pid] = tsddict[pid].rid.generationTime;
|
||||
}
|
||||
}
|
||||
}
|
||||
// eslint-disable-next-line @typescript-eslint/no-use-before-define
|
||||
if (isDone(tdoc)) {
|
||||
const psdocs = await Promise.all(
|
||||
@@ -227,11 +238,15 @@ const oi: ContestRule = {
|
||||
],
|
||||
});
|
||||
} else {
|
||||
row.push({
|
||||
const node: ScoreboardNode = {
|
||||
type: 'record',
|
||||
value: tsddict[pid]?.score ?? '-',
|
||||
raw: tsddict[pid]?.rid || null,
|
||||
});
|
||||
};
|
||||
if (tsddict[pid]?.accept && tsddict[pid]?.rid.generationTime === first[pid]) {
|
||||
node.style = 'background-color: rgb(217, 240, 199);';
|
||||
}
|
||||
row.push(node);
|
||||
}
|
||||
}
|
||||
rows.push(row);
|
||||
|
||||
Reference in new issue
Block a user