1
0
Fork 0

Update include.hh

This commit is contained in:
Ariel 2024-02-24 13:37:16 +08:00 committed by GitHub
parent d08a4ddc4d
commit 9c78180bbf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -32,7 +32,7 @@ using pll = pair<ll, ll>;
constexpr int INF = 0x3f3f3f3f; constexpr int INF = 0x3f3f3f3f;
constexpr ull MDL = 1e9 + 7; constexpr ull MDL = 1e9 + 7;
constexpr ull PRIME = 998'244'353; constexpr ull PRIME = 998'244'353;
constexpr ll MDL1 = 8784491; constexpr ll MDL1 = 825;
constexpr ll MDL2 = PRIME; constexpr ll MDL2 = PRIME;
/* random */ /* random */
@ -138,6 +138,8 @@ template<typename T> ostream& operator<<(ostream& out, vector<T> vec) {
#define popfront(q, ...) __AS_PROCEDURE(auto [__VA_ARGS__] = q.front();q.pop_front();) #define popfront(q, ...) __AS_PROCEDURE(auto [__VA_ARGS__] = q.front();q.pop_front();)
/* math */ /* 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) { void __exgcd(ll a, ll b, ll& x, ll& y) {
if (b == 0) { if (b == 0) {
x = 1, y = 0; x = 1, y = 0;
@ -203,3 +205,4 @@ int period(string s) { // find the length of shortest recurring period
return n; return n;
} }
///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////