mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 09:38:19 +08:00
core: acm scoreboard: mark first accept
This commit is contained in:
1 parent
e64a443bbb
commit
36cce6d1bd
2 files changed
+15
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "2.39.17",
|
||||
"version": "2.39.18",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user