ac-library-rs
ac-library-rs copied to clipboard
u32 modulo fix
https://github.com/rust-lang-ja/ac-library-rs/issues/111
Fix a problem with cases like 2^31 < modulo < 2^32 due to poor implementation of ac-library's overflow/underflow check.
Rebased commit to current rust-lang-ja:master.
AtCoder Library Practice Contest F - Convolution before: 239ms https://atcoder.jp/contests/practice2/submissions/38240676 after: 242ms https://atcoder.jp/contests/practice2/submissions/38240720
@mizar Does this fix correspond to a PR in atcoder/ac-library, or is this an original improvement?
@TonalidadeHidrica https://github.com/atcoder/ac-library/issues/149 I have sent an issue to ac-library, but have not yet sent a pull request.
This proposed change has been incorporated into ACL 1.5.1 and is expected to be available in the 202301 language update for C++.
- https://github.com/atcoder/ac-library/issues/149
- https://github.com/atcoder/ac-library/pull/163
- https://github.com/atcoder/ac-library/releases/tag/v1.5.1
- AtCoder 2023/1 Language Update > 要確認事項
2023/04/12 新ジャッジアップデートと共にACLのアップデートも予定しています。新バージョンは v1.5.1 です。 release はこちら https://github.com/atcoder/ac-library/releases/tag/v1.5.1
Regarding the proposed 2^31 <= m < 2^32 response to ModInt addition and subtraction, the response was as follows.
https://github.com/atcoder/ac-library/issues/164#issuecomment-1514700101
Thanks for suggestion, but we don't have a plan to extend mod range to
m < 2^32. As far as I know, at least 99% usage of modint ism < 2^31. TBH I don't came up any recent problems that requires2^31 < m < 2^32. So, we prefer to preparem < 2^31modint rather thanm < 2^32modint with tricky technique.