fix: problem 22 checker scoring - #187
Conversation
Correct the score denominator to divide by 2 * N, and enlarge the verdict message buffer to prevent valid submissions from crashing the checker.
|
Replayed this against the archived agent runs in the judge image (Ubuntu 22.04, g++ 11.4, glibc 2.35). Both changes are correct and the Codex run goes from 0.0 to 1.0 on all 10 cases as described. LGTM. One correction to the record, since the root cause in the description mixes up the two fixes. For future readers, the accurate version is:
Note that #184 carries the identical |
Correct the score denominator to divide by 2 * N, and enlarge the verdict message buffer to prevent valid submissions from crashing the checker.
Summary
Type of Change
Testing
Checklist
Root cause
The checker calculated the score as:
This divides by 2 and then multiplies by N, producing extremely large unbounded scores. Formatting those values overflowed the 30-byte mes buffer and caused the checker to terminate with:
*** buffer overflow detected *** (#184)
The intended formula is:
(5 * N - K) / (2 * N)
Even with the corrected formula, the full verdict message can exceed 30 bytes, so the buffer is also enlarged.
Validation