From 29ae86a934c8417286fcacb12d80f4a4113fa30a Mon Sep 17 00:00:00 2001 From: arielherself Date: Fri, 10 Jan 2025 16:13:33 +0800 Subject: [PATCH] fix(template): wrong upper bound for binary search --- template.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template.cc b/template.cc index aeb39b7..6c43569 100644 --- a/template.cc +++ b/template.cc @@ -296,7 +296,7 @@ ll qpow(ll b, ll p, ll mod) { #pragma GCC diagnostic ignored "-Wparentheses" // Accurately find `i` 'th root of `n` (taking the floor) inline ll root(ll n, ll i) { - ll l = 0, r = pow(LLONG_MAX, (long double)(1) / i); + ll l = 0, r = pow(INFLL, (long double)(1) / i); while (l < r) { ll mid = l + r + 1 >> 1; if (qpow(mid, i) <= n) {