From 2e2c44a6ffe73c471a8a008f06f304f09d17d98f Mon Sep 17 00:00:00 2001 From: Wen-Ching Wei <115555327+weiwch@users.noreply.github.com> Date: Thu, 10 Sep 2026 20:45:55 +0800 Subject: [PATCH] fix: problem 22 checker scoring Correct the score denominator to divide by 2 * N, and enlarge the verdict message buffer to prevent valid submissions from crashing the checker. --- algorithmic/problems/22/checker.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/algorithmic/problems/22/checker.cpp b/algorithmic/problems/22/checker.cpp index 89d4fc0ca..a7d9a6392 100644 --- a/algorithmic/problems/22/checker.cpp +++ b/algorithmic/problems/22/checker.cpp @@ -117,10 +117,9 @@ int main(int argc, char* argv[]) { if (cnt != (int)nodes.size()) quitf(_wa, "S_%d is not connected in new tree (%d of %d reachable)", j, cnt, (int)nodes.size()); } - double ratio = max(0.0, min(1.0, 1.0 * (5 * N - K) / 2 * N)); - double unbounded_ratio = max(0.0, 1.0 * (5 * N - K) / 2 * N); + double ratio = max(0.0, min(1.0, 1.0 * (5 * N - K) / (2 * N))); + double unbounded_ratio = max(0.0, 1.0 * (5 * N - K) / (2 * N)); char mes[128]; sprintf(mes, "Ratio: %lf, RatioUnbounded: %lf", ratio, unbounded_ratio); quitp(ratio, "%s", mes); } -