ac-library-rs
ac-library-rs copied to clipboard
Arithmetic operations between primitive and modint
It would be convenient if we could u32 + Modint, and so on.
Currently Modint + u32 is implemented, but not vice versa.
Personally I, as a Rust competitive programmer, doubt it's useful. I assume that in expressions like x + y, x and y have the same type. This change will break the assumption.
Well, I contradicted myself: https://github.com/koba-e964/contest/blob/324d28f4c6704e4f21630e85ea07ac8396fd8320/comm/MInt.rs#L30-L47