MCPcopy Index your code
hub / github.com/hydro-dev/Hydro / difficultyAlgorithm

Function difficultyAlgorithm

packages/hydrooj/src/lib/difficulty.ts:37–43  ·  view source on GitHub ↗
(nSubmit: number, nAccept: number)

Source from the content-addressed store, hash-verified

35}
36
37function difficultyAlgorithm(nSubmit: number, nAccept: number) {
38 if (!nSubmit) return null;
39 const s = _integrate(nSubmit);
40 const acRate = nAccept / nSubmit;
41 const ans = Math.round(10 - 13 * s * acRate);
42 return Math.max(ans, 1);
43}
44
45export default difficultyAlgorithm;

Callers 1

runFunction · 0.85

Calls 1

_integrateFunction · 0.85

Tested by

no test coverage detected