From 9c78180bbfe627d2654e96530961a270e0ab18be Mon Sep 17 00:00:00 2001 From: Ariel Date: Sat, 24 Feb 2024 13:37:16 +0800 Subject: [PATCH] Update include.hh --- include.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include.hh b/include.hh index 1d3fd64..08afcf3 100644 --- a/include.hh +++ b/include.hh @@ -32,7 +32,7 @@ using pll = pair; constexpr int INF = 0x3f3f3f3f; constexpr ull MDL = 1e9 + 7; constexpr ull PRIME = 998'244'353; -constexpr ll MDL1 = 8784491; +constexpr ll MDL1 = 825; constexpr ll MDL2 = PRIME; /* random */ @@ -138,6 +138,8 @@ template ostream& operator<<(ostream& out, vector vec) { #define popfront(q, ...) __AS_PROCEDURE(auto [__VA_ARGS__] = q.front();q.pop_front();) /* math */ +constexpr inline int lg2(ll x) { return x == 0 ? -1 : sizeof(ll) * 8 - 1 - __builtin_clzll(x); } + void __exgcd(ll a, ll b, ll& x, ll& y) { if (b == 0) { x = 1, y = 0; @@ -203,3 +205,4 @@ int period(string s) { // find the length of shortest recurring period return n; } ///////////////////////////////////////////////////////// +