1
0
Fork 0

Update sparse_table.cc

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

View File

@ -16,7 +16,7 @@ template<typename _Tp, typename _Op = function<_Tp(const _Tp&, const _Tp&)>> str
} }
} }
_Tp query(size_t __start, size_t __end) { _Tp query(size_t __start, size_t __end) {
int s = log2(__end - __start + 1); int s = lg2(__end - __start + 1);
return op(st[__start][s], st[__end - (1 << s) + 1][s]); return op(st[__start][s], st[__end - (1 << s) + 1][s]);
} }
}; };