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); } -