ac-library
ac-library copied to clipboard
AtCoder Library
The implementation of addition and subtraction in the ModInt structure does not seem to assume $2^{31}\le m\lt 2^{32}$. ## Suggested mitigation - Addition (plan A, cast 32/64-bit integer): - Cast...
Since ac-library doesn't provide functions for arbitrary modulo convolutions, I wrote an alternative. Its implementation is poor, but it's enough in most problems. ```cpp vector arbitrary_mod_convolution(const vector& v1, const vector&...
Hi, These days I'm working on a Simplified Chinese translation of the ACL documentation, and I would like to ask if you'd be willing to add the translation to this...
https://github.com/atcoder/ac-library/blob/d8ca7f26686f6c78d15d13ca438ea866526e87fb/atcoder/lazysegtree.hpp#L29 I think the comment here should be 'S(F, S)' instead of 'F(F, S)'.
.val() の帰り値が int ではなく unsigned int で帰ってきていそうな挙動を示します。 ```C++ #include using namespace std; #include using namespace atcoder; using mint = modint998244353; using mint2 = modint1000000007; int main(){ mint a = 1;...
This PR addresses [#187](https://github.com/atcoder/ac-library/issues/187) by replacing the loop-based implementation of bit_ceil with a constant-time version. Let me know if everything looks okay.
Currently, the `bit_ceil` function is implemented as: ```cpp unsigned int bit_ceil(unsigned int n) { unsigned int x = 1; while (x < (unsigned int)(n)) x *= 2; return x; }...
ドキュメントにいくつか改善点を発見したので報告します。 - segtree, fenwicktree - 最初の説明で $N$ が使われているが、 $n$ の方が良い - dsu - $\alpha(n)$ の説明がない - min_cost_slope - 線形補間することで $g(x)$ が表現されることが書かれていない - 「返り値の `.second` は狭義単調増加」は誤りで、広義単調増加