mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
core: adjust problem difficulty weight
This commit is contained in:
1 parent
9e86d47d19
commit
1173407598
2 files changed
+7
-5
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.8.0",
|
||||
"version": "3.8.1",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -22,6 +22,8 @@ interface RpDef {
|
||||
base: number;
|
||||
}
|
||||
|
||||
const { log, max, min } = Math;
|
||||
|
||||
export const RpTypes: Record<string, RpDef> = {
|
||||
problem: {
|
||||
async run(domainIds, udict, report) {
|
||||
@@ -38,13 +40,13 @@ export const RpTypes: Record<string, RpDef> = {
|
||||
},
|
||||
);
|
||||
const difficulty = +pdoc.difficulty || difficultyAlgorithm(pdoc.nSubmit, pdoc.nAccept) || 5;
|
||||
const p = difficulty / (Math.log(pdoc.nAccept) + 1) / 100;
|
||||
const p = difficulty / 100;
|
||||
let psdoc;
|
||||
while (psdoc = await cursor.next()) {
|
||||
udict[psdoc.uid] += Math.max(psdoc.score, 100) * p;
|
||||
udict[psdoc.uid] += min(psdoc.score, 100) * p;
|
||||
}
|
||||
}
|
||||
for (const key in udict) udict[key] = Math.max(0, Math.log(udict[key]) / Math.log(1.03));
|
||||
for (const key in udict) udict[key] = max(0, min(udict[key], log(udict[key]) / log(1.03)));
|
||||
},
|
||||
hidden: false,
|
||||
base: 0,
|
||||
@@ -75,7 +77,7 @@ export const RpTypes: Record<string, RpDef> = {
|
||||
},
|
||||
});
|
||||
}
|
||||
for (const key in udict) udict[key] = udict[key] / 2 - 725;
|
||||
for (const key in udict) udict[key] = udict[key] / 2 - 700;
|
||||
},
|
||||
hidden: false,
|
||||
base: 1500,
|
||||
|
||||
Reference in new issue
Block a user