| 259 | return {ans, A}; |
| 260 | } |
| 261 | pair<poly, poly> divmod(const poly &b) const { // returns quotient and remainder of a mod b |
| 262 | if(size() < b.size()) return {poly{0}, *this}; |
| 263 | int d = size() - b.size(); |
| 264 | if(min(d, b.size()) < 250) return divmod_slow(b); |
| 265 | poly D = (reverse_it(d + 1) * b.reverse_it(d + 1).inverse(d + 1)).mod_xk(d + 1).reverse_it(d + 1, 1); |
| 266 | return {D, *this - (D * b)}; |
| 267 | } |
| 268 | poly operator / (const poly &t) const {return divmod(t).first;} |
| 269 | poly operator % (const poly &t) const {return divmod(t).second;} |
| 270 | poly& operator /= (const poly &t) {return *this = divmod(t).first;} |
nothing calls this directly
no test coverage detected